Default disappearing message timeout fixes
This commit is contained in:
parent
c9415dcf67
commit
cd28e71bc6
25 changed files with 456 additions and 164 deletions
37
ts/components/DisappearingTimerSelect.stories.tsx
Normal file
37
ts/components/DisappearingTimerSelect.stories.tsx
Normal file
|
@ -0,0 +1,37 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { storiesOf } from '@storybook/react';
|
||||
|
||||
import { DisappearingTimerSelect } from './DisappearingTimerSelect';
|
||||
import { setup as setupI18n } from '../../js/modules/i18n';
|
||||
import enMessages from '../../_locales/en/messages.json';
|
||||
|
||||
const story = storiesOf('Components/DisappearingTimerSelect', module);
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
type Props = {
|
||||
initialValue: number;
|
||||
};
|
||||
|
||||
const TimerSelectWrap: React.FC<Props> = ({ initialValue }) => {
|
||||
const [value, setValue] = useState(initialValue);
|
||||
|
||||
return (
|
||||
<DisappearingTimerSelect
|
||||
i18n={i18n}
|
||||
value={value}
|
||||
onChange={newValue => setValue(newValue)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
story.add('Initial value: 1 day', () => (
|
||||
<TimerSelectWrap initialValue={24 * 3600} />
|
||||
));
|
||||
|
||||
story.add('Initial value 3 days (Custom time)', () => (
|
||||
<TimerSelectWrap initialValue={3 * 24 * 3600} />
|
||||
));
|
Loading…
Add table
Add a link
Reference in a new issue