forked from Yadro/time-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeader.tsx
More file actions
44 lines (38 loc) · 1.05 KB
/
Copy pathHeader.tsx
File metadata and controls
44 lines (38 loc) · 1.05 KB
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
import React from 'react';
import { Link } from 'react-router-dom';
import { Layout } from 'antd';
import { observer } from 'mobx-react';
import useMediaQuery from 'react-hook-media-query';
import { createUseStyles } from 'react-jss';
import HeaderLink from './HeaderLink';
import Profile from './Profile';
import TaskControl from './TaskControl';
import ProgressBar from './ProgressBar';
const { Header: HeaderBase } = Layout;
const query = '(min-width: 950px)';
function Header() {
const style = useStyle();
const isBigScreen = useMediaQuery(query);
return (
<HeaderBase>
<HeaderLink>
<Link to="/hours">Hours</Link>
</HeaderLink>
<HeaderLink>
<Link to="/projects">Projects</Link>
</HeaderLink>
<HeaderLink>
<Link to="/dashboard">Dashboard</Link>
</HeaderLink>
<span className={style.flex1}>{isBigScreen && <ProgressBar />}</span>
<TaskControl />
<Profile />
</HeaderBase>
);
}
export default observer(Header);
const useStyle = createUseStyles({
flex1: {
flex: 1,
},
});