-
Notifications
You must be signed in to change notification settings - Fork 1
/
Header.tsx
112 lines (103 loc) · 2.98 KB
/
Header.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import React from "react";
import styled from "styled-components";
import { FiUser, FiAward, FiEdit } from "react-icons/fi";
import { IoSchoolOutline, IoFlagOutline } from "react-icons/io5";
import { Link, useNavigate } from "react-router-dom";
import { useRecoilState, useRecoilValue } from "recoil";
import { accountAtom } from "../../atoms/accountAtom";
import { IAccount } from "../../interfaces/loginInterface";
import { TfiHelpAlt } from "react-icons/tfi";
const Header = () => {
const [account, setAccount] = useRecoilState<IAccount>(accountAtom);
const navigate = useNavigate();
return (
<HeaderContainer>
<NavigationArea>
<Link to="/member-club">
<NavigationButton>
<FiUser size="18px" />
<NavigationText>동아리원 관리</NavigationText>
</NavigationButton>
</Link>
<Link to="/activity-club/main">
<NavigationButton>
<FiAward size="18px" />
<NavigationText>동아리 활동 관리</NavigationText>
</NavigationButton>
</Link>
<Link to="/member-society">
<NavigationButton>
<IoSchoolOutline size="18px" />
<NavigationText>소학회원 관리</NavigationText>
</NavigationButton>
</Link>
<Link to="/activity-society/main">
<NavigationButton>
<IoFlagOutline size="18px" />
<NavigationText>소학회 활동 관리</NavigationText>
</NavigationButton>
</Link>
{/* <Link to="/">
<NavigationButton>
<FiEdit size="18px" />
<NavigationText>기록</NavigationText>
</NavigationButton>
</Link> */}
<Link to="/help">
<NavigationButton>
<TfiHelpAlt size="18px" />
<NavigationText>도움말</NavigationText>
</NavigationButton>
</Link>
</NavigationArea>
<LogoutArea
onClick={() => {
setAccount({ id: "", pw: "" });
sessionStorage.removeItem("token");
navigate("/login");
}}
>
<AjouLogo src={require("../../imgs/ajouLogo.png")} />
<LogoutText>로그아웃</LogoutText>
</LogoutArea>
</HeaderContainer>
);
};
export default Header;
const HeaderContainer = styled.div`
display: flex;
justify-content: space-between;
border-bottom: 1px solid black;
padding: 10px 0;
`;
const NavigationArea = styled.div`
display: flex;
`;
const NavigationButton = styled.button`
display: flex;
justify-content: center;
padding: 13px 20px;
background-color: white;
color: #8c8c8c;
margin-right: 10px;
cursor: pointer;
`;
const NavigationText = styled.span`
font-size: 18px;
margin-left: 5px;
`;
const LogoutArea = styled.div`
display: flex;
justify-content: center;
align-items: center;
margin-right: 20px;
cursor: pointer;
`;
const LogoutText = styled.span`
color: #8c8c8c;
margin-left: 5px;
`;
const AjouLogo = styled.img`
width: 40px;
height: 40px;
`;