MenuPresenter.js
4.01 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
import React from "react";
import styled from "styled-components";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {
faHome,
faComment,
faCog,
faQuestionCircle,
faTags,
faSignOutAlt,
} from "@fortawesome/free-solid-svg-icons";
import { BrowserRouter as Router, Link } from "react-router-dom";
const MenuBar = styled.div`
width: 15%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
box-shadow: 1px 1px 10px #8395a7;
background-color: #667aff;
`;
const TitleBox = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 15%;
font-size: 30px;
color: white;
margin-bottom: 10px;
`;
const Title = styled.span`
font-family: "Raleway", sans-serif;
`;
const HomeIconBox = styled.div`
width: 100%;
height: 10%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-size: 30px;
opacity: 0.8;
`;
const FuncIconBox = styled.div`
width: 100%;
height: 60%;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
opacity: 0.8;
color: white;
`;
const IconBox = styled.div`
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
svg {
font-size: 20px;
margin-right: 5px;
}
`;
const IconName = styled.span`
font-size: 15px;
`;
const StyledLink = styled(Link)`
text-decoration: none;
color: white;
cursor: pointer;
transition: 0.5s;
&:hover {
color: #667aff;
background-color: white;
}
width: ${(props) => {
if (
props.className === "LogOutLink" ||
props.className === "HomeLink" ||
props.className === "FuncLink"
)
return "100%";
}};
height: ${(props) => {
if (props.className === "LogOutLink") return "15%";
if (props.className === "HomeLink") return "10%";
if (props.className === "FuncLink") return "100%";
}};
display: ${(props) => {
if (
props.className === "LogOutLink" ||
props.className === "HomeLink" ||
props.className === "FuncLink"
)
return "flex";
}};
justify-content: ${(props) => {
if (
props.className === "LogOutLink" ||
props.className === "HomeLink" ||
props.className === "FuncLink"
)
return "center";
}};
align-items: ${(props) => {
if (
props.className === "LogOutLink" ||
props.className === "HomeLink" ||
props.className === "FuncLink"
)
return "center";
}};
`;
export default ({ logOut }) => {
return (
<MenuBar>
<TitleBox>
<Title>KhuChat</Title>
</TitleBox>
<Router>
<StyledLink to="/Home" className="HomeLink">
<HomeIconBox>
<FontAwesomeIcon icon={faHome} />
</HomeIconBox>
</StyledLink>
<FuncIconBox>
<StyledLink to="/OTOChat" className="FuncLink">
<IconBox>
<FontAwesomeIcon icon={faComment} />
<IconName /> One To One Chat
</IconBox>
</StyledLink>
<StyledLink to="/RandomChat" className="FuncLink">
<IconBox>
<FontAwesomeIcon icon={faQuestionCircle} />
<IconName /> Random Chat
</IconBox>
</StyledLink>
<StyledLink to="/CategoryChat" className="FuncLink">
<IconBox>
<FontAwesomeIcon icon={faTags} />
<IconName /> Category Chat
</IconBox>
</StyledLink>
<StyledLink to="/Profile" className="FuncLink">
<IconBox>
<FontAwesomeIcon icon={faCog} />
<IconName /> Profile Setting
</IconBox>
</StyledLink>
</FuncIconBox>
<StyledLink to="/" className="LogOutLink" onClick={logOut}>
<IconBox>
<FontAwesomeIcon icon={faSignOutAlt} />
<IconName /> Log Out
</IconBox>
</StyledLink>
</Router>
</MenuBar>
);
};