mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Adding deprecation notice to old Button component (#18908)
This commit is contained in:
parent
1478e83b08
commit
2face84177
@ -22,6 +22,16 @@ const typeHash = {
|
||||
raised: CLASSNAME_RAISED,
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated The <Button /> component has been deprecated in favor of the new <Button> component from the component-library.
|
||||
* Please update your code to use the new <Button> component instead, which can be found at ./ui/components/component-library/button/button.js.
|
||||
* You can find documentation for the new Button component in the MetaMask Storybook:
|
||||
* {@link https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-button--default-story#button}
|
||||
* If you would like to help with the replacement of the old Button component, please submit a pull request against this GitHub issue:
|
||||
* {@link https://github.com/MetaMask/metamask-extension/issues/18896}
|
||||
* @see {@link https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-button--default-story#button}
|
||||
*/
|
||||
|
||||
const Button = ({
|
||||
type,
|
||||
submit = false,
|
||||
|
@ -1,5 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { SEVERITIES } from '../../../helpers/constants/design-system';
|
||||
import { BannerAlert } from '../../component-library';
|
||||
|
||||
import IconTokenSearch from '../icon/icon-token-search';
|
||||
|
||||
import README from './README.mdx';
|
||||
@ -7,7 +10,6 @@ import Button from '.';
|
||||
|
||||
export default {
|
||||
title: 'Components/UI/Button',
|
||||
|
||||
component: Button,
|
||||
parameters: {
|
||||
docs: {
|
||||
@ -56,7 +58,19 @@ export default {
|
||||
};
|
||||
|
||||
export const DefaultStory = (args) => (
|
||||
<Button {...args}>{args.children}</Button>
|
||||
<>
|
||||
<BannerAlert
|
||||
marginBottom={4}
|
||||
severity={SEVERITIES.WARNING}
|
||||
title="Deprecated"
|
||||
description="This version of Button has been deprecated in favor of the component-library version. Contribute to replacing old Button with new Button by submitting a PR to metamask-extension."
|
||||
actionButtonLabel="See details"
|
||||
actionButtonProps={{
|
||||
href: 'https://github.com/MetaMask/metamask-extension/issues/18896',
|
||||
}}
|
||||
/>
|
||||
<Button {...args}>{args.children}</Button>
|
||||
</>
|
||||
);
|
||||
|
||||
DefaultStory.storyName = 'Default';
|
||||
|
Loading…
Reference in New Issue
Block a user