From bfacfd302c11b4949aa5e516e54241872d323fd2 Mon Sep 17 00:00:00 2001 From: Venessa Kuchenik Date: Wed, 9 Jul 2025 10:25:54 -0700 Subject: [PATCH] sidebar collapsible feature The sidebar can now be collapsed to just its icons --- client/src/App.jsx | 2 +- client/src/components/sidebar.jsx | 65 +++++++++++++++++++++++-------- 2 files changed, 49 insertions(+), 18 deletions(-) diff --git a/client/src/App.jsx b/client/src/App.jsx index 4ba2739..28aa3a4 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -8,7 +8,7 @@ function App() { return ( diff --git a/client/src/components/sidebar.jsx b/client/src/components/sidebar.jsx index a4c3487..afd81fc 100644 --- a/client/src/components/sidebar.jsx +++ b/client/src/components/sidebar.jsx @@ -2,6 +2,8 @@ import { Box, Button } from "@chakra-ui/react"; import { FaVolcano } from "react-icons/fa6"; import { createIcon } from "@chakra-ui/react"; import { CloseButton } from "@chakra-ui/react"; +import { IconButton } from "@chakra-ui/react"; +import { RxHamburgerMenu } from "react-icons/rx"; import { useState } from "react" // ICONS @@ -58,23 +60,52 @@ export const Users = createIcon({ }); export default function Sidebar () { + const [isOpen, setIsOpen] = useState(true); + return ( - - - - - - - - + <> + {isOpen && ( + + setIsOpen(!isOpen)}> + + + + + + + )} + + {!isOpen && ( + + setIsOpen(!isOpen)}> + + + + + + + + + )} + ); }