1
This commit is contained in:
parent
c34f257fd0
commit
54a9fdadba
@ -89,39 +89,6 @@ export function Sidebar() {
|
|||||||
<div className="border-b border-sidebar-border px-6 pb-6 pt-7">
|
<div className="border-b border-sidebar-border px-6 pb-6 pt-7">
|
||||||
<h1 className="text-2xl font-semibold tracking-tight text-white">香港大学中国商业学院</h1>
|
<h1 className="text-2xl font-semibold tracking-tight text-white">香港大学中国商业学院</h1>
|
||||||
<p className="mt-1 text-sm text-white/65">HKU ICB</p>
|
<p className="mt-1 text-sm text-white/65">HKU ICB</p>
|
||||||
{activeClassName && (
|
|
||||||
<div className="mt-5 rounded-2xl border border-white/10 bg-white/[0.06] p-4">
|
|
||||||
<p className="text-[11px] uppercase tracking-[0.22em] text-white/38">
|
|
||||||
当前班级
|
|
||||||
</p>
|
|
||||||
<p className="mt-2 text-sm font-medium leading-6 text-white">
|
|
||||||
{activeClassName}
|
|
||||||
</p>
|
|
||||||
{canSwitchClass && availableClasses.length > 1 && (
|
|
||||||
<div className="mt-3">
|
|
||||||
<Select
|
|
||||||
value={activeClassId ? String(activeClassId) : ""}
|
|
||||||
onValueChange={(value) => value && setActiveClassId(Number(value))}
|
|
||||||
>
|
|
||||||
<SelectTrigger className="h-auto w-full rounded-xl border-white/12 bg-white/8 px-3 py-2 text-left text-sm text-white hover:bg-white/12">
|
|
||||||
<SelectValue>
|
|
||||||
{activeClassId
|
|
||||||
? availableClasses.find((item) => item.id === activeClassId)?.name ?? "切换班级"
|
|
||||||
: "切换班级"}
|
|
||||||
</SelectValue>
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent className="border-[#e2ccb0] bg-[#fffaf2]">
|
|
||||||
{availableClasses.map((item) => (
|
|
||||||
<SelectItem key={item.id} value={String(item.id)}>
|
|
||||||
{item.name} ({item.cohort_year})
|
|
||||||
</SelectItem>
|
|
||||||
))}
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav className="flex-1 space-y-1 overflow-y-auto px-4 py-5">
|
<nav className="flex-1 space-y-1 overflow-y-auto px-4 py-5">
|
||||||
@ -193,6 +160,38 @@ export function Sidebar() {
|
|||||||
)}
|
)}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
{activeClassName && (
|
||||||
|
<div className="px-5 pb-4">
|
||||||
|
<div className="rounded-2xl border border-white/8 bg-white/[0.04] px-4 py-3">
|
||||||
|
<p className="text-[10px] uppercase tracking-[0.2em] text-white/36">当前班级</p>
|
||||||
|
<p className="mt-1 text-sm leading-5 text-white/82">{activeClassName}</p>
|
||||||
|
{canSwitchClass && availableClasses.length > 1 && (
|
||||||
|
<div className="mt-3">
|
||||||
|
<Select
|
||||||
|
value={activeClassId ? String(activeClassId) : ""}
|
||||||
|
onValueChange={(value) => value && setActiveClassId(Number(value))}
|
||||||
|
>
|
||||||
|
<SelectTrigger className="h-9 w-full rounded-xl border-white/10 bg-white/[0.06] px-3 text-left text-sm text-white hover:bg-white/[0.1]">
|
||||||
|
<SelectValue>
|
||||||
|
{activeClassId
|
||||||
|
? availableClasses.find((item) => item.id === activeClassId)?.name ?? "切换班级"
|
||||||
|
: "切换班级"}
|
||||||
|
</SelectValue>
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent className="border-[#e2ccb0] bg-[#fffaf2]">
|
||||||
|
{availableClasses.map((item) => (
|
||||||
|
<SelectItem key={item.id} value={String(item.id)}>
|
||||||
|
{item.name} ({item.cohort_year})
|
||||||
|
</SelectItem>
|
||||||
|
))}
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<div className="border-t border-sidebar-border px-5 py-4">
|
<div className="border-t border-sidebar-border px-5 py-4">
|
||||||
<div className="rounded-2xl border border-white/8 bg-white/[0.03] px-4 py-3">
|
<div className="rounded-2xl border border-white/8 bg-white/[0.03] px-4 py-3">
|
||||||
<p className="text-xs text-white/68">© {new Date().getFullYear()} 香港大学中国商业学院</p>
|
<p className="text-xs text-white/68">© {new Date().getFullYear()} 香港大学中国商业学院</p>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user