Skip to content

Commit 523c624

Browse files
committed
refactor: remove themeSwitcher prop from SidebarLayout
1 parent a85dcf7 commit 523c624

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

packages/core/src/components/sidebar/sidebar-layout.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
1-
import type { ReactNode } from "react";
21
import { SidebarProvider, SidebarInset, SidebarTrigger, useSidebar } from "@/components/sidebar";
32
import { AppShellOutlet } from "@/components/content";
43
import { ThemeSwitcher } from "@/components/theme-switcher";
54
import { DefaultSidebar } from "./default-sidebar";
65
import { DynamicBreadcrumb } from "@/components/dynamic-breadcrumb";
76

87
export type SidebarLayoutProps = {
9-
/**
10-
* Header theme control.
11-
*
12-
* @default Built-in **`ThemeSwitcher`** menu (all themes + **System**).
13-
* Pass **`null`** to hide. Pass a custom **`ReactNode`** to replace.
14-
*/
15-
themeSwitcher?: ReactNode;
16-
178
/**
189
* Custom content renderer.
1910
*
@@ -75,7 +66,6 @@ const HidableSidebarTrigger = () => {
7566

7667
export const SidebarLayout = (props: SidebarLayoutProps) => {
7768
const Children = props.children ? props.children({ Outlet: AppShellOutlet }) : null;
78-
const themeSwitcher = props.themeSwitcher !== undefined ? props.themeSwitcher : <ThemeSwitcher />;
7969

8070
return (
8171
<SidebarProvider
@@ -92,9 +82,9 @@ export const SidebarLayout = (props: SidebarLayoutProps) => {
9282
<HidableSidebarTrigger />
9383
<DynamicBreadcrumb />
9484
</div>
95-
{themeSwitcher !== null ? (
96-
<div className="astw:flex astw:items-center astw:gap-2">{themeSwitcher}</div>
97-
) : null}
85+
<div className="astw:flex astw:items-center astw:gap-2">
86+
<ThemeSwitcher />
87+
</div>
9888
</div>
9989
</header>
10090
<div className="astw:flex astw:flex-col astw:gap-4 astw:flex-1 astw:min-h-0">

0 commit comments

Comments
 (0)