From 09652176f97f11bc06f4c9b57a448e14744eac12 Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
Date: Sat, 24 May 2025 12:59:43 +0000
Subject: feat: Allow defaulting to reader mode when clicking on bookmarks.
 Fixes #662

---
 apps/web/app/settings/layout.tsx | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

(limited to 'apps/web/app/settings/layout.tsx')

diff --git a/apps/web/app/settings/layout.tsx b/apps/web/app/settings/layout.tsx
index 9bac783c..1f7c5c12 100644
--- a/apps/web/app/settings/layout.tsx
+++ b/apps/web/app/settings/layout.tsx
@@ -1,6 +1,8 @@
 import MobileSidebar from "@/components/shared/sidebar/MobileSidebar";
 import Sidebar from "@/components/shared/sidebar/Sidebar";
 import SidebarLayout from "@/components/shared/sidebar/SidebarLayout";
+import { UserSettingsContextProvider } from "@/lib/userSettings";
+import { api } from "@/server/api/client";
 import { TFunction } from "i18next";
 import {
   ArrowLeft,
@@ -79,12 +81,15 @@ export default async function SettingsLayout({
 }: Readonly<{
   children: React.ReactNode;
 }>) {
+  const userSettings = await api.users.settings();
   return (
-    <SidebarLayout
-      sidebar={<Sidebar items={settingsSidebarItems} />}
-      mobileSidebar={<MobileSidebar items={settingsSidebarItems} />}
-    >
-      {children}
-    </SidebarLayout>
+    <UserSettingsContextProvider userSettings={userSettings}>
+      <SidebarLayout
+        sidebar={<Sidebar items={settingsSidebarItems} />}
+        mobileSidebar={<MobileSidebar items={settingsSidebarItems} />}
+      >
+        {children}
+      </SidebarLayout>
+    </UserSettingsContextProvider>
   );
 }
-- 
cgit v1.2.3-70-g09d2

