Skip to content

Commit 7b78e49

Browse files
author
Alex Patterson
committed
adjust dashboard for real features
1 parent 9fda25e commit 7b78e49

7 files changed

Lines changed: 36 additions & 32 deletions

File tree

File renamed without changes.

app/(main)/(user)/dashboard/browse/page.tsx renamed to app/(main)/(user)/dashboard/bookmarks/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Bookmarks from "./bookmarks";
55
export default function DashboardPage() {
66
return (
77
<main className="flex-1 overflow-auto flex flex-col">
8-
<h1>Bookmarks</h1>
8+
<h1 className="text-2xl font-bold text-start">Bookmarks</h1>
99

1010
<div className="grid grid-cols-1 gap-4 p-4 md:gap-8 md:p-6 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4">
1111
<Suspense fallback={<div>Loading...</div>}>

‎app/(main)/(user)/dashboard/layout.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function SettingsLayout({
77
}: {
88
children: React.ReactNode;
99
}) {
10-
const paths = ["/dashboard/browse"];
10+
const paths = ["/dashboard/bookmarks"];
1111
return (
1212
<div className="grid h-full w-full lg:grid-cols-[280px_1fr]">
1313
<div className="hidden border-r bg-gray-100/40 lg:block dark:bg-gray-800/40">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { redirect } from "next/navigation";
22

33
export default async function SettingsPage() {
4-
redirect("/dashboard/browse");
4+
redirect("/dashboard/bookmarks");
55
}

‎app/(main)/(user)/settings/account/page.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export default function Component() {
165165
</CardContent>
166166
</Card>
167167

168-
<Card>
168+
{/* <Card>
169169
<CardHeader>
170170
<CardTitle>The Danger Zone</CardTitle>
171171
</CardHeader>
@@ -179,7 +179,7 @@ export default function Component() {
179179
</div>
180180
</form>
181181
</CardContent>
182-
</Card>
182+
</Card> */}
183183
</div>
184184
);
185185
}

‎app/(main)/(user)/settings/appearance/page.tsx‎

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use client"
12
import {
23
Card,
34
CardHeader,
@@ -14,8 +15,17 @@ import {
1415
SelectItem,
1516
} from "@/components/ui/select";
1617
import { Slider } from "@/components/ui/slider";
18+
import { useTheme } from "next-themes";
19+
import { useEffect, useState } from "react";
1720

1821
export default function Component() {
22+
const { setTheme, theme } = useTheme();
23+
const [isClient, setIsClient] = useState(false);
24+
25+
useEffect(() => {
26+
setIsClient(true);
27+
}, []);
28+
1929
return (
2030
<div className="grid gap-6">
2131
<Card>
@@ -26,31 +36,25 @@ export default function Component() {
2636
</CardDescription>
2737
</CardHeader>
2838
<CardContent>
29-
<form className="grid gap-4">
30-
<div className="grid gap-2">
31-
<Label htmlFor="theme">Theme</Label>
32-
<Select name="theme">
33-
<SelectTrigger>
34-
<SelectValue placeholder="Select a theme" />
35-
</SelectTrigger>
36-
<SelectContent>
37-
<SelectItem value="light">Light</SelectItem>
38-
<SelectItem value="dark">Dark</SelectItem>
39-
<SelectItem value="system">System</SelectItem>
40-
</SelectContent>
41-
</Select>
42-
</div>
43-
<div className="grid gap-2">
44-
<Label htmlFor="font-size">Font Size</Label>
45-
<Slider
46-
id="font-size"
47-
defaultValue={[16]}
48-
min={12}
49-
max={24}
50-
step={2}
51-
/>
52-
</div>
53-
</form>
39+
{!isClient ? (
40+
<>Loading...</>
41+
) :
42+
<form className="grid gap-4">
43+
<div className="grid gap-2">
44+
<Label htmlFor="theme">Theme</Label>
45+
<Select name="theme" value={theme} onValueChange={(v) => setTheme(v)}>
46+
<SelectTrigger >
47+
<SelectValue placeholder="Select a theme" />
48+
</SelectTrigger>
49+
<SelectContent>
50+
<SelectItem value="light">Light</SelectItem>
51+
<SelectItem value="dark">Dark</SelectItem>
52+
<SelectItem value="system">System</SelectItem>
53+
</SelectContent>
54+
</Select>
55+
</div>
56+
</form>
57+
}
5458
</CardContent>
5559
</Card>
5660
</div>

‎app/(main)/(user)/settings/layout.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export default function SettingsLayout({
1212
"/settings/profile",
1313
"/settings/account",
1414
"/settings/appearance",
15-
"/settings/notifications",
16-
"/settings/display",
15+
// "/settings/notifications",
16+
// "/settings/display",
1717
];
1818
return (
1919
<div className="grid h-full w-full lg:grid-cols-[280px_1fr]">

0 commit comments

Comments
 (0)