diff --git a/ts/components/conversation/LastSeenIndicator.md b/ts/components/conversation/LastSeenIndicator.md deleted file mode 100644 index 2542b5d5c5..0000000000 --- a/ts/components/conversation/LastSeenIndicator.md +++ /dev/null @@ -1,15 +0,0 @@ -### One - -```jsx - - - -``` - -### More than one - -```jsx - - - -``` diff --git a/ts/components/conversation/LastSeenIndicator.stories.tsx b/ts/components/conversation/LastSeenIndicator.stories.tsx new file mode 100644 index 0000000000..713fa693b6 --- /dev/null +++ b/ts/components/conversation/LastSeenIndicator.stories.tsx @@ -0,0 +1,32 @@ +import * as React from 'react'; + +import { number } from '@storybook/addon-knobs'; +import { storiesOf } from '@storybook/react'; + +import { LastSeenIndicator, Props } from './LastSeenIndicator'; + +// @ts-ignore +import { setup as setupI18n } from '../../../js/modules/i18n'; +// @ts-ignore +import enMessages from '../../../_locales/en/messages.json'; +const i18n = setupI18n('en', enMessages); + +const story = storiesOf('Components/Conversation/LastSeenIndicator', module); + +const createProps = (overrideProps: Partial = {}): Props => ({ + count: number('count', overrideProps.count || 1), + i18n, +}); + +story.add('One', () => { + const props = createProps(); + return ; +}); + +story.add('More than One', () => { + const props = createProps({ + count: 5, + }); + + return ; +}); diff --git a/ts/components/conversation/LastSeenIndicator.tsx b/ts/components/conversation/LastSeenIndicator.tsx index dc8fd74e33..7cf53e1fce 100644 --- a/ts/components/conversation/LastSeenIndicator.tsx +++ b/ts/components/conversation/LastSeenIndicator.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { LocalizerType } from '../../types/Util'; -type Props = { +export type Props = { count: number; i18n: LocalizerType; };