-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathindex.tsx
91 lines (75 loc) · 1.96 KB
/
index.tsx
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 styled, { css } from "styled-components";
import DarkModeIcon from "svgs/menu-icons/dark-mode.svg";
import HelpIcon from "svgs/menu-icons/help.svg";
import LightModeIcon from "svgs/menu-icons/light-mode.svg";
// import NotificationsIcon from "svgs/menu-icons/notifications.svg";
import SettingsIcon from "svgs/menu-icons/settings.svg";
import { useToggleTheme } from "hooks/useToggleThemeContext";
import { landscapeStyle } from "styles/landscapeStyle";
import LightButton from "components/LightButton";
import { IHelp, ISettings } from "../index";
const Container = styled.div`
display: flex;
flex-direction: column;
${landscapeStyle(
() => css`
flex-direction: row;
`
)}
`;
const ButtonContainer = styled.div`
min-height: 32px;
display: flex;
align-items: center;
button {
padding: 0px;
}
.button-text {
display: block;
}
${landscapeStyle(
() => css`
.button-text {
display: none;
}
`
)}
`;
interface IMenu {
isMobileNavbar?: boolean;
}
const Menu: React.FC<ISettings & IHelp & IMenu> = ({ toggleIsHelpOpen, toggleIsSettingsOpen, isMobileNavbar }) => {
const [theme, toggleTheme] = useToggleTheme();
const isLightTheme = theme === "light";
const buttons = [
// { text: "Notifications", Icon: NotificationsIcon },
{
text: "Settings",
Icon: SettingsIcon,
onClick: () => toggleIsSettingsOpen(),
},
{
text: "Help",
Icon: HelpIcon,
onClick: () => {
toggleIsHelpOpen();
},
},
{
text: `${isLightTheme ? "Dark" : "Light"} Mode`,
Icon: isLightTheme ? DarkModeIcon : LightModeIcon,
onClick: () => toggleTheme(),
},
];
return (
<Container>
{buttons.map(({ text, Icon, onClick }) => (
<ButtonContainer key={Icon}>
<LightButton {...{ text, onClick, Icon, isMobileNavbar }} />
</ButtonContainer>
))}
</Container>
);
};
export default Menu;