mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 07:39:53 +08:00
- Settings → General gains a classic/modern layout choice; classic is a frozen snapshot of dev's sidebar and learning dashboard, modern keeps iterating. Variants differ only through slots, tokens and per-variant CSS on <html data-ui-layout>; the preference lives in localStorage. - Modern chrome: warm neutral tokens, WorkspaceMenu header, ⌘K command palette and keyboard shortcuts, PageBar location strip, swipeable PartnerRoster. - Remove dead HomeShortcuts, WorkspaceSwitcher and the inline sidebar search query chain.
34 lines
890 B
TypeScript
34 lines
890 B
TypeScript
"use client";
|
|
|
|
import { useUiLayout } from "@/hooks/useUiLayout";
|
|
import type { UiLayout } from "@/lib/ui-layout";
|
|
import { classicSlots } from "./classic";
|
|
import { modernSlots } from "./modern";
|
|
import type { SidebarShellProps, UiLayoutSlots } from "./types";
|
|
|
|
const UI_LAYOUT_SLOTS: Record<UiLayout, UiLayoutSlots> = {
|
|
classic: classicSlots,
|
|
modern: modernSlots,
|
|
};
|
|
|
|
function useSlots(): UiLayoutSlots {
|
|
return UI_LAYOUT_SLOTS[useUiLayout()];
|
|
}
|
|
|
|
// Shared code renders these and never the variants' components directly.
|
|
|
|
export function LayoutSidebarShell(props: SidebarShellProps) {
|
|
const { SidebarShell } = useSlots();
|
|
return <SidebarShell {...props} />;
|
|
}
|
|
|
|
export function LayoutPageBar() {
|
|
const { PageBar } = useSlots();
|
|
return PageBar ? <PageBar /> : null;
|
|
}
|
|
|
|
export function LayoutLearningHome() {
|
|
const { LearningHome } = useSlots();
|
|
return <LearningHome />;
|
|
}
|