From c541a01fd5e7afcf611710e8a95fa17bfa7ec37d Mon Sep 17 00:00:00 2001 From: Chelim Lee Date: Sun, 30 Oct 2022 18:00:47 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20sideMenu=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=EB=A1=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/molecules/sideMenu.jsx | 65 ++++++++++++++++++++++++ src/components/pages/home.jsx | 73 +++------------------------ 2 files changed, 73 insertions(+), 65 deletions(-) create mode 100644 src/components/molecules/sideMenu.jsx diff --git a/src/components/molecules/sideMenu.jsx b/src/components/molecules/sideMenu.jsx new file mode 100644 index 0000000..8f985d3 --- /dev/null +++ b/src/components/molecules/sideMenu.jsx @@ -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 ( + + + + + + ); +}; + +export default SideMenu; diff --git a/src/components/pages/home.jsx b/src/components/pages/home.jsx index b099401..74b7759 100644 --- a/src/components/pages/home.jsx +++ b/src/components/pages/home.jsx @@ -20,14 +20,7 @@ import DropDown from "../atoms/dropdown"; import Switch from "react-switch"; import Input from "../atoms/input"; import { VscRunAll } from "react-icons/vsc"; - -const SideMenuStyle = styled.div` - display: flex; - flex-direction: column; - width: 5rem; - height: 92vh; - background-color: ${theme.greyColor}; -`; +import SideMenu from "../molecules/sideMenu"; const FileList = styled.div` display: flex; @@ -70,14 +63,13 @@ const FileContainer = styled.div` background-color: ${theme.blackGreyColor}; // padding-top:1rem; // padding-left:1rem; - `; const FileContent = styled.textarea` -font-size : 1.2rem; + font-size: 1.2rem; color: white; - width: 100%; - height: 100%; + width: 100%; + height: 100%; background-color: ${theme.fileContainerColor}; `; @@ -101,7 +93,7 @@ const TerminalHeader = styled.div` const Home = () => { const [login, setLogin] = useRecoilState(loginState); const [admin, setAdmin] = useRecoilState(adminState); - const [sideMenu, setSideMenu] = useState(FOLDER); + const [fileShare, setFileShare] = useRecoilState(fileShareState); const [openedFile, setOpenedFile] = useState("파일명"); const [terminalOpened, setTerminalOpened] = useState(CONSOLE); @@ -116,10 +108,6 @@ const Home = () => { // } }); - const sideMenuClicked = (clickedValue) => { - setSideMenu(clickedValue); - }; - const terminalClicked = (clickedValue) => { setTerminalOpened(clickedValue); }; @@ -129,50 +117,7 @@ const Home = () => { return ( - - - - - +
{ {openedFile} - +
{ - - - +