1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00

Convert UrlIcon knobs and actions to controls / args (#13981)

Co-authored-by: George Marshall <georgewrmarshall@gmail.com>
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
This commit is contained in:
白宦成 2022-04-01 02:30:15 +08:00 committed by GitHub
parent 59131f5da5
commit aef2541e57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,10 +1,32 @@
import React from 'react';
import { text } from '@storybook/addon-knobs';
import UrlIcon from './url-icon';
export default {
title: 'Components/UI/UrlIcon',
id: __filename,
argType: {
name: { control: 'text' },
url: { control: 'text' },
className: { control: 'text' },
fallbackClassName: { control: 'text' },
},
args: {
name: 'AST',
url: 'AST.png',
className: '',
fallbackClassName: '',
},
};
export const DefaultStory = (args) => {
return (
<UrlIcon
name={args.name}
url={args.url}
className={args.className}
fallbackClassName={args.fallbackClassName}
/>
);
};
export const AST = () => {
@ -14,14 +36,3 @@ export const AST = () => {
export const BAT = () => {
return <UrlIcon name="BAT" url="BAT_icon.svg" />;
};
export const CustomProps = () => {
return (
<UrlIcon
name={text('Symbol', '')}
url={text('Icon URL', '')}
className={text('className', '')}
fallbackClassName={text('fallbackClassName', '')}
/>
);
};