mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Implement modern design for error messages (#11521)
This commit is contained in:
parent
493448c96e
commit
6f0e54aa26
@ -12,7 +12,7 @@ const ErrorMessage = (props, context) => {
|
||||
alt=""
|
||||
className="error-message__icon"
|
||||
/>
|
||||
<div className="error-message__text">{`ALERT: ${error}`}</div>
|
||||
<div className="error-message__text">{error}</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
@ -14,7 +14,7 @@ describe('ErrorMessage Component', () => {
|
||||
expect(wrapper.find('.error-message')).toHaveLength(1);
|
||||
expect(wrapper.find('.error-message__icon')).toHaveLength(1);
|
||||
expect(wrapper.find('.error-message__text').text()).toStrictEqual(
|
||||
'ALERT: This is an error.',
|
||||
'This is an error.',
|
||||
);
|
||||
});
|
||||
|
||||
@ -27,7 +27,7 @@ describe('ErrorMessage Component', () => {
|
||||
expect(wrapper.find('.error-message')).toHaveLength(1);
|
||||
expect(wrapper.find('.error-message__icon')).toHaveLength(1);
|
||||
expect(wrapper.find('.error-message__text').text()).toStrictEqual(
|
||||
'ALERT: translate testKey',
|
||||
'translate testKey',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
11
ui/components/ui/error-message/error-message.stories.js
Normal file
11
ui/components/ui/error-message/error-message.stories.js
Normal file
@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
import { text } from '@storybook/addon-knobs';
|
||||
import ErrorMessage from '.';
|
||||
|
||||
export default {
|
||||
title: 'ErrorMessage',
|
||||
};
|
||||
|
||||
export const primaryType = () => (
|
||||
<ErrorMessage errorMessage={text('Error Message:', 'There was an error!')} />
|
||||
);
|
@ -2,14 +2,14 @@
|
||||
@include H7;
|
||||
|
||||
min-height: 32px;
|
||||
border: 1px solid $monzo;
|
||||
color: $monzo;
|
||||
background: lighten($monzo, 56%);
|
||||
border-radius: 4px;
|
||||
border: 1px solid $Red-300;
|
||||
color: $ui-black;
|
||||
background: $error-2;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
padding: 8px 16px;
|
||||
padding: 8px 10px;
|
||||
|
||||
&__icon {
|
||||
margin-right: 8px;
|
||||
|
Loading…
Reference in New Issue
Block a user