Upgrade Storybook
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
8c966dfbd8
commit
502ea174ab
328 changed files with 10863 additions and 12432 deletions
|
@ -2,7 +2,8 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import type { Meta } from '@storybook/react';
|
||||
import type { Props } from './DisappearingTimerSelect';
|
||||
import { DisappearingTimerSelect } from './DisappearingTimerSelect';
|
||||
import { setupI18n } from '../util/setupI18n';
|
||||
import { DurationInSeconds } from '../util/durations';
|
||||
|
@ -10,15 +11,15 @@ import enMessages from '../../_locales/en/messages.json';
|
|||
|
||||
export default {
|
||||
title: 'Components/DisappearingTimerSelect',
|
||||
};
|
||||
} satisfies Meta<Props>;
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
type Props = {
|
||||
type Args = {
|
||||
initialValue: number;
|
||||
};
|
||||
|
||||
function TimerSelectWrap({ initialValue }: Props): JSX.Element {
|
||||
function TimerSelectWrap({ initialValue }: Args): JSX.Element {
|
||||
const [value, setValue] = useState(initialValue);
|
||||
|
||||
return (
|
||||
|
@ -34,14 +35,6 @@ export function InitialValue1Day(): JSX.Element {
|
|||
return <TimerSelectWrap initialValue={24 * 3600} />;
|
||||
}
|
||||
|
||||
InitialValue1Day.story = {
|
||||
name: 'Initial value: 1 day',
|
||||
};
|
||||
|
||||
export function InitialValue3DaysCustomTime(): JSX.Element {
|
||||
return <TimerSelectWrap initialValue={3 * 24 * 3600} />;
|
||||
}
|
||||
|
||||
InitialValue3DaysCustomTime.story = {
|
||||
name: 'Initial value 3 days (Custom time)',
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue