-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBase.stories.js
More file actions
68 lines (67 loc) · 1.61 KB
/
Base.stories.js
File metadata and controls
68 lines (67 loc) · 1.61 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import {action} from '@storybook/addon-actions';
import {text} from '@storybook/addon-knobs';
import {storiesOf} from '@storybook/react-native';
import React, {useState} from 'react';
import Input from '.';
import {
StyleSheet,
View,
SafeAreaView,
Text,
Alert,
onChangeText,
} from 'react-native';
storiesOf('Default', module)
.addDecorator(getStory => (
<SafeAreaView
style={{
flex: 1,
justifyContent: 'center',
marginHorizontal: 16,
}}>
{getStory()}
</SafeAreaView>
))
.add('Default Input Text', () => (
<Input
label="Username"
onChangeText={text => onChangeText(text)}
labelTextColor="#3B82F6"
// value={value}
// icon={<Text>+91</Text>}
borderColor="#3B82F6"
// color="#3B82F6"
// iconPosition="left"
// focusBorderColor="#22D3EE"
/>
))
.add('Default Required Field', () => (
<Input
label="Username"
onChangeText={text => onChangeText(text)}
// value={value}
icon={<Text>😊</Text>}
iconPosition="left"
error={'This field is required'}
// borderColor="#FDBA74"
// errorTextStyles={{color: '#FDBA74'}}
/>
))
.add('Default Calendar Field', () => (
<Input
calendar="true"
mode="date"
label="Select Date"
value={''}
onChangeText={value => {
onChangeText(value)
}}
labelTextColor="#3B82F6"
maximumDate={new Date(2300, 10, 20)}
minimumDate={new Date(1950, 0, 1)}
placeholder="YYYY-MM-DD"
icon={<Text>😊</Text>}
iconPosition="right"
edit={false}
/>
));