forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.stories.tsx
More file actions
48 lines (44 loc) · 1.06 KB
/
index.stories.tsx
File metadata and controls
48 lines (44 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { storiesOf } from '@storybook/react';
import React from 'react';
import { noop } from '../../test/mocks';
import { KEYBINDINGS } from '../../utils/keybindings';
import { Preference } from '.';
const stories = storiesOf('components/Preference', module);
const keyBindingKeys = Object.keys(KEYBINDINGS);
stories
.add('Boolean Preference', () => (
<Preference
setValue={noop}
value={false}
title="Vim Mode?"
type="boolean"
/>
))
.add('String Preference', () => (
<Preference
setValue={noop}
title="Whats your name?"
type="string"
value="Test"
/>
))
.add('Keybinding Preference', () =>
keyBindingKeys.map((id, i) => (
<Preference
setValue={noop}
key={id}
title={KEYBINDINGS[id].title}
value={KEYBINDINGS[id].bindings}
type="keybinding"
/>
))
)
.add('Dropdown Preference', () => (
<Preference
title="Select your editor"
setValue={noop}
type="dropdown"
value="one"
options={['one', 'two']}
/>
));