signal-desktop/ts/components/NewlyCreatedGroupInvitedContactsDialog.stories.tsx

47 lines
1.3 KiB
TypeScript
Raw Normal View History

2021-03-03 20:09:58 +00:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { NewlyCreatedGroupInvitedContactsDialog } from './NewlyCreatedGroupInvitedContactsDialog';
2021-09-18 00:30:08 +00:00
import { setupI18n } from '../util/setupI18n';
2021-03-03 20:09:58 +00:00
import enMessages from '../../_locales/en/messages.json';
import type { ConversationType } from '../state/ducks/conversations';
2021-05-07 22:21:10 +00:00
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
2021-11-20 15:41:21 +00:00
import { ThemeType } from '../types/Util';
2021-03-03 20:09:58 +00:00
const i18n = setupI18n('en', enMessages);
const conversations: Array<ConversationType> = [
2021-05-07 22:21:10 +00:00
getDefaultConversation({ title: 'Fred Willard' }),
getDefaultConversation({ title: 'Marc Barraca' }),
2021-03-03 20:09:58 +00:00
];
const story = storiesOf(
'Components/NewlyCreatedGroupInvitedContactsDialog',
module
);
story.add('One contact', () => (
<NewlyCreatedGroupInvitedContactsDialog
contacts={[conversations[0]]}
2021-11-20 15:41:21 +00:00
getPreferredBadge={() => undefined}
2021-03-03 20:09:58 +00:00
i18n={i18n}
onClose={action('onClose')}
2021-11-20 15:41:21 +00:00
theme={ThemeType.light}
2021-03-03 20:09:58 +00:00
/>
));
story.add('Two contacts', () => (
<NewlyCreatedGroupInvitedContactsDialog
contacts={conversations}
2021-11-20 15:41:21 +00:00
getPreferredBadge={() => undefined}
2021-03-03 20:09:58 +00:00
i18n={i18n}
onClose={action('onClose')}
2021-11-20 15:41:21 +00:00
theme={ThemeType.light}
2021-03-03 20:09:58 +00:00
/>
));