Skip to content

Commit f89d03f

Browse files
authored
feat(theme-selector): enhance documentation with new showcase and installation instructions (#399)
1 parent 4168001 commit f89d03f

File tree

2 files changed

+71
-11
lines changed

2 files changed

+71
-11
lines changed
Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,71 @@
11
import { Metadata } from "next";
22

3+
import { Separator } from "@/components/ui/separator";
4+
35
import ThemeSelectorExample from "@/components/examples/theme-selector";
6+
import ThemeSelectorShowcase from "@/components/examples/theme-selector-showcase";
7+
8+
import CodeSnippet from "../code-snippet";
9+
import CopyCommandButton from "../copy-command-button";
10+
import InstallationCommands from "../installation-commands";
411

512
export const metadata: Metadata = {
6-
title: "Theme Selector",
13+
title: "8-bit Theme Selector",
714
description:
815
"A complete theme selector component with dropdown selection and code copy functionality. Includes theme context provider for managing active themes across the application.",
916
};
1017

1118
export default function ThemeSelectorPage() {
1219
return (
13-
<>
14-
<div className="flex flex-col p-4 gap-5 py-10">
15-
<h1 className={`retro md:text-2xl font-bold`}>Theme Selector</h1>
16-
<p className="max-w-2xl text-sm md:text-base">
17-
A complete theme selector component with dropdown selection and code
18-
copy functionality. Includes theme context provider for managing
19-
active themes across the application.
20-
</p>
20+
<div className="flex flex-col gap-4">
21+
<div className="flex flex-col md:flex-row items-center justify-between gap-2">
22+
<h1 className="text-3xl font-bold">Theme Selector</h1>
23+
<CopyCommandButton
24+
copyCommand="pnpm dlx shadcn@latest add @8bitcn/theme-selector"
25+
command="pnpm dlx shadcn@latest add @8bitcn/theme-selector"
26+
/>
2127
</div>
2228

23-
<div className="p-5">
29+
<p className="text-muted-foreground">
30+
A complete theme selector component with dropdown selection and code
31+
copy functionality. Includes theme context provider for managing active
32+
themes across the application.
33+
</p>
34+
35+
<div className="flex flex-col gap-4 border rounded-lg p-4 min-h-[450px] relative">
36+
<div className="flex items-center justify-between">
37+
<h2 className="text-sm text-muted-foreground sm:pl-3">
38+
8-bit theme selector component
39+
</h2>
40+
</div>
41+
<div className="flex items-center justify-center min-h-[400px] relative">
42+
<div className="flex flex-col items-center gap-6">
43+
<ThemeSelectorShowcase />
44+
</div>
45+
</div>
46+
</div>
47+
48+
<h3 className="text-lg font-bold">Installation</h3>
49+
50+
<Separator />
51+
52+
<InstallationCommands packageName="theme-selector" />
53+
54+
<h3 className="text-lg font-bold mt-10">Usage</h3>
55+
56+
<Separator />
57+
58+
<CodeSnippet>{`import { ThemeSelector } from "@/components/theme-selector"`}</CodeSnippet>
59+
60+
<CodeSnippet>{`<ThemeSelector />`}</CodeSnippet>
61+
62+
<h3 className="text-lg font-bold mt-10">Examples</h3>
63+
64+
<Separator />
65+
66+
<div className="mt-4">
2467
<ThemeSelectorExample />
2568
</div>
26-
</>
69+
</div>
2770
);
2871
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"use client";
2+
3+
import { useThemeConfig } from "@/components/active-theme";
4+
import { SelectThemeDropdown } from "@/components/select-theme-dropdown";
5+
6+
export default function ThemeSelectorShowcase() {
7+
const { activeTheme, setActiveTheme } = useThemeConfig();
8+
9+
return (
10+
<div className="w-full max-w-md">
11+
<SelectThemeDropdown
12+
activeTheme={activeTheme}
13+
setActiveTheme={setActiveTheme}
14+
/>
15+
</div>
16+
);
17+
}

0 commit comments

Comments
 (0)