Universal Disappearing Messages
This commit is contained in:
parent
c63871d71b
commit
19f8042cd3
50 changed files with 1224 additions and 191 deletions
31
ts/components/Select.stories.tsx
Normal file
31
ts/components/Select.stories.tsx
Normal file
|
@ -0,0 +1,31 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { storiesOf } from '@storybook/react';
|
||||
|
||||
import { Select } from './Select';
|
||||
|
||||
const story = storiesOf('Components/Select', module);
|
||||
|
||||
story.add('Normal', () => {
|
||||
const [value, setValue] = useState(0);
|
||||
|
||||
const onChange = action('onChange');
|
||||
|
||||
return (
|
||||
<Select
|
||||
options={[
|
||||
{ value: 1, text: '1' },
|
||||
{ value: 2, text: '2' },
|
||||
{ value: 3, text: '3' },
|
||||
]}
|
||||
value={value}
|
||||
onChange={newValue => {
|
||||
onChange(newValue);
|
||||
setValue(parseInt(newValue, 10));
|
||||
}}
|
||||
/>
|
||||
);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue