aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile/app/_layout.tsx
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-09-14 17:08:40 +0100
committerMohamedBassem <me@mbassem.com>2024-09-14 17:36:03 +0100
commit66fcf022695283268e80855365f10262ae6ec907 (patch)
tree07cc278b1476b9a868f6ecbf8cbfd9ea8ebf56f8 /apps/mobile/app/_layout.tsx
parentb9c7857c5bb16d024fed6544eebf0ef6cd10390f (diff)
downloadkarakeep-66fcf022695283268e80855365f10262ae6ec907.tar.zst
feature(mobile): Add settings page for configuring the theme
Diffstat (limited to 'apps/mobile/app/_layout.tsx')
-rw-r--r--apps/mobile/app/_layout.tsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsx
index 0f38165b..41186842 100644
--- a/apps/mobile/app/_layout.tsx
+++ b/apps/mobile/app/_layout.tsx
@@ -10,6 +10,7 @@ import { ShareIntentProvider, useShareIntent } from "expo-share-intent";
import { StatusBar } from "expo-status-bar";
import { StyledStack } from "@/components/navigation/stack";
import { Providers } from "@/lib/providers";
+import useAppSettings from "@/lib/settings";
import { cn } from "@/lib/utils";
import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
import { useColorScheme } from "nativewind";
@@ -17,7 +18,8 @@ import { useColorScheme } from "nativewind";
export default function RootLayout() {
const router = useRouter();
const { hasShareIntent } = useShareIntent();
- const { colorScheme } = useColorScheme();
+ const { colorScheme, setColorScheme } = useColorScheme();
+ const { settings } = useAppSettings();
useEffect(() => {
if (hasShareIntent) {
@@ -27,6 +29,10 @@ export default function RootLayout() {
}
}, [hasShareIntent]);
+ useEffect(() => {
+ setColorScheme(settings.theme);
+ }, [settings.theme]);
+
return (
<ShareIntentProvider>
<Providers>