Skip to content

Commit

Permalink
Adding deprecation message
Browse files Browse the repository at this point in the history
  • Loading branch information
georgewrmarshall committed Jun 7, 2023
1 parent 8138137 commit 87ddf33
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
8 changes: 8 additions & 0 deletions ui/components/ui/icon-border/icon-border.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';

/**
* @deprecated The `<IconBorder />` component has been deprecated in favor of the `<AvatarBase />` component from the component-library.
* Please update your code to use the new `<AvatarBase>` component instead, which can be found at ./ui/components/component-library/avatar-base/avatar-base.js.
* You can find documentation for the new AvatarBase component in the MetaMask Storybook:
* {@link https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-avatarbase--docs}
* If you would like to help with the replacement of the old IconBorder component, please submit a pull request
*/

export default function IconBorder({ children, size, className }) {
const borderStyle = { height: `${size}px`, width: `${size}px` };
return (
Expand Down
18 changes: 15 additions & 3 deletions ui/components/ui/icon-border/icon-border.stories.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React from 'react';
import { Severity } from '../../../helpers/constants/design-system';
import { BannerAlert } from '../../component-library';

import IconBorder from './icon-border';

export default {
title: 'Components/UI/IconBorder',

component: IconBorder,
argTypes: {
className: {
Expand All @@ -19,10 +21,20 @@ export default {
args: {
className: '',
children: 'D',
size: 5,
size: 32,
},
};

export const DefaultStory = (args) => <IconBorder {...args} />;
export const DefaultStory = (args) => (
<>
<BannerAlert
severity={Severity.Warning}
title="Deprecated"
description="<IconBorder/> has been deprecated in favour of the <AvatarBase /> component"
marginBottom={4}
/>
<IconBorder {...args} />
</>
);

DefaultStory.storyName = 'Default';

0 comments on commit 87ddf33

Please sign in to comment.