-
-
Notifications
You must be signed in to change notification settings - Fork 180
Expand file tree
/
Copy pathHiddenControls.stories.tsx
More file actions
41 lines (36 loc) · 1.03 KB
/
HiddenControls.stories.tsx
File metadata and controls
41 lines (36 loc) · 1.03 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
import { Meta, StoryObj } from '@storybook/react-native';
import { Text, View } from 'react-native';
type HiddenControlsProps = {
value: number;
padding: number;
advanced: boolean;
};
const HiddenControls = ({ value, padding }: HiddenControlsProps) => {
return (
<View style={{ padding, gap: 10 }}>
<Text>
This is a story that allows you to hide controls based on other args. By default, you should
be able to modify the value but not the padding of this component
</Text>
<Text>Your current chosen value is: {value}</Text>
</View>
);
};
const meta = {
component: HiddenControls,
tags: ['controls', 'conditional'],
} satisfies Meta<typeof HiddenControls>;
export default meta;
type HiddenControlsStory = StoryObj<typeof meta>;
export const Basic: HiddenControlsStory = {
argTypes: {
value: { control: 'number' },
advanced: { control: 'boolean' },
padding: { control: 'number', if: { arg: 'advanced' } },
},
args: {
padding: 10,
value: 42,
advanced: false,
},
};