signal-desktop/ts/components/conversation/ScrollDownButton.stories.tsx

46 lines
1.2 KiB
TypeScript
Raw Normal View History

2020-10-30 20:34:04 +00:00
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as React from 'react';
2022-06-13 23:37:29 +00:00
import type { Meta, Story } from '@storybook/react';
import { action } from '@storybook/addon-actions';
2021-09-18 00:30:08 +00:00
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import type { Props } from './ScrollDownButton';
import { ScrollDownButton } from './ScrollDownButton';
const i18n = setupI18n('en', enMessages);
const createProps = (overrideProps: Partial<Props> = {}): Props => ({
i18n,
scrollDown: action('scrollDown'),
conversationId: 'fake-conversation-id',
2022-06-13 23:37:29 +00:00
...overrideProps,
});
2022-06-07 00:48:02 +00:00
export default {
title: 'Components/Conversation/ScrollDownButton',
2022-06-13 23:37:29 +00:00
component: ScrollDownButton,
argTypes: {
unreadCount: {
control: { type: 'radio' },
options: {
None: undefined,
Some: 5,
Plenty: 85,
'Please Stop': 1000,
},
},
},
} as Meta;
2022-11-18 00:45:19 +00:00
// eslint-disable-next-line react/function-component-definition
2022-06-13 23:37:29 +00:00
const Template: Story<Props> = args => <ScrollDownButton {...args} />;
export const Default = Template.bind({});
Default.args = createProps({});
Default.story = {
name: 'Default',
2022-06-07 00:48:02 +00:00
};