2022-09-26 16:24:52 +00:00
|
|
|
// Copyright 2022 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import React from 'react';
|
2022-10-04 23:17:15 +00:00
|
|
|
import type { Meta, Story } from '@storybook/react';
|
2022-09-26 16:24:52 +00:00
|
|
|
|
|
|
|
import type { Props } from './AddUserToAnotherGroupModal';
|
|
|
|
import enMessages from '../../_locales/en/messages.json';
|
|
|
|
import {
|
|
|
|
getDefaultConversation,
|
|
|
|
getDefaultGroup,
|
|
|
|
} from '../test-both/helpers/getDefaultConversation';
|
|
|
|
import { setupI18n } from '../util/setupI18n';
|
|
|
|
import { AddUserToAnotherGroupModal } from './AddUserToAnotherGroupModal';
|
|
|
|
import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext';
|
|
|
|
|
|
|
|
const i18n = setupI18n('en', enMessages);
|
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'Components/AddUserToAnotherGroupModal',
|
|
|
|
component: AddUserToAnotherGroupModal,
|
|
|
|
argTypes: {
|
|
|
|
candidateConversations: {
|
|
|
|
defaultValue: Array.from(Array(100), () => getDefaultGroup()),
|
|
|
|
},
|
|
|
|
contact: {
|
|
|
|
defaultValue: getDefaultConversation(),
|
|
|
|
},
|
|
|
|
i18n: {
|
|
|
|
defaultValue: i18n,
|
|
|
|
},
|
2022-12-16 03:12:05 +00:00
|
|
|
addMembersToGroup: { action: true },
|
|
|
|
toggleAddUserToAnotherGroupModal: { action: true },
|
2022-09-26 16:24:52 +00:00
|
|
|
},
|
|
|
|
} as Meta;
|
|
|
|
|
2022-11-18 00:45:19 +00:00
|
|
|
// eslint-disable-next-line react/function-component-definition
|
2022-09-26 16:24:52 +00:00
|
|
|
const Template: Story<Props> = args => (
|
|
|
|
<AddUserToAnotherGroupModal
|
|
|
|
{...args}
|
|
|
|
theme={React.useContext(StorybookThemeContext)}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
|
|
|
export const Modal = Template.bind({});
|
|
|
|
Modal.args = {};
|