mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +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:
parent
fee1606fad
commit
8c2e85bb8e
@ -426,7 +426,7 @@ const importWrongSRPOnboardingFlow = async (driver, seedPhrase) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const warningText = 'Invalid Secret Recovery Phrase';
|
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];
|
const warning = warnings[1];
|
||||||
|
|
||||||
assert.equal(await warning.getText(), warningText);
|
assert.equal(await warning.getText(), warningText);
|
||||||
|
@ -4,14 +4,14 @@ import PropTypes from 'prop-types';
|
|||||||
import { useI18nContext } from '../../../hooks/useI18nContext';
|
import { useI18nContext } from '../../../hooks/useI18nContext';
|
||||||
import TextField from '../../ui/text-field';
|
import TextField from '../../ui/text-field';
|
||||||
import { clearClipboard } from '../../../helpers/utils/util';
|
import { clearClipboard } from '../../../helpers/utils/util';
|
||||||
import ActionableMessage from '../../ui/actionable-message';
|
import { BannerAlert, Text } from '../../component-library';
|
||||||
import Dropdown from '../../ui/dropdown';
|
import Dropdown from '../../ui/dropdown';
|
||||||
import ShowHideToggle from '../../ui/show-hide-toggle';
|
import ShowHideToggle from '../../ui/show-hide-toggle';
|
||||||
import {
|
import {
|
||||||
TextAlign,
|
TextAlign,
|
||||||
TextVariant,
|
TextVariant,
|
||||||
|
Severity,
|
||||||
} from '../../../helpers/constants/design-system';
|
} from '../../../helpers/constants/design-system';
|
||||||
import { Text } from '../../component-library';
|
|
||||||
import { parseSecretRecoveryPhrase } from './parse-secret-recovery-phrase';
|
import { parseSecretRecoveryPhrase } from './parse-secret-recovery-phrase';
|
||||||
|
|
||||||
const defaultNumberOfWords = 12;
|
const defaultNumberOfWords = 12;
|
||||||
@ -132,11 +132,11 @@ export default function SrpInput({ onChange, srpText }) {
|
|||||||
{srpText}
|
{srpText}
|
||||||
</Text>
|
</Text>
|
||||||
</label>
|
</label>
|
||||||
<ActionableMessage
|
<BannerAlert
|
||||||
className="import-srp__paste-tip"
|
className="import-srp__paste-tip"
|
||||||
iconFillColor="var(--color-info-default)"
|
severity={Severity.Info}
|
||||||
message={t('srpPasteTip')}
|
description={t('srpPasteTip')}
|
||||||
useIcon
|
descriptionProps={{ className: 'import-srp__banner-alert-text' }}
|
||||||
/>
|
/>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
className="import-srp__number-of-words-dropdown"
|
className="import-srp__number-of-words-dropdown"
|
||||||
@ -200,25 +200,21 @@ export default function SrpInput({ onChange, srpText }) {
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
{srpError ? (
|
{srpError ? (
|
||||||
<ActionableMessage
|
<BannerAlert
|
||||||
className="import-srp__srp-error"
|
className="import-srp__srp-error"
|
||||||
iconFillColor="var(--color-error-default)"
|
severity={Severity.Danger}
|
||||||
message={srpError}
|
description={srpError}
|
||||||
type="danger"
|
descriptionProps={{ className: 'import-srp__banner-alert-text' }}
|
||||||
useIcon
|
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{pasteFailed ? (
|
{pasteFailed ? (
|
||||||
<ActionableMessage
|
<BannerAlert
|
||||||
className="import-srp__srp-too-many-words-error"
|
className="import-srp__srp-too-many-words-error"
|
||||||
iconFillColor="var(--color-error-default)"
|
severity={Severity.Danger}
|
||||||
message={t('srpPasteFailedTooManyWords')}
|
actionButtonLabel={t('dismiss')}
|
||||||
primaryAction={{
|
actionButtonOnClick={() => setPasteFailed(false)}
|
||||||
label: t('dismiss'),
|
description={t('srpPasteFailedTooManyWords')}
|
||||||
onClick: () => setPasteFailed(false),
|
descriptionProps={{ className: 'import-srp__banner-alert-text' }}
|
||||||
}}
|
|
||||||
type="danger"
|
|
||||||
useIcon
|
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user