1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix/16207/text component storybook (#16214)

This commit is contained in:
Garrett Bear 2022-10-19 11:09:38 -07:00 committed by GitHub
parent c00749dcf7
commit 4581a3ac77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 7 deletions

View File

@ -269,6 +269,7 @@ import { Text } from '../../ui/component-library/text';
<Text as="p">p</Text>
<Text as="span">span</Text>
<Text as="strong">strong</Text>
<Text as="input" placeholder="input"></Text>
```
Renders the html:
@ -288,6 +289,7 @@ Renders the html:
<p>p</p>
<span>span</span>
<strong>strong</strong>
<input placeholder="input" />
```
### Box Props

View File

@ -259,12 +259,17 @@ export const Ellipsis = (args) => (
export const As = (args) => (
<>
{Object.values(ValidTags).map((tag) => (
<div key={tag}>
<Text {...args} as={tag}>
{tag}
</Text>
</div>
))}
{ValidTags.map((tag) => {
if (tag === 'input') {
return <Text key={tag} {...args} as={tag} placeholder={tag} />;
}
return (
<div key={tag}>
<Text {...args} as={tag}>
{tag}
</Text>
</div>
);
})}
</>
);