source: imaps-frontend/src/components/SideBar/SideBar.jsx

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 1.1 KB
Line 
1import React, { useState } from "react";
2import styles from "./SideBar.module.css";
3import menu_closed from "../../assets/menu_closed_icon.png";
4import menu_opened from "../../assets/menu_opened_icon.png";
5import { Link } from "react-router-dom";
6
7function SideBar() {
8 const [isOpen, setIsOpen] = useState(false);
9
10 const toggleSidebar = () => {
11 setIsOpen(!isOpen);
12 };
13
14 return (
15 <div>
16 <div className={`${styles.sidebar} ${isOpen ? styles.open : ""}`}>
17 <button className={styles.toggleBtn} onClick={toggleSidebar}>
18 <img src={isOpen ? menu_opened : menu_closed} alt="Menu Toggle" />
19 </button>
20 <div className={styles.sidebarContent}>
21 <ul>
22 <li>
23 <Link to="/">Home</Link>
24 </li>
25 <li>
26 <Link to="/Maps">Maps</Link>
27 </li>
28 <li>
29 <Link to="/Maps/FinkiMaps/Draw">Draw</Link>
30 </li>
31 </ul>
32 </div>
33 </div>
34 {isOpen && <div className={styles.overlay} onClick={toggleSidebar}></div>}
35 </div>
36 );
37}
38
39export default SideBar;
Note: See TracBrowser for help on using the repository browser.