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

51 lines
1.5 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 { action } from '@storybook/addon-actions';
import type { Meta } from '@storybook/react';
import type { PropsType } from './NewlyCreatedGroupInvitedContactsDialog';
2021-03-03 20:09:58 +00:00
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',
} satisfies Meta<PropsType>;
2021-03-03 20:09:58 +00:00
2022-11-18 00:45:19 +00:00
export function OneContact(): JSX.Element {
return (
<NewlyCreatedGroupInvitedContactsDialog
contacts={[conversations[0]]}
getPreferredBadge={() => undefined}
i18n={i18n}
onClose={action('onClose')}
theme={ThemeType.light}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function TwoContacts(): JSX.Element {
return (
<NewlyCreatedGroupInvitedContactsDialog
contacts={conversations}
getPreferredBadge={() => undefined}
i18n={i18n}
onClose={action('onClose')}
theme={ThemeType.light}
/>
);
}