sdy

update Button component

...@@ -4,6 +4,7 @@ import propTypes from "prop-types"; ...@@ -4,6 +4,7 @@ import propTypes from "prop-types";
4 4
5 const Container = styled.button` 5 const Container = styled.button`
6 border: 0; 6 border: 0;
7 + width: 100%;
7 `; 8 `;
8 9
9 const Button = ({ text }) => <Container>{text}</Container>; 10 const Button = ({ text }) => <Container>{text}</Container>;
......
...@@ -10,6 +10,7 @@ import { ...@@ -10,6 +10,7 @@ import {
10 faTags, 10 faTags,
11 } from "@fortawesome/free-solid-svg-icons"; 11 } from "@fortawesome/free-solid-svg-icons";
12 import { BrowserRouter as Router, Link } from "react-router-dom"; 12 import { BrowserRouter as Router, Link } from "react-router-dom";
13 +import Button from "../../Components/Button";
13 14
14 const MenuBar = styled.div` 15 const MenuBar = styled.div`
15 width: 15%; 16 width: 15%;
...@@ -59,7 +60,6 @@ const FuncIconBox = styled.div` ...@@ -59,7 +60,6 @@ const FuncIconBox = styled.div`
59 color: white; 60 color: white;
60 `; 61 `;
61 62
62 -// 개별 아이콘을 상자로 묶기 위한 변수
63 const IconBox = styled.div` 63 const IconBox = styled.div`
64 display: flex; 64 display: flex;
65 flex-direction: row; 65 flex-direction: row;
...@@ -73,20 +73,8 @@ const IconBox = styled.div` ...@@ -73,20 +73,8 @@ const IconBox = styled.div`
73 } 73 }
74 `; 74 `;
75 75
76 -const ExitIconBox = styled.div`
77 - display: flex;
78 - flex-direction: row;
79 - align-items: center;
80 - justify-content: center;
81 - opacity: 0.8;
82 - svg {
83 - font-size: 20px;
84 - margin-right: 5px;
85 - }
86 -`;
87 -
88 const IconName = styled.span` 76 const IconName = styled.span`
89 - font-size: 10px; 77 + font-size: 15px;
90 `; 78 `;
91 79
92 const StyledLink = styled(Link)` 80 const StyledLink = styled(Link)`
...@@ -135,9 +123,27 @@ const StyledLink = styled(Link)` ...@@ -135,9 +123,27 @@ const StyledLink = styled(Link)`
135 ) 123 )
136 return "center"; 124 return "center";
137 }}; 125 }};
126 + button {
127 + width: 100%;
128 + height: 100%;
129 + color: white;
130 + background-color: #667aff;
131 + display: flex;
132 + flex-direction: row;
133 + align-items: center;
134 + justify-content: center;
135 + opacity: 0.8;
136 + font-size: 20px;
137 + }
138 + svg.SignOut {
139 + font-size: 20px;
140 + position: absolute;
141 + left: 50px;
142 + opacity: 3;
143 + }
138 `; 144 `;
139 145
140 -export default () => { 146 +export default ({ logOut }) => {
141 return ( 147 return (
142 <MenuBar> 148 <MenuBar>
143 <TitleBox> 149 <TitleBox>
...@@ -176,10 +182,8 @@ export default () => { ...@@ -176,10 +182,8 @@ export default () => {
176 </StyledLink> 182 </StyledLink>
177 </FuncIconBox> 183 </FuncIconBox>
178 <StyledLink to="/" className="LogOutLink"> 184 <StyledLink to="/" className="LogOutLink">
179 - <ExitIconBox> 185 + <FontAwesomeIcon icon={faSignOutAlt} className="SignOut" />
180 - <FontAwesomeIcon icon={faSignOutAlt} /> 186 + <Button text={"Log Out"} onClick={logOut}></Button>
181 - <IconName /> Log Out
182 - </ExitIconBox>
183 </StyledLink> 187 </StyledLink>
184 </Router> 188 </Router>
185 </MenuBar> 189 </MenuBar>
......