-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBookingHeader.js
91 lines (78 loc) · 2.1 KB
/
BookingHeader.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import React from 'react'
import Paper from 'material-ui/Paper'
import Left from 'material-ui/svg-icons/hardware/keyboard-arrow-left';
import Right from 'material-ui/svg-icons/hardware/keyboard-arrow-right';
const Date = ({...props})=>{
const {height,width,date, margin} = props;
const date_style={
display:'inline-block',
height,
width,
margin:`0px ${margin}px`,
//lineHeight:`${height}px`,
textAlign:'center',
backgroundColor:'#5C6BC0',
paddingTop:'5px',
color: '#E8EAF6'
}
return(
<Paper
style={date_style}
>
{date.format('dddd')}<br/>
{date.format('MMM Do')}
</Paper>
)
}
export default ({...props})=>{
const {
buttonComponent,
buttonStyle,
slide,
dateRange,
shift,
lifeShift,
cellStyle
} = props;
let iterate = dateRange.iterateInner('days')
let numDays = dateRange.count('days')
const dateList = [...Array(numDays-1)].map((element,index)=>{
return(
<Date
key={index}
height={buttonStyle.height}
width={cellStyle.width}
margin={cellStyle.margin}
date={iterate.next()}
/>
)
})
const header_style={
}
const my_button ={
float:'right',
}
return(
<div
style={header_style}
>
{buttonComponent(
{
onTouchTap:(ev)=> slide(ev,1),
backgroundColor:"#3949AB",
style:{...buttonStyle},
icon:<Left color={'white'}/>,
})}
<div style={{display:'inline-block',position:'absolute',left:shift+lifeShift}}>
{dateList}
</div>
{buttonComponent(
{
onTouchTap:(ev)=> slide(ev,-1),
backgroundColor:"#3949AB",
style:{...buttonStyle,...my_button},
icon:<Right color={'white'}/>,
})}
</div>
)
}