-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
MenuButton.js
47 lines (42 loc) · 1.08 KB
/
MenuButton.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
import React from 'react'
import Button from './Button'
import { COLORS } from '../lib/constants'
import * as Arrows from './svg/Arrows'
const MenuButton = React.memo(({ name, select, selected, noArrows }) => {
return (
<div className="menu-button">
<Button
padding="8px"
onClick={select(name)}
background={selected === name ? COLORS.BLACK : COLORS.DARK_GRAY}
>
{name}
{!noArrows && (
<div className="arrow-icon">
<Arrows.Right />
</div>
)}
</Button>
<style jsx>
{`
.menu-button {
display: flex;
height: 33px;
border-bottom: 1px solid ${COLORS.SECONDARY};
position: relative;
align-items: center;
}
.menu-button:last-child {
${selected === 'Misc' ? 'border-bottom: none;' : ''};
}
.arrow-icon {
position: absolute;
right: 14px;
top: 11px;
}
`}
</style>
</div>
)
})
export default MenuButton