diff options
| author | MohamedBassem <me@mbassem.com> | 2024-03-29 14:17:36 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-03-29 14:17:36 +0000 |
| commit | 26b53e2ccc00befd182c4af05ab52fc439be7535 (patch) | |
| tree | 6697b977daecd0e43be15d9e34dd9f8cbf30472b /apps/mobile/app | |
| parent | 2cfb7cb27f3825b8c8656d8b8649bd22fa52bfbf (diff) | |
| download | karakeep-26b53e2ccc00befd182c4af05ab52fc439be7535.tar.zst | |
mobile(android): Getting the android app ready for submission
Diffstat (limited to 'apps/mobile/app')
| -rw-r--r-- | apps/mobile/app/_layout.tsx | 2 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/(tabs)/_layout.tsx | 9 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/(tabs)/index.tsx | 12 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/(tabs)/lists.tsx | 9 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/(tabs)/search.tsx | 7 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/(tabs)/settings.tsx | 7 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/_layout.tsx | 4 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/archive.tsx | 6 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/favourites.tsx | 6 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/lists/[slug].tsx | 7 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/tags/[slug].tsx | 7 |
11 files changed, 43 insertions, 33 deletions
diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsx index 9f8f8ad5..f36c9eec 100644 --- a/apps/mobile/app/_layout.tsx +++ b/apps/mobile/app/_layout.tsx @@ -24,7 +24,7 @@ export default function RootLayout() { return ( <ShareIntentProvider> <Providers> - <View className="h-full w-full bg-white"> + <View className="w-full flex-1 bg-background"> <Stack screenOptions={{ headerShown: false, diff --git a/apps/mobile/app/dashboard/(tabs)/_layout.tsx b/apps/mobile/app/dashboard/(tabs)/_layout.tsx index ac1a7e2b..fe40215e 100644 --- a/apps/mobile/app/dashboard/(tabs)/_layout.tsx +++ b/apps/mobile/app/dashboard/(tabs)/_layout.tsx @@ -1,8 +1,15 @@ -import React from "react"; +import React, { useEffect } from "react"; import { Tabs } from "expo-router"; import { ClipboardList, Home, Search, Settings } from "lucide-react-native"; +import { Platform } from "react-native"; +import * as NavigationBar from 'expo-navigation-bar'; export default function TabLayout() { + useEffect(() => { + if (Platform.OS == "android") { + NavigationBar.setBackgroundColorAsync("white"); + } + }, []); return ( <Tabs screenOptions={{ diff --git a/apps/mobile/app/dashboard/(tabs)/index.tsx b/apps/mobile/app/dashboard/(tabs)/index.tsx index 18fb804d..804eb0b5 100644 --- a/apps/mobile/app/dashboard/(tabs)/index.tsx +++ b/apps/mobile/app/dashboard/(tabs)/index.tsx @@ -1,4 +1,4 @@ -import { Platform, SafeAreaView, View } from "react-native"; +import { Platform, View } from "react-native"; import * as Haptics from "expo-haptics"; import * as ImagePicker from "expo-image-picker"; import { useRouter } from "expo-router"; @@ -9,6 +9,7 @@ import { useUploadAsset } from "@/lib/upload"; import { MenuView } from "@react-native-menu/menu"; import { SquarePen } from "lucide-react-native"; import { useToast } from "@/components/ui/Toast"; +import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView"; function HeaderRight() { const {toast} = useToast(); @@ -48,7 +49,6 @@ function HeaderRight() { title: "New Link", image: Platform.select({ ios: "link", - android: "ic_menu_link", }), }, { @@ -56,7 +56,6 @@ function HeaderRight() { title: "New Note", image: Platform.select({ ios: "note.text", - android: "ic_menu_note", }), }, { @@ -64,14 +63,13 @@ function HeaderRight() { title: "Photo Library", image: Platform.select({ ios: "photo", - android: "ic_menu_photo", }), }, ]} shouldOpenOnLongPress={false} > <View className="my-auto px-4"> - <SquarePen onPress={() => Haptics.selectionAsync()} /> + <SquarePen color="rgb(0, 122, 255)" onPress={() => Haptics.selectionAsync()} /> </View> </MenuView> ); @@ -79,7 +77,7 @@ function HeaderRight() { export default function Home() { return ( - <SafeAreaView> + <CustomSafeAreaView> <UpdatingBookmarkList query={{ archived: false }} header={ @@ -89,6 +87,6 @@ export default function Home() { </View> } /> - </SafeAreaView> + </CustomSafeAreaView> ); } diff --git a/apps/mobile/app/dashboard/(tabs)/lists.tsx b/apps/mobile/app/dashboard/(tabs)/lists.tsx index e0ed8489..0350ebd2 100644 --- a/apps/mobile/app/dashboard/(tabs)/lists.tsx +++ b/apps/mobile/app/dashboard/(tabs)/lists.tsx @@ -1,9 +1,10 @@ import { useEffect, useState } from "react"; -import { FlatList, Pressable, SafeAreaView, Text, View } from "react-native"; +import { FlatList, Pressable, Text, View } from "react-native"; import { Link } from "expo-router"; import { api } from "@/lib/trpc"; import { ChevronRight } from "lucide-react-native"; import PageTitle from "@/components/ui/PageTitle"; +import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView"; export default function Lists() { const [refreshing, setRefreshing] = useState(false); @@ -48,7 +49,7 @@ export default function Lists() { ); return ( - <SafeAreaView> + <CustomSafeAreaView> <FlatList ListHeaderComponent={ <PageTitle title="Lists" /> @@ -62,7 +63,7 @@ export default function Lists() { <Text className="text-lg"> {l.item.logo} {l.item.name} </Text> - <ChevronRight /> + <ChevronRight color="rgb(0, 122, 255)" /> </Pressable> </Link> )} @@ -70,6 +71,6 @@ export default function Lists() { refreshing={refreshing} onRefresh={onRefresh} /> - </SafeAreaView> + </CustomSafeAreaView> ); } diff --git a/apps/mobile/app/dashboard/(tabs)/search.tsx b/apps/mobile/app/dashboard/(tabs)/search.tsx index c1bb178b..bcaee5af 100644 --- a/apps/mobile/app/dashboard/(tabs)/search.tsx +++ b/apps/mobile/app/dashboard/(tabs)/search.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import { SafeAreaView, View } from "react-native"; +import { View } from "react-native"; import BookmarkList from "@/components/bookmarks/BookmarkList"; import FullPageSpinner from "@/components/ui/FullPageSpinner"; import { Input } from "@/components/ui/Input"; @@ -7,6 +7,7 @@ import PageTitle from "@/components/ui/PageTitle"; import { api } from "@/lib/trpc"; import { keepPreviousData } from "@tanstack/react-query"; import { useDebounce } from "use-debounce"; +import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView"; export default function Search() { const [search, setSearch] = useState(""); @@ -25,7 +26,7 @@ export default function Search() { } return ( - <SafeAreaView> + <CustomSafeAreaView> <BookmarkList bookmarks={data.bookmarks} header={ @@ -44,6 +45,6 @@ export default function Search() { onRefresh={onRefresh} isRefreshing={isPending} /> - </SafeAreaView> + </CustomSafeAreaView> ); } diff --git a/apps/mobile/app/dashboard/(tabs)/settings.tsx b/apps/mobile/app/dashboard/(tabs)/settings.tsx index f60c2495..0dbf7da6 100644 --- a/apps/mobile/app/dashboard/(tabs)/settings.tsx +++ b/apps/mobile/app/dashboard/(tabs)/settings.tsx @@ -1,8 +1,9 @@ -import { SafeAreaView, Text, View } from "react-native"; +import { Text, View } from "react-native"; import { Button } from "@/components/ui/Button"; import PageTitle from "@/components/ui/PageTitle"; import { useSession } from "@/lib/session"; import { api } from "@/lib/trpc"; +import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView"; export default function Dashboard() { const { logout } = useSession(); @@ -14,7 +15,7 @@ export default function Dashboard() { } return ( - <SafeAreaView> + <CustomSafeAreaView> <PageTitle title="Settings" /> <View className="flex h-full w-full items-center gap-4 px-4 py-2"> <View className="w-full rounded-lg bg-white px-4 py-2"> @@ -25,6 +26,6 @@ export default function Dashboard() { <Button className="w-full" label="Log Out" onPress={logout} /> </View> - </SafeAreaView> + </CustomSafeAreaView> ); } diff --git a/apps/mobile/app/dashboard/_layout.tsx b/apps/mobile/app/dashboard/_layout.tsx index ef04fcd1..f1bb66d7 100644 --- a/apps/mobile/app/dashboard/_layout.tsx +++ b/apps/mobile/app/dashboard/_layout.tsx @@ -1,7 +1,7 @@ -import { useIsLoggedIn } from "@/lib/session"; +import { useEffect } from "react"; import { useRouter } from "expo-router"; import { Stack } from "expo-router/stack"; -import { useEffect } from "react"; +import { useIsLoggedIn } from "@/lib/session"; export default function Dashboard() { const router = useRouter(); diff --git a/apps/mobile/app/dashboard/archive.tsx b/apps/mobile/app/dashboard/archive.tsx index 93841b9d..e622a3e4 100644 --- a/apps/mobile/app/dashboard/archive.tsx +++ b/apps/mobile/app/dashboard/archive.tsx @@ -1,11 +1,11 @@ -import { SafeAreaView } from "react-native"; import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList"; import PageTitle from "@/components/ui/PageTitle"; +import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView"; export default function Archive() { return ( - <SafeAreaView> + <CustomSafeAreaView> <UpdatingBookmarkList query={{archived: true}} header={<PageTitle title="🗄️ Archive" />} /> - </SafeAreaView> + </CustomSafeAreaView> ); } diff --git a/apps/mobile/app/dashboard/favourites.tsx b/apps/mobile/app/dashboard/favourites.tsx index aebf3885..213cc918 100644 --- a/apps/mobile/app/dashboard/favourites.tsx +++ b/apps/mobile/app/dashboard/favourites.tsx @@ -1,10 +1,10 @@ -import { SafeAreaView } from "react-native"; import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList"; import PageTitle from "@/components/ui/PageTitle"; +import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView"; export default function Favourites() { return ( - <SafeAreaView> + <CustomSafeAreaView> <UpdatingBookmarkList query={{ archived: false, @@ -12,6 +12,6 @@ export default function Favourites() { }} header={<PageTitle title="⭐️ Favourites" />} /> - </SafeAreaView> + </CustomSafeAreaView> ); } diff --git a/apps/mobile/app/dashboard/lists/[slug].tsx b/apps/mobile/app/dashboard/lists/[slug].tsx index 2bb5d602..c0b86a0f 100644 --- a/apps/mobile/app/dashboard/lists/[slug].tsx +++ b/apps/mobile/app/dashboard/lists/[slug].tsx @@ -1,9 +1,10 @@ -import { SafeAreaView, View } from "react-native"; +import { View } from "react-native"; import { Stack, useLocalSearchParams } from "expo-router"; import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList"; import FullPageSpinner from "@/components/ui/FullPageSpinner"; import PageTitle from "@/components/ui/PageTitle"; import { api } from "@/lib/trpc"; +import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView"; export default function ListView() { const { slug } = useLocalSearchParams(); @@ -13,7 +14,7 @@ export default function ListView() { const { data: list } = api.lists.get.useQuery({ listId: slug }); return ( - <SafeAreaView> + <CustomSafeAreaView> <Stack.Screen options={{ headerTitle: "", @@ -34,6 +35,6 @@ export default function ListView() { ) : ( <FullPageSpinner /> )} - </SafeAreaView> + </CustomSafeAreaView> ); } diff --git a/apps/mobile/app/dashboard/tags/[slug].tsx b/apps/mobile/app/dashboard/tags/[slug].tsx index 52c06129..26aa47ec 100644 --- a/apps/mobile/app/dashboard/tags/[slug].tsx +++ b/apps/mobile/app/dashboard/tags/[slug].tsx @@ -1,9 +1,10 @@ -import { SafeAreaView, View } from "react-native"; +import { View } from "react-native"; import { Stack, useLocalSearchParams } from "expo-router"; import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList"; import FullPageSpinner from "@/components/ui/FullPageSpinner"; import PageTitle from "@/components/ui/PageTitle"; import { api } from "@/lib/trpc"; +import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView"; export default function TagView() { const { slug } = useLocalSearchParams(); @@ -14,7 +15,7 @@ export default function TagView() { const { data: tag } = api.tags.get.useQuery({ tagId: slug }); return ( - <SafeAreaView> + <CustomSafeAreaView> <Stack.Screen options={{ headerTitle: "", @@ -35,6 +36,6 @@ export default function TagView() { ) : ( <FullPageSpinner /> )} - </SafeAreaView> + </CustomSafeAreaView> ); } |
