aboutsummaryrefslogtreecommitdiffstats
path: root/packages/mobile/app/dashboard.tsx
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-03-13 00:58:37 +0000
committerMohamedBassem <me@mbassem.com>2024-03-13 00:58:37 +0000
commitf1d86812e9a045b474f4a1c8cd3621fe17b8b806 (patch)
tree9464bade7a051e1da5b044ae1b7a17028f74f08b /packages/mobile/app/dashboard.tsx
parent94d87971e6f83fb46b6db3f30a0ca135d87ba2e2 (diff)
downloadkarakeep-f1d86812e9a045b474f4a1c8cd3621fe17b8b806.tar.zst
mobile: Introduce a tab layout and move the sharing page into a modal
Diffstat (limited to 'packages/mobile/app/dashboard.tsx')
-rw-r--r--packages/mobile/app/dashboard.tsx38
1 files changed, 0 insertions, 38 deletions
diff --git a/packages/mobile/app/dashboard.tsx b/packages/mobile/app/dashboard.tsx
deleted file mode 100644
index b4f535c5..00000000
--- a/packages/mobile/app/dashboard.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { useRouter } from "expo-router";
-import { useEffect } from "react";
-import { Text, View } from "react-native";
-
-import Logo from "@/components/Logo";
-import { Button } from "@/components/ui/Button";
-import { useSession } from "@/lib/session";
-import { api } from "@/lib/trpc";
-
-export default function Dashboard() {
- const router = useRouter();
-
- const { isLoggedIn, logout } = useSession();
-
- useEffect(() => {
- if (isLoggedIn !== undefined && !isLoggedIn) {
- router.replace("signin");
- }
- }, [isLoggedIn]);
-
- const { data, error, isLoading } = api.users.whoami.useQuery();
-
- useEffect(() => {
- if (error?.data?.code === "UNAUTHORIZED") {
- logout();
- }
- }, [error]);
-
- return (
- <View className="flex h-full items-center justify-center gap-4 px-4">
- <Logo />
- <Text className="justify-center">
- Logged in as: {isLoading ? "Loading ..." : data?.email}
- </Text>
- <Button label="Log Out" onPress={logout} />
- </View>
- );
-}