aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile/app
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-03-30 16:26:16 +0000
committerMohamedBassem <me@mbassem.com>2024-03-30 16:26:16 +0000
commit46b78eaac30be26fe40520e97786563344af8403 (patch)
treec4c0e1ae1d3d21a6f1fbf5f44f68e99243bbb5d3 /apps/mobile/app
parent853ed13450b3a0d92cba144cc0dfd0696e7c810c (diff)
downloadkarakeep-46b78eaac30be26fe40520e97786563344af8403.tar.zst
format: Add missing lint and format, and format the entire repo
Diffstat (limited to 'apps/mobile/app')
-rw-r--r--apps/mobile/app/dashboard/(tabs)/_layout.tsx4
-rw-r--r--apps/mobile/app/dashboard/(tabs)/index.tsx13
-rw-r--r--apps/mobile/app/dashboard/(tabs)/lists.tsx8
-rw-r--r--apps/mobile/app/dashboard/(tabs)/search.tsx2
-rw-r--r--apps/mobile/app/dashboard/(tabs)/settings.tsx2
-rw-r--r--apps/mobile/app/dashboard/archive.tsx7
-rw-r--r--apps/mobile/app/dashboard/favourites.tsx2
-rw-r--r--apps/mobile/app/dashboard/lists/[slug].tsx2
-rw-r--r--apps/mobile/app/dashboard/tags/[slug].tsx2
-rw-r--r--apps/mobile/app/index.tsx18
-rw-r--r--apps/mobile/app/signin.tsx4
11 files changed, 33 insertions, 31 deletions
diff --git a/apps/mobile/app/dashboard/(tabs)/_layout.tsx b/apps/mobile/app/dashboard/(tabs)/_layout.tsx
index fe40215e..7967b5c6 100644
--- a/apps/mobile/app/dashboard/(tabs)/_layout.tsx
+++ b/apps/mobile/app/dashboard/(tabs)/_layout.tsx
@@ -1,8 +1,8 @@
import React, { useEffect } from "react";
+import { Platform } from "react-native";
+import * as NavigationBar from "expo-navigation-bar";
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(() => {
diff --git a/apps/mobile/app/dashboard/(tabs)/index.tsx b/apps/mobile/app/dashboard/(tabs)/index.tsx
index 804eb0b5..5dccc845 100644
--- a/apps/mobile/app/dashboard/(tabs)/index.tsx
+++ b/apps/mobile/app/dashboard/(tabs)/index.tsx
@@ -3,21 +3,21 @@ import * as Haptics from "expo-haptics";
import * as ImagePicker from "expo-image-picker";
import { useRouter } from "expo-router";
import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList";
+import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
import PageTitle from "@/components/ui/PageTitle";
+import { useToast } from "@/components/ui/Toast";
import useAppSettings from "@/lib/settings";
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();
+ const { toast } = useToast();
const router = useRouter();
const { settings } = useAppSettings();
const { uploadAsset } = useUploadAsset(settings, {
onError: (e) => {
- toast({message: e, variant: "destructive"});
+ toast({ message: e, variant: "destructive" });
},
});
return (
@@ -69,7 +69,10 @@ function HeaderRight() {
shouldOpenOnLongPress={false}
>
<View className="my-auto px-4">
- <SquarePen color="rgb(0, 122, 255)" onPress={() => Haptics.selectionAsync()} />
+ <SquarePen
+ color="rgb(0, 122, 255)"
+ onPress={() => Haptics.selectionAsync()}
+ />
</View>
</MenuView>
);
diff --git a/apps/mobile/app/dashboard/(tabs)/lists.tsx b/apps/mobile/app/dashboard/(tabs)/lists.tsx
index 0350ebd2..767b9256 100644
--- a/apps/mobile/app/dashboard/(tabs)/lists.tsx
+++ b/apps/mobile/app/dashboard/(tabs)/lists.tsx
@@ -1,10 +1,10 @@
import { useEffect, useState } from "react";
import { FlatList, Pressable, Text, View } from "react-native";
import { Link } from "expo-router";
+import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
+import PageTitle from "@/components/ui/PageTitle";
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);
@@ -51,9 +51,7 @@ export default function Lists() {
return (
<CustomSafeAreaView>
<FlatList
- ListHeaderComponent={
- <PageTitle title="Lists" />
- }
+ ListHeaderComponent={<PageTitle title="Lists" />}
contentContainerStyle={{
gap: 5,
}}
diff --git a/apps/mobile/app/dashboard/(tabs)/search.tsx b/apps/mobile/app/dashboard/(tabs)/search.tsx
index bcaee5af..0a4dcbfd 100644
--- a/apps/mobile/app/dashboard/(tabs)/search.tsx
+++ b/apps/mobile/app/dashboard/(tabs)/search.tsx
@@ -1,13 +1,13 @@
import { useState } from "react";
import { View } from "react-native";
import BookmarkList from "@/components/bookmarks/BookmarkList";
+import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
import FullPageSpinner from "@/components/ui/FullPageSpinner";
import { Input } from "@/components/ui/Input";
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("");
diff --git a/apps/mobile/app/dashboard/(tabs)/settings.tsx b/apps/mobile/app/dashboard/(tabs)/settings.tsx
index 0dbf7da6..c2db2846 100644
--- a/apps/mobile/app/dashboard/(tabs)/settings.tsx
+++ b/apps/mobile/app/dashboard/(tabs)/settings.tsx
@@ -1,9 +1,9 @@
import { Text, View } from "react-native";
import { Button } from "@/components/ui/Button";
+import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
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();
diff --git a/apps/mobile/app/dashboard/archive.tsx b/apps/mobile/app/dashboard/archive.tsx
index e622a3e4..2fe5d274 100644
--- a/apps/mobile/app/dashboard/archive.tsx
+++ b/apps/mobile/app/dashboard/archive.tsx
@@ -1,11 +1,14 @@
import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList";
-import PageTitle from "@/components/ui/PageTitle";
import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
+import PageTitle from "@/components/ui/PageTitle";
export default function Archive() {
return (
<CustomSafeAreaView>
- <UpdatingBookmarkList query={{archived: true}} header={<PageTitle title="🗄️ Archive" />} />
+ <UpdatingBookmarkList
+ query={{ archived: true }}
+ header={<PageTitle title="🗄️ Archive" />}
+ />
</CustomSafeAreaView>
);
}
diff --git a/apps/mobile/app/dashboard/favourites.tsx b/apps/mobile/app/dashboard/favourites.tsx
index 213cc918..abda5cfa 100644
--- a/apps/mobile/app/dashboard/favourites.tsx
+++ b/apps/mobile/app/dashboard/favourites.tsx
@@ -1,6 +1,6 @@
import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList";
-import PageTitle from "@/components/ui/PageTitle";
import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
+import PageTitle from "@/components/ui/PageTitle";
export default function Favourites() {
return (
diff --git a/apps/mobile/app/dashboard/lists/[slug].tsx b/apps/mobile/app/dashboard/lists/[slug].tsx
index c0b86a0f..d42cc653 100644
--- a/apps/mobile/app/dashboard/lists/[slug].tsx
+++ b/apps/mobile/app/dashboard/lists/[slug].tsx
@@ -1,10 +1,10 @@
import { View } from "react-native";
import { Stack, useLocalSearchParams } from "expo-router";
import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList";
+import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
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();
diff --git a/apps/mobile/app/dashboard/tags/[slug].tsx b/apps/mobile/app/dashboard/tags/[slug].tsx
index 26aa47ec..ea1ef63d 100644
--- a/apps/mobile/app/dashboard/tags/[slug].tsx
+++ b/apps/mobile/app/dashboard/tags/[slug].tsx
@@ -1,10 +1,10 @@
import { View } from "react-native";
import { Stack, useLocalSearchParams } from "expo-router";
import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList";
+import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
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();
diff --git a/apps/mobile/app/index.tsx b/apps/mobile/app/index.tsx
index 235b19e4..dbbea97e 100644
--- a/apps/mobile/app/index.tsx
+++ b/apps/mobile/app/index.tsx
@@ -1,16 +1,16 @@
-import { useIsLoggedIn } from "@/lib/session";
import { Redirect } from "expo-router";
import FullPageSpinner from "@/components/ui/FullPageSpinner";
+import { useIsLoggedIn } from "@/lib/session";
export default function App() {
const isLoggedIn = useIsLoggedIn();
- if (isLoggedIn === undefined) {
- // Wait until it's loaded
- return <FullPageSpinner />;
- } else if (isLoggedIn) {
- return <Redirect href="dashboard" />
- } else {
- return <Redirect href="signin" />
- }
+ if (isLoggedIn === undefined) {
+ // Wait until it's loaded
+ return <FullPageSpinner />;
+ } else if (isLoggedIn) {
+ return <Redirect href="dashboard" />;
+ } else {
+ return <Redirect href="signin" />;
+ }
}
diff --git a/apps/mobile/app/signin.tsx b/apps/mobile/app/signin.tsx
index 2255424e..8402bd43 100644
--- a/apps/mobile/app/signin.tsx
+++ b/apps/mobile/app/signin.tsx
@@ -69,9 +69,7 @@ export default function Signin() {
value={settings.address}
autoCapitalize="none"
keyboardType="url"
- onChangeText={(e) =>
- setSettings({ ...settings, address: e })
- }
+ onChangeText={(e) => setSettings({ ...settings, address: e })}
/>
</View>
<View className="gap-2">