From 9c9b5eaf7fb12e0809312fb5a828db2e51bc569c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Boduro=C4=9Flu?= <80620802+burakboduroglu@users.noreply.github.com> Date: Wed, 22 Jul 2026 20:46:31 +0300 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20replace=20deta?= =?UTF-8?q?il=20accordions=20with=20tabs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add shadcn-solid tabs wrapper backed by Kobalte tabs - convert course, exam, and event detail sections to tabs - keep inactive tab panels mounted but visually hidden - remove unused section disclosure component --- src/components/ui/section-disclosure.tsx | 50 ----- src/components/ui/tabs.tsx | 48 +++++ src/pages/course-detail-page.tsx | 200 ++++++++----------- src/pages/event-detail-page.tsx | 195 ++++++++----------- src/pages/exam-detail-page.tsx | 237 ++++++++++------------- 5 files changed, 315 insertions(+), 415 deletions(-) delete mode 100644 src/components/ui/section-disclosure.tsx create mode 100644 src/components/ui/tabs.tsx diff --git a/src/components/ui/section-disclosure.tsx b/src/components/ui/section-disclosure.tsx deleted file mode 100644 index ec53285..0000000 --- a/src/components/ui/section-disclosure.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import type { JSX, ParentProps } from "solid-js"; -import { IconChevronRight } from "@/components/ui/icons"; -import { cn } from "@/lib/cn"; - -export function SectionDisclosure(props: ParentProps<{ - open: boolean; - onToggle: () => void; - title: string; - description?: string; - meta?: JSX.Element; - actions?: JSX.Element; - class?: string; -}>) { - return ( -
-
- -
- {props.meta} - {props.actions} -
-
-
-
-
- {props.children} -
-
-
-
- ); -} diff --git a/src/components/ui/tabs.tsx b/src/components/ui/tabs.tsx new file mode 100644 index 0000000..530be40 --- /dev/null +++ b/src/components/ui/tabs.tsx @@ -0,0 +1,48 @@ +import { Tabs as TabsPrimitive } from "@kobalte/core/tabs"; +import type { ComponentProps, ValidComponent } from "solid-js"; +import { splitProps } from "solid-js"; +import { cn } from "@/lib/cn"; + +export const Tabs = TabsPrimitive; + +export function TabsList( + props: ComponentProps>, +) { + const [local, rest] = splitProps(props as ComponentProps, ["class"]); + return ( + + ); +} + +export function TabsTrigger( + props: ComponentProps>, +) { + const [local, rest] = splitProps(props as ComponentProps, ["class"]); + return ( + + ); +} + +export function TabsContent( + props: ComponentProps>, +) { + const [local, rest] = splitProps(props as ComponentProps, ["class"]); + return ( +