Signal-Desktop/ts/components/NewlyCreatedGroupInvitedCon...

53 lines
1.4 KiB
TypeScript
Raw Permalink 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 { 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
];
2022-06-07 00:48:02 +00:00
export default {
title: 'Components/NewlyCreatedGroupInvitedContactsDialog',
};
2021-03-03 20:09:58 +00:00
2022-06-07 00:48:02 +00:00
export const OneContact = (): JSX.Element => (
2021-03-03 20:09:58 +00:00
<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
/>
2022-06-07 00:48:02 +00:00
);
OneContact.story = {
name: 'One contact',
};
2021-03-03 20:09:58 +00:00
2022-06-07 00:48:02 +00:00
export const TwoContacts = (): JSX.Element => (
2021-03-03 20:09:58 +00:00
<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
/>
2022-06-07 00:48:02 +00:00
);
TwoContacts.story = {
name: 'Two contacts',
};