forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.stories.tsx
More file actions
30 lines (28 loc) · 956 Bytes
/
index.stories.tsx
File metadata and controls
30 lines (28 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import React from 'react';
import { storiesOf } from '@storybook/react';
import { text, boolean } from '@storybook/addon-knobs';
import { UserWithAvatar } from '.';
const defaults = () => ({
username: text('Username', 'SaraVieira'),
avatarUrl: text(
'avatar url',
'https://avatars0.githubusercontent.com/u/1051509?s=460&v=4'
),
});
storiesOf('components/UserAvatar', module)
.add('User', () => <UserWithAvatar {...defaults()} />)
.add('With Name', () => (
<UserWithAvatar {...defaults()} name={text('name', 'Sara Vieira')} />
))
.add('With Subscription', () => (
<UserWithAvatar
{...defaults()}
subscriptionSince={text('subscriptionSince', new Date().toString())}
/>
))
.add('With hideBadge', () => (
<UserWithAvatar {...defaults()} hideBadge={boolean('hideBadge', true)} />
))
.add('With useBigName', () => (
<UserWithAvatar {...defaults()} useBigName={boolean('useBigName', true)} />
));