File tree Expand file tree Collapse file tree 4 files changed +48
-18
lines changed Expand file tree Collapse file tree 4 files changed +48
-18
lines changed Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
2
import { Text , StyleSheet , Platform } from "react-native" ;
3
-
3
+ import defaultStyles from '../config/styles'
4
4
function AppText ( { children, style } ) {
5
- return < Text style = { [ styles . text , style ] } > { children } </ Text > ;
5
+ return < Text style = { [ defaultStyles , style ] } > { children } </ Text > ;
6
6
}
7
7
8
- const styles = StyleSheet . create ( {
9
- text : {
10
- fontSize : 18 ,
11
- fontFamily : Platform . OS === "android" ? "Roboto" : "Avenir" ,
12
- } ,
13
- } ) ;
8
+
14
9
15
10
export default AppText ;
Original file line number Diff line number Diff line change 1
- import React from 'react' ;
2
-
3
- function AppTextInput ( props ) {
4
- return (
5
- < div >
6
-
7
- </ div >
8
- ) ;
1
+ import React from "react" ;
2
+ import { View , StyleSheet , TextInput } from "react-native" ;
3
+ import { MaterialCommunityIcons } from "@expo/vector-icons" ;
4
+ import colors from "../config/colors" ;
5
+ import defaultStyles from "../config/styles"
6
+ function AppTextInput ( { icon, ...otherProps } ) {
7
+ return (
8
+ < View styles = { styles . container } >
9
+ { icon && (
10
+ < MaterialCommunityIcons
11
+ name = { icon }
12
+ size = { 20 }
13
+ color = { colors . medium }
14
+ style = { styles . icon }
15
+ />
16
+ ) }
17
+ < TextInput style = { defaultStyles . text } { ...otherProps } />
18
+ </ View >
19
+ ) ;
9
20
}
10
-
21
+ const styles = StyleSheet . create ( {
22
+ container : {
23
+ backgroundColor : colors . light ,
24
+ borderRadius : 25 ,
25
+ flexDirection : "row" ,
26
+ width : "100%" ,
27
+ padding : 15 ,
28
+ marginVertical : 10 ,
29
+ } ,
30
+ icon : {
31
+ marginRight : 10 ,
32
+ } ,
33
+ } ) ;
11
34
export default AppTextInput ;
Original file line number Diff line number Diff line change @@ -5,5 +5,6 @@ export default {
5
5
white : "#fff" ,
6
6
medium : "#6e6969" ,
7
7
light : "#f8f4f4" ,
8
- danger :"red"
8
+ danger :"red" ,
9
+ dark :"#0c0c0c"
9
10
} ;
Original file line number Diff line number Diff line change
1
+ import { Platform } from "react-native" ;
2
+ import colors from "./colors" ;
3
+
4
+ export default {
5
+ colors : colors ,
6
+ text : {
7
+ color : colors . dark ,
8
+ fontSize : 18 ,
9
+ fontFamily : Platform . OS === "android" ? "Roboto" : "Avenir" ,
10
+ } ,
11
+ } ;
You can’t perform that action at this time.
0 commit comments