Skip to content

Commit f8dc69a

Browse files
committed
Some Changes
1 parent 3b9baa9 commit f8dc69a

2 files changed

Lines changed: 24 additions & 22 deletions

File tree

src/Base/Base.stories.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import {
1111
Alert,
1212
onChangeText,
1313
} from 'react-native';
14-
// // eslint-disable-next-line react-hooks/rules-of-hooks
15-
// const [value, onChangeText] = React.useState();
1614

1715
storiesOf('Default', module)
1816
.addDecorator(getStory => (
@@ -32,6 +30,7 @@ storiesOf('Default', module)
3230
// value={value}
3331
icon={<Text>😂</Text>}
3432
iconPosition="right"
33+
// focusColor="#22D3EE"
3534
/>
3635
))
3736
.add('Default Required Field', () => (
@@ -42,5 +41,7 @@ storiesOf('Default', module)
4241
icon={<Text>😊</Text>}
4342
iconPosition="left"
4443
error={'This field is required'}
44+
// borderColor="#FDBA74"
45+
// errorTextStyles={{color: '#FDBA74'}}
4546
/>
4647
));

src/Base/index.js

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const Input = ({
55
onChangeText,
66
iconPosition,
77
icon,
8-
style,
98
value,
109
placeholder = 'Enter Text',
1110
label = null,
@@ -33,18 +32,19 @@ const Input = ({
3332

3433
const getBorderColor = () => {
3534
if (error) {
36-
return '#DC2626';
35+
return props.borderColor || '#DC2626';
3736
}
3837

3938
if (focused) {
40-
return '#E4E4E7';
39+
return props.focusColor || '#52525B';
4140
}
4241
};
4342

4443
return (
45-
<View style={{paddingVertical: 12}}>
46-
{label && <Text>{label}</Text>}
47-
44+
<>
45+
<View style={{...props.labelStyles}}>
46+
{label && <Text>{label}</Text>}
47+
</View>
4848
<View
4949
style={{
5050
...(props.wrapperStyles || {
@@ -59,7 +59,6 @@ const Input = ({
5959
}),
6060
}}>
6161
<View>{icon && icon}</View>
62-
6362
<TextInput
6463
placeholder={placeholder}
6564
style={textInputStyles}
@@ -74,19 +73,21 @@ const Input = ({
7473
{...props}
7574
/>
7675
</View>
77-
{error && (
78-
<Text
79-
style={{
80-
...(props.errorTextStyles || {
81-
color: '#DC2626',
82-
paddingTop: 4,
83-
fontSize: 12,
84-
}),
85-
}}>
86-
{error}
87-
</Text>
88-
)}
89-
</View>
76+
<View>
77+
{error && (
78+
<Text
79+
style={{
80+
...(props.errorTextStyles || {
81+
color: '#DC2626',
82+
paddingTop: 4,
83+
fontSize: 12,
84+
}),
85+
}}>
86+
{error}
87+
</Text>
88+
)}
89+
</View>
90+
</>
9091
);
9192
};
9293

0 commit comments

Comments
 (0)