aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/app/dashboard/layout.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/app/dashboard/layout.tsx')
-rw-r--r--apps/web/app/dashboard/layout.tsx42
1 files changed, 24 insertions, 18 deletions
diff --git a/apps/web/app/dashboard/layout.tsx b/apps/web/app/dashboard/layout.tsx
index 45b97653..c4a53e4b 100644
--- a/apps/web/app/dashboard/layout.tsx
+++ b/apps/web/app/dashboard/layout.tsx
@@ -4,6 +4,7 @@ import MobileSidebar from "@/components/shared/sidebar/MobileSidebar";
import Sidebar from "@/components/shared/sidebar/Sidebar";
import SidebarLayout from "@/components/shared/sidebar/SidebarLayout";
import { Separator } from "@/components/ui/separator";
+import { UserSettingsContextProvider } from "@/lib/userSettings";
import { api } from "@/server/api/client";
import { getServerAuthSession } from "@/server/auth";
import { TFunction } from "i18next";
@@ -30,7 +31,10 @@ export default async function Dashboard({
redirect("/");
}
- const lists = await api.lists.list();
+ const [lists, userSettings] = await Promise.all([
+ api.lists.list(),
+ api.users.settings(),
+ ]);
const items = (t: TFunction) =>
[
@@ -75,22 +79,24 @@ export default async function Dashboard({
];
return (
- <SidebarLayout
- sidebar={
- <Sidebar
- items={items}
- extraSections={
- <>
- <Separator />
- <AllLists initialData={lists} />
- </>
- }
- />
- }
- mobileSidebar={<MobileSidebar items={mobileSidebar} />}
- modal={modal}
- >
- {children}
- </SidebarLayout>
+ <UserSettingsContextProvider userSettings={userSettings}>
+ <SidebarLayout
+ sidebar={
+ <Sidebar
+ items={items}
+ extraSections={
+ <>
+ <Separator />
+ <AllLists initialData={lists} />
+ </>
+ }
+ />
+ }
+ mobileSidebar={<MobileSidebar items={mobileSidebar} />}
+ modal={modal}
+ >
+ {children}
+ </SidebarLayout>
+ </UserSettingsContextProvider>
);
}