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

38 lines
1.4 KiB
TypeScript
Raw Normal View History

2024-06-10 15:23:43 +00:00
// Copyright 2024 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import { action } from '@storybook/addon-actions';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import type { CallLinkEditModalProps } from './CallLinkEditModal';
import { CallLinkEditModal } from './CallLinkEditModal';
import type { ComponentMeta } from '../storybook/types';
import { FAKE_CALL_LINK_WITH_ADMIN_KEY } from '../test-both/helpers/fakeCallLink';
const i18n = setupI18n('en', enMessages);
export default {
title: 'Components/CallLinkEditModal',
component: CallLinkEditModal,
args: {
i18n,
callLink: FAKE_CALL_LINK_WITH_ADMIN_KEY,
hasActiveCall: false,
2024-06-10 15:23:43 +00:00
onClose: action('onClose'),
onCopyCallLink: action('onCopyCallLink'),
2024-06-25 18:56:28 +00:00
onOpenCallLinkAddNameModal: action('onOpenCallLinkAddNameModal'),
2024-06-10 15:23:43 +00:00
onUpdateCallLinkRestrictions: action('onUpdateCallLinkRestrictions'),
onShareCallLinkViaSignal: action('onShareCallLinkViaSignal'),
onStartCallLinkLobby: action('onStartCallLinkLobby'),
},
} satisfies ComponentMeta<CallLinkEditModalProps>;
export function Basic(args: CallLinkEditModalProps): JSX.Element {
return <CallLinkEditModal {...args} />;
}
export function InAnotherCall(args: CallLinkEditModalProps): JSX.Element {
return <CallLinkEditModal {...args} hasActiveCall />;
}