signal-desktop/ts/components/conversation/conversation-details/ConversationNotificationsSettings.stories.tsx

50 lines
1.5 KiB
TypeScript
Raw Normal View History

2021-08-05 12:35:33 +00:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as React from 'react';
import { action } from '@storybook/addon-actions';
import type { Meta } from '@storybook/react';
2021-09-18 00:30:08 +00:00
import { setupI18n } from '../../../util/setupI18n';
2021-08-05 12:35:33 +00:00
import enMessages from '../../../../_locales/en/messages.json';
import type { PropsType } from './ConversationNotificationsSettings';
2021-08-05 12:35:33 +00:00
import { ConversationNotificationsSettings } from './ConversationNotificationsSettings';
const i18n = setupI18n('en', enMessages);
2022-06-07 00:48:02 +00:00
export default {
title:
'Components/Conversation/ConversationDetails/ConversationNotificationsSettings',
} satisfies Meta<PropsType>;
2021-08-05 12:35:33 +00:00
const getCommonProps = () => ({
id: 'conversation-id',
2021-08-05 12:35:33 +00:00
muteExpiresAt: undefined,
conversationType: 'group' as const,
dontNotifyForMentionsIfMuted: false,
i18n,
setDontNotifyForMentionsIfMuted: action('setDontNotifyForMentionsIfMuted'),
setMuteExpiration: action('setMuteExpiration'),
});
2022-11-18 00:45:19 +00:00
export function GroupConversationAllDefault(): JSX.Element {
return <ConversationNotificationsSettings {...getCommonProps()} />;
}
2021-08-05 12:35:33 +00:00
2022-11-18 00:45:19 +00:00
export function GroupConversationMuted(): JSX.Element {
return (
<ConversationNotificationsSettings
{...getCommonProps()}
muteExpiresAt={Date.UTC(2099, 5, 9)}
/>
);
}
2021-08-05 12:35:33 +00:00
2022-11-18 00:45:19 +00:00
export function GroupConversationMentionsMuted(): JSX.Element {
return (
<ConversationNotificationsSettings
{...getCommonProps()}
dontNotifyForMentionsIfMuted
/>
);
}