Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating story for icon-border #19467

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
40 changes: 40 additions & 0 deletions ui/components/ui/icon-border/icon-border.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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: {
control: 'text',
},
children: {
control: 'text',
},
size: {
control: 'number',
},
},
args: {
className: '',
children: 'D',
size: 32,
},
};

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';