-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
refactor: sideMenu 컴포넌트로
- Loading branch information
Showing
2 changed files
with
73 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import React from "react"; | ||
import theme from "../../styles/theme"; | ||
import styled from "styled-components"; | ||
import { useState } from "react"; | ||
import { FOLDER, GROUPS, SETTING } from "../../constants"; | ||
import Button from "../atoms/button"; | ||
import { AiOutlineFolderOpen, AiOutlineSetting } from "react-icons/ai"; | ||
import { RiGroup2Line } from "react-icons/ri"; | ||
|
||
const SideMenuStyle = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
width: 5rem; | ||
height: 92vh; | ||
background-color: ${theme.greyColor}; | ||
`; | ||
|
||
const SideMenu = () => { | ||
const [sideMenu, setSideMenu] = useState(FOLDER); | ||
const sideMenuClicked = (clickedValue) => { | ||
setSideMenu(clickedValue); | ||
}; | ||
return ( | ||
<SideMenuStyle> | ||
<Button bgColor={theme.greyColor} onClick={() => sideMenuClicked(FOLDER)}> | ||
<AiOutlineFolderOpen | ||
style={{ | ||
marginTop: "1rem", | ||
width: "100%", | ||
borderLeft: sideMenu === FOLDER ? "5px solid white" : "none", | ||
}} | ||
size={35} | ||
color={sideMenu === FOLDER ? "white" : theme.lightGreyColor} | ||
/> | ||
</Button> | ||
<Button | ||
bgColor={theme.greyColor} | ||
onClick={() => sideMenuClicked(SETTING)} | ||
> | ||
<AiOutlineSetting | ||
style={{ | ||
marginTop: "1rem", | ||
width: "100%", | ||
borderLeft: sideMenu === SETTING ? "5px solid white" : "none", | ||
}} | ||
size={35} | ||
color={sideMenu === SETTING ? "white" : theme.lightGreyColor} | ||
/> | ||
</Button> | ||
<Button bgColor={theme.greyColor} onClick={() => sideMenuClicked(GROUPS)}> | ||
<RiGroup2Line | ||
style={{ | ||
marginTop: "1rem", | ||
width: "100%", | ||
borderLeft: sideMenu === GROUPS ? "5px solid white" : "none", | ||
}} | ||
size={35} | ||
color={sideMenu === GROUPS ? "white" : theme.lightGreyColor} | ||
/> | ||
</Button> | ||
</SideMenuStyle> | ||
); | ||
}; | ||
|
||
export default SideMenu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters