mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
circle-icon (#12650)
This commit is contained in:
parent
8ce0eff047
commit
49ae325d52
16
ui/components/ui/circle-icon/README.mdx
Normal file
16
ui/components/ui/circle-icon/README.mdx
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';
|
||||||
|
|
||||||
|
import CircleIcon from '.';
|
||||||
|
|
||||||
|
# Circle Icon
|
||||||
|
|
||||||
|
Add circle border to the image component
|
||||||
|
|
||||||
|
<Canvas>
|
||||||
|
<Story id="ui-components-ui-circle-icon-circle-icon-stories-js--default-story" />
|
||||||
|
</Canvas>
|
||||||
|
|
||||||
|
## Component API
|
||||||
|
|
||||||
|
<ArgsTable of={CircleIcon} />
|
||||||
|
|
@ -3,9 +3,21 @@ import PropTypes from 'prop-types';
|
|||||||
|
|
||||||
export default class CircleIcon extends PureComponent {
|
export default class CircleIcon extends PureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
/**
|
||||||
|
* add size (px) for the image container
|
||||||
|
*/
|
||||||
size: PropTypes.string,
|
size: PropTypes.string,
|
||||||
|
/**
|
||||||
|
* add css classname for the component based on the parent css
|
||||||
|
*/
|
||||||
circleClass: PropTypes.string,
|
circleClass: PropTypes.string,
|
||||||
|
/**
|
||||||
|
* image source path
|
||||||
|
*/
|
||||||
iconSource: PropTypes.string.isRequired,
|
iconSource: PropTypes.string.isRequired,
|
||||||
|
/**
|
||||||
|
* add size (px) for the image
|
||||||
|
*/
|
||||||
iconSize: PropTypes.string,
|
iconSize: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,17 +1,37 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import README from './README.mdx';
|
||||||
import CircleIcon from './circle-icon.component';
|
import CircleIcon from './circle-icon.component';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'CircleIcon',
|
title: 'Components/UI/Circle Icon',
|
||||||
id: __filename,
|
id: __filename,
|
||||||
|
component: CircleIcon,
|
||||||
|
parameters: {
|
||||||
|
docs: {
|
||||||
|
page: README,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
argTypes: {
|
||||||
|
size: { control: 'text' },
|
||||||
|
circleClass: { control: 'text' },
|
||||||
|
iconSource: { control: 'text' },
|
||||||
|
iconSize: { control: 'text' },
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const basicCircleIcon = () => (
|
export const DefaultStory = (args) => (
|
||||||
<CircleIcon
|
<CircleIcon
|
||||||
border="1px solid"
|
border="1px solid"
|
||||||
borderColor="black"
|
borderColor="black"
|
||||||
background="white"
|
background="white"
|
||||||
iconSize="42px"
|
iconSize={args.iconSize}
|
||||||
iconSource="images/eth_logo.svg"
|
iconSource={args.iconSource}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
DefaultStory.storyName = 'Default';
|
||||||
|
|
||||||
|
DefaultStory.args = {
|
||||||
|
iconSize: '42px',
|
||||||
|
iconSource: 'images/eth_logo.svg',
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user