-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
converted Jazzicon component to functional component and added story (#…
…15638) * converted jazzicon component to functional and added story * removed console statement * updated appendChild with dangerouslySetInnerHtml * added propType description * replaced dangerouslySetHTML with appendChild * updated useEffect to useCleanup
- Loading branch information
Showing
3 changed files
with
93 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'; | ||
|
||
import Jazzicon from './jazzicon.component'; | ||
|
||
# Jazzicon | ||
|
||
Jazzicon uses the [jazzicon library](https://github.com/MetaMask/jazzicon) to create a graphic identity of an ethereum address | ||
|
||
<Canvas> | ||
<Story id="ui-components-ui-jazzicon-jazzicon-stories-js--default-story" /> | ||
</Canvas> | ||
|
||
## Props | ||
|
||
<ArgsTable of={Jazzicon} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import README from './README.mdx'; | ||
import Jazzicon from './jazzicon.component'; | ||
|
||
export default { | ||
title: 'Components/UI/Jazzicon', | ||
id: __filename, | ||
component: Jazzicon, | ||
parameters: { | ||
docs: { | ||
page: README, | ||
}, | ||
}, | ||
argTypes: { | ||
address: { control: 'text' }, | ||
className: { control: 'text' }, | ||
diameter: { control: 'number' }, | ||
tokenList: { control: 'object' }, | ||
}, | ||
}; | ||
|
||
export const DefaultStory = (args) => <Jazzicon {...args} />; | ||
|
||
DefaultStory.storyName = 'Default'; | ||
DefaultStory.args = { | ||
address: '0x5CfE73b6021E818B776b421B1c4Db2474086a7e1', | ||
diameter: 32, | ||
}; |