mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
"use client";
|
|
|
|
import { useState } from "react";
|
|
import CourseSettingsLink from "./CourseSettingsLink";
|
|
import ModuleList from "./modules/ModuleList";
|
|
import LeftChevron from "@/components/icons/LeftChevron";
|
|
import RightChevron from "@/components/icons/RightChevron";
|
|
|
|
export default function CollapsableSidebar() {
|
|
const [isCollapsed, setIsCollapsed] = useState(false);
|
|
|
|
const widthClass = isCollapsed ? "w-0" : "w-96";
|
|
const visibilityClass = isCollapsed ? "invisible " : "visible";
|
|
return (
|
|
<div className="h-full flex flex-col">
|
|
<div className="flex flex-row justify-between mb-2">
|
|
<div className="visible mx-3 mt-2">
|
|
<button onClick={() => setIsCollapsed((i) => !i)}>
|
|
{isCollapsed ? <LeftChevron /> : <RightChevron />}
|
|
</button>
|
|
</div>
|
|
<div className={" " + (isCollapsed ? "w-0 invisible hidden" : "")}>
|
|
<CourseSettingsLink />
|
|
</div>
|
|
</div>
|
|
<div
|
|
className={`${widthClass} flex-1 sm:p-3 overflow-y-auto transition-all ${visibilityClass}`}
|
|
>
|
|
<ModuleList />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|