diff --git a/src/components/Sidebar/index.tsx b/src/components/Sidebar/index.tsx index 94bf8c7..e10faa1 100644 --- a/src/components/Sidebar/index.tsx +++ b/src/components/Sidebar/index.tsx @@ -3,17 +3,28 @@ import Link from "next/link"; import styled from "styled-components"; import { useLocalStorage } from "usehooks-ts"; import { FaFileImport } from "react-icons/fa"; -import { MdAutoGraph, MdFormatLineSpacing } from "react-icons/md"; +import { + MdUnfoldMore, + MdUnfoldLess, +} from "react-icons/md"; import { AiFillHome, AiOutlineClear, AiFillGithub, AiOutlineTwitter, AiFillControl, + AiOutlineControl, } from "react-icons/ai"; +import { + CgArrowLongDownE, + CgArrowLongLeftE, + CgArrowLongRightE, + CgArrowLongUpE, +} from "react-icons/cg"; import { getNextLayout } from "src/containers/LiveEditor/helpers"; import { StorageConfig } from "src/typings/global"; +import { CanvasDirection } from "reaflow"; const StyledSidebar = styled.div` display: flex; @@ -89,6 +100,13 @@ const StyledImportFile = styled.label` } `; +function getLayoutIcon(layout: CanvasDirection) { + if (layout === "LEFT") return ; + if (layout === "UP") return ; + if (layout === "RIGHT") return ; + return ; +} + export const Sidebar: React.FC<{ setJson: React.Dispatch>; }> = ({ setJson }) => { @@ -99,6 +117,7 @@ export const Sidebar: React.FC<{ controls: true, }); + const handleFileChange = (e: React.ChangeEvent) => { if (e.target.files) setJsonFile(e.target.files?.item(0)); }; @@ -159,14 +178,14 @@ export const Sidebar: React.FC<{ } title="Change Layout" > - + {getLayoutIcon(config.layout)} toggle("controls")} > - + {config.controls ? : } toggle("expand")} > - + {config.expand ? : }