2025-02-28 16:49:09 +01:00
|
|
|
import React, { useState } from "react";
|
2022-10-17 12:25:24 +02:00
|
|
|
import "./ExampleSidebar.scss";
|
2024-01-01 20:18:44 +05:30
|
|
|
|
2022-06-14 17:56:05 +05:30
|
|
|
export default function Sidebar({ children }: { children: React.ReactNode }) {
|
2024-01-24 17:07:54 +05:30
|
|
|
const [open, setOpen] = useState(false);
|
2021-12-27 18:01:33 +05:30
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<div id="mySidebar" className={`sidebar ${open ? "open" : ""}`}>
|
|
|
|
<button className="closebtn" onClick={() => setOpen(false)}>
|
|
|
|
x
|
|
|
|
</button>
|
|
|
|
<div className="sidebar-links">
|
2023-02-07 01:11:20 -06:00
|
|
|
<button>Empty Home</button>
|
2023-05-14 00:39:16 +03:30
|
|
|
<button>Empty About</button>
|
2021-12-27 18:01:33 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={`${open ? "sidebar-open" : ""}`}>
|
|
|
|
<button
|
|
|
|
className="openbtn"
|
|
|
|
onClick={() => {
|
|
|
|
setOpen(!open);
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
Open Sidebar
|
|
|
|
</button>
|
2022-06-14 17:56:05 +05:30
|
|
|
{children}
|
2021-12-27 18:01:33 +05:30
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|