@@ -30,41 +30,33 @@ Arrow.propTypes = {
30
30
height : React . PropTypes . number . isRequired
31
31
} ;
32
32
Arrow . defaultProps = {
33
- width : 14 ,
34
- height : 14
33
+ width : 6 ,
34
+ height : 11
35
35
} ;
36
36
37
37
const todayBtnStyle = StyleSheet . create ( {
38
38
container : {
39
- borderColor : "#d7d7d7" ,
40
- borderRadius : 7 ,
41
- borderWidth : 0.5 ,
42
- paddingVertical : 5 ,
43
- paddingHorizontal : 9
39
+ width : 47 ,
40
+ height : 25 ,
41
+ alignItems : "center" ,
42
+ justifyContent : "center" ,
43
+ borderWidth : 1 ,
44
+ borderRadius : 5 ,
45
+ borderColor : "#d7d7d7"
44
46
} ,
45
47
text : {
46
48
fontSize : 11 ,
47
49
color : "#676767"
48
50
}
49
51
} ) ;
50
- const TodayBtn = ( { text, textStyle} ) => (
51
- < View style = { todayBtnStyle . container } >
52
- < Text style = { [ todayBtnStyle . text , textStyle ] } > { text } </ Text >
53
- </ View >
54
- ) ;
55
52
56
53
const topBarStyles = StyleSheet . create ( {
57
- centredContent : {
58
- flex : 1 ,
59
- flexDirection : "row" ,
60
- justifyContent : "center" ,
61
- alignItems : "center"
62
- } ,
63
54
title : {
64
55
fontWeight : "700" ,
65
56
letterSpacing : 0
66
57
}
67
58
} ) ;
59
+
68
60
const TopBar = ( {
69
61
onPrev,
70
62
onNext,
@@ -75,18 +67,21 @@ const TopBar = ({
75
67
year,
76
68
customTitleView} ) => (
77
69
< View style = { [ styles . calendarControls , customStyle . calendarControls ] } >
70
+ < View style = { [ styles . container , customStyle . container ] } >
71
+ < TouchableOpacity
72
+ style = { [ styles . controlButton , customStyle . controlButton ] }
73
+ onPress = { onPrev } >
74
+ < Arrow source = { require ( "./assets/calendar-arrow-left.png" ) } />
75
+ </ TouchableOpacity >
76
+ < View style = { styles . controlButton } >
77
+ < TouchableOpacity style = { todayBtnStyle . container }
78
+ onPress = { scrollToToday } >
79
+ < Text style = { todayBtnStyle . text } > Today</ Text >
80
+ </ TouchableOpacity >
81
+ </ View >
82
+ </ View >
78
83
< TouchableOpacity
79
- style = { [ styles . controlButton , customStyle . controlButton ] }
80
- onPress = { onPrev } >
81
- < Arrow source = { require ( "./assets/calendar-arrow-left.png" ) } />
82
- </ TouchableOpacity >
83
- < TouchableOpacity
84
- style = { [ styles . controlButton , customStyle . controlButton ] }
85
- onPress = { scrollToToday } >
86
- < TodayBtn text = "Today" />
87
- </ TouchableOpacity >
88
- < TouchableOpacity
89
- style = { topBarStyles . centredContent }
84
+ style = { styles . containerTitle }
90
85
onPress = { onTitlePress } >
91
86
{ customTitleView ||
92
87
< View style = { { flexDirection : "row" , alignItems : "center" } } >
@@ -99,11 +94,16 @@ const TopBar = ({
99
94
height = { 10 } />
100
95
</ View > }
101
96
</ TouchableOpacity >
102
- < TouchableOpacity
103
- style = { [ styles . controlButton , customStyle . controlButton ] }
104
- onPress = { onNext } >
105
- < Arrow source = { require ( "./assets/calendar-arrow-right.png" ) } />
106
- </ TouchableOpacity >
97
+ < View style = { [ styles . container , customStyle . container ] } >
98
+ < View style = { [ styles . controlButton , customStyle . controlButton ] } >
99
+ </ View >
100
+ < TouchableOpacity
101
+ style = { [ styles . controlButton , customStyle . controlButton ] }
102
+ onPress = { onNext } >
103
+ < Arrow source = { require ( "./assets/calendar-arrow-right.png" ) } />
104
+ </ TouchableOpacity >
105
+
106
+ </ View >
107
107
</ View >
108
108
) ;
109
109
TopBar . defaultProps = {
0 commit comments