-
Notifications
You must be signed in to change notification settings - Fork 0
/
RowHeader.js
49 lines (43 loc) · 855 Bytes
/
RowHeader.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
import React from 'react';
import moment from 'moment';
import { styled, View, Text } from 'bappo-components';
const weekdays = [
'Mon',
'Tue',
'Wed',
'Thu',
'Fri'
];
const RowHeader = ({
data,
startDate,
}) => {
const cells = weekdays.map((v, i) => <Cell key={v}>{`${v} ${moment(startDate).add(i, 'day').format('DD/MM')}`}</Cell>);
return (
<RowContainer>
<Cell>Job</Cell>
{cells}
<Cell>Total</Cell>
<Divider />
</RowContainer>
);
}
export default RowHeader;
const RowContainer = styled(View)`
flex-direction: row;
margin-top: 10px;
margin-bottom: 20px;
`;
const Cell = styled(Text)`
font-weight: bold;
flex: 1;
display: flex;
justify-content: center;
`;
const Divider = styled(View)`
position: absolute;
bottom: -7px;
width: 100%;
height: 1px;
background-color: #ccc;
`;