diff options
author | Lieuwe Rooijakkers <lieuwerooijakkers@gmail.com> | 2025-01-19 22:21:32 +0100 |
---|---|---|
committer | Lieuwe Rooijakkers <lieuwerooijakkers@gmail.com> | 2025-01-19 22:21:46 +0100 |
commit | 93552152be180766fda08b1bd7ccefc4d26065ff (patch) | |
tree | f9f1e19372995729adc7e1c79f16c27acd9625be /client/src/routes/app/components/sidebar | |
parent | 6841765fcbfadbd4e3006f5fbcea45194c92e5a1 (diff) |
client advancements
Diffstat (limited to 'client/src/routes/app/components/sidebar')
-rw-r--r-- | client/src/routes/app/components/sidebar/sidebar.css | 24 | ||||
-rw-r--r-- | client/src/routes/app/components/sidebar/sidebar.jsx | 19 |
2 files changed, 43 insertions, 0 deletions
diff --git a/client/src/routes/app/components/sidebar/sidebar.css b/client/src/routes/app/components/sidebar/sidebar.css new file mode 100644 index 0000000..515117a --- /dev/null +++ b/client/src/routes/app/components/sidebar/sidebar.css @@ -0,0 +1,24 @@ +.sidebar { + width: 200px; + background-color: #f2f2f2; + + flex-shrink: 0; + + h1 { + margin-left: 10px; + margin-top: 10px; + } + + .file { + display: block; + + color: black; + text-decoration: none; + + padding: 5px; + } + + .file:hover { + background-color: #e4e4e4; + } +} diff --git a/client/src/routes/app/components/sidebar/sidebar.jsx b/client/src/routes/app/components/sidebar/sidebar.jsx new file mode 100644 index 0000000..1ce7d2b --- /dev/null +++ b/client/src/routes/app/components/sidebar/sidebar.jsx @@ -0,0 +1,19 @@ +import { useNavigate } from "react-router"; +import { RichTreeView } from '@mui/x-tree-view/RichTreeView'; + +import './sidebar.css'; + + +export default function Sidebar({ files }) { + const navigate = useNavigate(); + + const onSelect = (_, i) => { + navigate(`/file/${i}`); + }; + + return <div className="sidebar"> + <h1>🧀🥜</h1> + <hr/> + <RichTreeView items={files} onItemClick={onSelect} getItemLabel={p => p.title} /> + </div>; +} |