File tree Expand file tree Collapse file tree 4 files changed +14
-9
lines changed Expand file tree Collapse file tree 4 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import { TextInput , TextInputProps } from 'react-native' ;
3
- import { useTheme } from " @shopify/restyle"
4
- import { Theme } from '../../theme'
2
+ import { Platform , TextInput , TextInputProps } from 'react-native' ;
3
+ import { useTheme } from ' @shopify/restyle' ;
4
+ import { Theme } from '../../theme' ;
5
5
6
6
const Input = ( { value, onChange, ...others } : TextInputProps & { onChange ?: ( value : string ) => void } ) => {
7
- const theme = useTheme < Theme > ( )
7
+ const theme = useTheme < Theme > ( ) ;
8
+ const isIOS = Platform . OS === 'ios' ;
8
9
return (
9
10
< TextInput
10
11
value = { value }
11
12
onChangeText = { ( value ) => {
12
13
onChange ?.( value ) ;
13
14
} }
14
- style = { { color : theme . colors . text } }
15
+ style = { { paddingVertical : isIOS ? 5 : - 5 , color : theme . colors . text } }
15
16
{ ...others }
16
17
/>
17
18
) ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const styles = StyleSheet.create({
20
20
width : 'auto' ,
21
21
fontSize : 16 ,
22
22
fontWeight : '500' ,
23
- marginBottom : 10 ,
23
+ marginBottom : 5 ,
24
24
} ,
25
25
} ) ;
26
26
Original file line number Diff line number Diff line change 1
1
import React , { useContext } from 'react' ;
2
2
import { Context } from '../hooks/context' ;
3
3
import { FormItemsProps } from '../types' ;
4
- import { Text } from 'react-native' ;
4
+ import { View , Text } from 'react-native' ;
5
5
6
6
const Tip = ( { v } : { v : Partial < FormItemsProps > & { field : string } } ) => {
7
7
const {
@@ -11,7 +11,11 @@ const Tip = ({ v }: { v: Partial<FormItemsProps> & { field: string } }) => {
11
11
const content = validator . message ( v . field , store [ v . field ] , {
12
12
validate : v ?. validate ,
13
13
} ) ;
14
- return < Text style = { { color : 'red' , marginBottom : content && 10 , marginTop : content && 10 } } > { content } </ Text > ;
14
+ return (
15
+ < View style = { { marginTop : 5 } } >
16
+ { content && < Text style = { { color : 'red' , marginBottom : content && 5 } } > { content } </ Text > }
17
+ </ View >
18
+ ) ;
15
19
} ;
16
20
17
21
export default Tip ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const styles = StyleSheet.create({
9
9
} ,
10
10
form_items : {
11
11
textAlign : 'center' ,
12
- margin : 10 ,
12
+ margin : 5 ,
13
13
borderBottomWidth : 0.5 ,
14
14
borderBottomColor : '#ccc' ,
15
15
} ,
You can’t perform that action at this time.
0 commit comments