-
Notifications
You must be signed in to change notification settings - Fork 145
/
NavBar.js
49 lines (45 loc) · 1.17 KB
/
NavBar.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 { Link } from "gatsby"
import { ClassNames } from "@emotion/core"
export default function Navbar() {
// @todo #1 Adjust NavBar style according to latest design (desktop).
const stylesLink = {
color: "black",
textDecoration: "none",
display: "inline-block",
position: "relative",
margin: "0 1rem",
}
const stylesActiveLink = {
borderBottom: "2px solid #ef314a",
}
const linkTo = (url, text) => (
<ClassNames>
{({ css }) => (
<Link
className={css(stylesLink)}
activeClassName={css(stylesActiveLink)}
to={url}
>
{text}
</Link>
)}
</ClassNames>
)
return (
<nav
css={{
display: "block",
border: "solid #4a4a4a",
borderWidth: "1px 0",
padding: "0.75rem 0",
textAlign: "center",
}}
>
{linkTo("/", "ดูผลตามพื้นที่")}
{linkTo("/party/", "ดูผลตามพรรค")}
{linkTo("/overview/", "ภาพรวมผลลัพธ์")}
{linkTo("/source/", "ข้อมูลเรามาจากไหน")}
</nav>
)
}