1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 09:23:21 +01:00

Replaced ActionableMessage component in srp-input (#20111)

* Replaced ActionableMessage component in srp-input

* Modified value of Severity in srp-input/BannerAler

* fixed lint error

* Updateddata-testid in banner and test/e2e/helpers.js

* Updated className with prefix

---------

Co-authored-by: George Marshall <george.marshall@consensys.net>
This commit is contained in:
Pritam Dhara 2023-08-04 21:12:28 +05:30 committed by GitHub
parent fee1606fad
commit 8c2e85bb8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 21 deletions

View File

@ -426,7 +426,7 @@ const importWrongSRPOnboardingFlow = async (driver, seedPhrase) => {
);
const warningText = 'Invalid Secret Recovery Phrase';
const warnings = await driver.findElements('.actionable-message__message');
const warnings = await driver.findElements('.import-srp__banner-alert-text');
const warning = warnings[1];
assert.equal(await warning.getText(), warningText);

View File

@ -4,14 +4,14 @@ import PropTypes from 'prop-types';
import { useI18nContext } from '../../../hooks/useI18nContext';
import TextField from '../../ui/text-field';
import { clearClipboard } from '../../../helpers/utils/util';
import ActionableMessage from '../../ui/actionable-message';
import { BannerAlert, Text } from '../../component-library';
import Dropdown from '../../ui/dropdown';
import ShowHideToggle from '../../ui/show-hide-toggle';
import {
TextAlign,
TextVariant,
Severity,
} from '../../../helpers/constants/design-system';
import { Text } from '../../component-library';
import { parseSecretRecoveryPhrase } from './parse-secret-recovery-phrase';
const defaultNumberOfWords = 12;
@ -132,11 +132,11 @@ export default function SrpInput({ onChange, srpText }) {
{srpText}
</Text>
</label>
<ActionableMessage
<BannerAlert
className="import-srp__paste-tip"
iconFillColor="var(--color-info-default)"
message={t('srpPasteTip')}
useIcon
severity={Severity.Info}
description={t('srpPasteTip')}
descriptionProps={{ className: 'import-srp__banner-alert-text' }}
/>
<Dropdown
className="import-srp__number-of-words-dropdown"
@ -200,25 +200,21 @@ export default function SrpInput({ onChange, srpText }) {
})}
</div>
{srpError ? (
<ActionableMessage
<BannerAlert
className="import-srp__srp-error"
iconFillColor="var(--color-error-default)"
message={srpError}
type="danger"
useIcon
severity={Severity.Danger}
description={srpError}
descriptionProps={{ className: 'import-srp__banner-alert-text' }}
/>
) : null}
{pasteFailed ? (
<ActionableMessage
<BannerAlert
className="import-srp__srp-too-many-words-error"
iconFillColor="var(--color-error-default)"
message={t('srpPasteFailedTooManyWords')}
primaryAction={{
label: t('dismiss'),
onClick: () => setPasteFailed(false),
}}
type="danger"
useIcon
severity={Severity.Danger}
actionButtonLabel={t('dismiss')}
actionButtonOnClick={() => setPasteFailed(false)}
description={t('srpPasteFailedTooManyWords')}
descriptionProps={{ className: 'import-srp__banner-alert-text' }}
/>
) : null}
</div>