mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
Deprecating ErrorMessage in favor of BannerAlert (#20461)
This commit is contained in:
parent
9cfa9ba6b0
commit
dc6069a3ab
@ -1,15 +0,0 @@
|
||||
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';
|
||||
|
||||
import ErrorMessage from '.';
|
||||
|
||||
# Error Message
|
||||
|
||||
This component highlights error messages
|
||||
|
||||
<Canvas>
|
||||
<Story id="components-ui-errormessage--default-story" />
|
||||
</Canvas>
|
||||
|
||||
## Props
|
||||
|
||||
<ArgsTable of={ErrorMessage} />
|
@ -4,13 +4,14 @@ import { Icon, IconName, IconSize } from '../../component-library';
|
||||
import { IconColor } from '../../../helpers/constants/design-system';
|
||||
|
||||
/**
|
||||
* @deprecated - Please use ActionableMessage type danger
|
||||
* @see ActionableMessage
|
||||
* @param {object} props
|
||||
* @param {string} props.errorMessage
|
||||
* @param {string} props.errorKey
|
||||
* @param {object} context
|
||||
* @deprecated The `<ErrorMessage />` component has been deprecated in favor of the new `<BannerAlert>` component from the component-library.
|
||||
* Please update your code to use the new `<BannerAlert>` component instead, which can be found at ui/components/component-library/banner-alert/banner-alert.js.
|
||||
* You can find documentation for the new BannerAlert component in the MetaMask Storybook:
|
||||
* {@link https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-banneralert--docs}
|
||||
* If you would like to help with the replacement of the old ErrorMessage component, please submit a pull request against this GitHub issue:
|
||||
* {@link https://github.com/MetaMask/metamask-extension/issues/20394}
|
||||
*/
|
||||
|
||||
const ErrorMessage = (props, context) => {
|
||||
const { errorMessage, errorKey } = props;
|
||||
const error = errorKey ? context.t(errorKey) : errorMessage;
|
||||
|
@ -1,16 +1,9 @@
|
||||
import React from 'react';
|
||||
import README from './README.mdx';
|
||||
import ErrorMessage from '.';
|
||||
|
||||
export default {
|
||||
title: 'Components/UI/ErrorMessage',
|
||||
|
||||
title: 'Components/UI/ErrorMessage(deprecated)',
|
||||
component: ErrorMessage,
|
||||
parameters: {
|
||||
docs: {
|
||||
page: README,
|
||||
},
|
||||
},
|
||||
argTypes: {
|
||||
errorMessage: { control: 'text' },
|
||||
errorKey: { control: 'text' },
|
||||
|
Loading…
Reference in New Issue
Block a user