forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumberWithSymbolForm.stories.tsx
More file actions
54 lines (47 loc) · 1.77 KB
/
Copy pathNumberWithSymbolForm.stories.tsx
File metadata and controls
54 lines (47 loc) · 1.77 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
49
50
51
52
53
54
import type {Meta, StoryFn} from '@storybook/react-webpack5';
import React from 'react';
import Button from '@components/Button';
import NumberWithSymbolForm from '@components/NumberWithSymbolForm';
import type {NumberWithSymbolFormProps} from '@components/NumberWithSymbolForm';
import ScrollView from '@components/ScrollView';
import withNavigationFallback from '@components/withNavigationFallback';
import CONST from '@src/CONST';
import styles from '@src/styles';
import {defaultTheme} from '@src/styles/theme';
const defaultStyles = styles(defaultTheme);
type NumberWithSymbolFormStory = StoryFn<typeof NumberWithSymbolForm>;
const NumberWithSymbolFormWithNavigation = withNavigationFallback(NumberWithSymbolForm);
const story: Meta<typeof NumberWithSymbolForm> = {
title: 'Components/NumberWithSymbolForm',
component: NumberWithSymbolFormWithNavigation,
};
function Template(props: NumberWithSymbolFormProps) {
return (
<ScrollView contentContainerStyle={defaultStyles.flexGrow1}>
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
<NumberWithSymbolFormWithNavigation {...props} />
</ScrollView>
);
}
const Default: NumberWithSymbolFormStory = Template.bind({});
Default.args = {
value: '',
symbol: CONST.CUSTOM_UNITS.DISTANCE_UNIT_KILOMETERS,
symbolPosition: CONST.TEXT_INPUT_SYMBOL_POSITION.SUFFIX,
isSymbolPressable: false,
symbolTextStyle: defaultStyles.textSupporting,
style: defaultStyles.iouAmountTextInput,
containerStyle: defaultStyles.iouAmountTextInputContainer,
footer: (
<Button
success
large
text="Submit"
onPress={() => {
alert('Submitted');
}}
/>
),
};
export default story;
export {Default};