@@ -35,34 +35,38 @@ const ModernHeader = props => {
3535 } = props ;
3636 return (
3737 < View style = { styles . container } >
38- { ! leftDisable && < TouchableOpacity
39- style = { leftCompStyle ( left ) }
40- hitSlop = { hitslopObj }
41- onPress = { leftIconOnPress }
42- >
43- { leftIconComponent || (
44- < Icon
45- name = { leftIconName }
46- type = { leftIconType }
47- size = { leftIconSize }
48- color = { leftIconColor }
49- />
50- ) }
51- </ TouchableOpacity > }
38+ { ! leftDisable && (
39+ < TouchableOpacity
40+ style = { leftCompStyle ( left ) }
41+ hitSlop = { hitslopObj }
42+ onPress = { leftIconOnPress }
43+ >
44+ { leftIconComponent || (
45+ < Icon
46+ name = { leftIconName }
47+ type = { leftIconType }
48+ size = { leftIconSize }
49+ color = { leftIconColor }
50+ />
51+ ) }
52+ </ TouchableOpacity >
53+ ) }
5254 < Text style = { textStyle } > { text } </ Text >
53- { ! rightDisable && < TouchableOpacity
54- style = { rightCompStyle ( right ) }
55- onPress = { rightIconOnPress }
56- >
57- { rightIconComponent || (
58- < Icon
59- name = { rightIconName }
60- type = { rightIconType }
61- size = { rightIconSize }
62- color = { rightIconColor }
63- />
64- ) }
65- </ TouchableOpacity > }
55+ { ! rightDisable && (
56+ < TouchableOpacity
57+ style = { rightCompStyle ( right ) }
58+ onPress = { rightIconOnPress }
59+ >
60+ { rightIconComponent || (
61+ < Icon
62+ name = { rightIconName }
63+ type = { rightIconType }
64+ size = { rightIconSize }
65+ color = { rightIconColor }
66+ />
67+ ) }
68+ </ TouchableOpacity >
69+ ) }
6670 </ View >
6771 ) ;
6872} ;
@@ -73,27 +77,27 @@ ModernHeader.propTypes = {
7377 text : PropTypes . string ,
7478 leftIconName : PropTypes . string ,
7579 leftIconType : PropTypes . string ,
76- leftIconSize : PropTypes . string ,
7780 leftIconColor : PropTypes . string ,
7881 rightIconName : PropTypes . string ,
7982 rightIconType : PropTypes . string ,
80- rightIconSize : PropTypes . string ,
81- rightIconColor : PropTypes . string
83+ rightIconColor : PropTypes . string ,
84+ leftIconSize : PropTypes . oneOfType ( [ PropTypes . number , PropTypes . string ] ) ,
85+ rightIconSize : PropTypes . oneOfType ( [ PropTypes . number , PropTypes . string ] )
8286} ;
8387
8488ModernHeader . defaultProps = {
8589 left : 16 ,
8690 right : 16 ,
87- text : "Header Title" ,
88- textStyle : styles . textStyle ,
89- leftIconName : "ios-arrow-back" ,
90- leftIconType : "Ionicons" ,
9191 leftIconSize : 25 ,
92- leftIconColor : "#bbbabe" ,
92+ rightIconSize : 25 ,
93+ text : "Header Title" ,
9394 rightIconName : "heart" ,
9495 rightIconType : "Entypo" ,
95- rightIconSize : 25 ,
96- rightIconColor : "#23c4c1"
96+ leftIconType : "Ionicons" ,
97+ leftIconColor : "#bbbabe" ,
98+ rightIconColor : "#23c4c1" ,
99+ textStyle : styles . textStyle ,
100+ leftIconName : "ios-arrow-back"
97101} ;
98102
99103export default ModernHeader ;
0 commit comments