From c46482cdaaf883971736488750513663dd023076 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Wed, 17 Apr 2024 17:56:21 +0100 Subject: mobile: Add dark mode support --- apps/mobile/app/_layout.tsx | 16 +++++++++++++--- apps/mobile/app/dashboard/(tabs)/_layout.tsx | 16 ++++++---------- apps/mobile/app/dashboard/(tabs)/lists.tsx | 4 ++-- apps/mobile/app/dashboard/(tabs)/search.tsx | 2 +- apps/mobile/app/dashboard/(tabs)/settings.tsx | 4 ++-- apps/mobile/app/dashboard/_layout.tsx | 8 ++++++-- apps/mobile/app/dashboard/add-link.tsx | 1 - apps/mobile/app/dashboard/add-note.tsx | 1 - apps/mobile/app/sharing.tsx | 6 +++--- apps/mobile/app/signin.tsx | 12 +++++++++++- 10 files changed, 44 insertions(+), 26 deletions(-) (limited to 'apps/mobile/app') diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsx index f36c9eec..a5aafb8c 100644 --- a/apps/mobile/app/_layout.tsx +++ b/apps/mobile/app/_layout.tsx @@ -7,11 +7,15 @@ import { useRouter } from "expo-router"; import { Stack } from "expo-router/stack"; 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 { cn } from "@/lib/utils"; +import { useColorScheme } from "nativewind"; export default function RootLayout() { const router = useRouter(); const { hasShareIntent } = useShareIntent(); + const { colorScheme } = useColorScheme(); useEffect(() => { if (hasShareIntent) { @@ -24,8 +28,14 @@ export default function RootLayout() { return ( - - + - + diff --git a/apps/mobile/app/dashboard/(tabs)/_layout.tsx b/apps/mobile/app/dashboard/(tabs)/_layout.tsx index 7967b5c6..cf7e473f 100644 --- a/apps/mobile/app/dashboard/(tabs)/_layout.tsx +++ b/apps/mobile/app/dashboard/(tabs)/_layout.tsx @@ -1,17 +1,13 @@ -import React, { useEffect } from "react"; -import { Platform } from "react-native"; -import * as NavigationBar from "expo-navigation-bar"; +import React from "react"; import { Tabs } from "expo-router"; +import { StyledTabs } from "@/components/navigation/tabs"; import { ClipboardList, Home, Search, Settings } from "lucide-react-native"; export default function TabLayout() { - useEffect(() => { - if (Platform.OS == "android") { - NavigationBar.setBackgroundColorAsync("white"); - } - }, []); return ( - , }} /> - + ); } diff --git a/apps/mobile/app/dashboard/(tabs)/lists.tsx b/apps/mobile/app/dashboard/(tabs)/lists.tsx index 767b9256..53817bf2 100644 --- a/apps/mobile/app/dashboard/(tabs)/lists.tsx +++ b/apps/mobile/app/dashboard/(tabs)/lists.tsx @@ -57,8 +57,8 @@ export default function Lists() { }} renderItem={(l) => ( - - + + {l.item.logo} {l.item.name} diff --git a/apps/mobile/app/dashboard/(tabs)/search.tsx b/apps/mobile/app/dashboard/(tabs)/search.tsx index 0a4dcbfd..1a79b921 100644 --- a/apps/mobile/app/dashboard/(tabs)/search.tsx +++ b/apps/mobile/app/dashboard/(tabs)/search.tsx @@ -34,7 +34,7 @@ export default function Search() { - - + + {isLoading ? "Loading ..." : data?.email} diff --git a/apps/mobile/app/dashboard/_layout.tsx b/apps/mobile/app/dashboard/_layout.tsx index c9f7355b..7548a6db 100644 --- a/apps/mobile/app/dashboard/_layout.tsx +++ b/apps/mobile/app/dashboard/_layout.tsx @@ -3,6 +3,7 @@ import { useEffect } from "react"; import { AppState, Platform } from "react-native"; import { useRouter } from "expo-router"; import { Stack } from "expo-router/stack"; +import { StyledStack } from "@/components/navigation/stack"; import { useIsLoggedIn } from "@/lib/session"; import { focusManager } from "@tanstack/react-query"; @@ -29,7 +30,10 @@ export default function Dashboard() { }, []); return ( - + - + ); } diff --git a/apps/mobile/app/dashboard/add-link.tsx b/apps/mobile/app/dashboard/add-link.tsx index 568a36b6..d913ac01 100644 --- a/apps/mobile/app/dashboard/add-link.tsx +++ b/apps/mobile/app/dashboard/add-link.tsx @@ -39,7 +39,6 @@ export default function AddNote() { {error} )} {error} )} void }) { return ( - Hoarding + Hoarding ); @@ -83,11 +83,11 @@ export default function Sharing() { break; } case "success": { - comp = Hoarded!; + comp = Hoarded!; break; } case "error": { - comp = Error!; + comp = Error!; break; } } diff --git a/apps/mobile/app/signin.tsx b/apps/mobile/app/signin.tsx index 80a5f219..c524d1e0 100644 --- a/apps/mobile/app/signin.tsx +++ b/apps/mobile/app/signin.tsx @@ -9,6 +9,7 @@ import { } from "react-native"; import { Redirect } from "expo-router"; import Logo from "@/components/Logo"; +import { TailwindResolver } from "@/components/TailwindResolver"; import { Button } from "@/components/ui/Button"; import { Input } from "@/components/ui/Input"; import useAppSettings from "@/lib/settings"; @@ -57,7 +58,16 @@ export default function Signin() { - + ( + + )} + /> {error && ( {error} -- cgit v1.2.3-70-g09d2