diff options
| author | MohamedBassem <me@mbassem.com> | 2024-03-13 22:37:41 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2024-03-14 16:40:45 +0000 |
| commit | a03f1dc2ac25579df30e8cb59d2703110c3e564d (patch) | |
| tree | 59315e73cd83dc391660071c70752cf23989b3da /apps/mobile/app | |
| parent | 04572a8e5081b1e4871e273cde9dbaaa44c52fe0 (diff) | |
| download | karakeep-a03f1dc2ac25579df30e8cb59d2703110c3e564d.tar.zst | |
lint: Lint and format the entire repo with the new configs
Diffstat (limited to 'apps/mobile/app')
| -rw-r--r-- | apps/mobile/app/_layout.tsx | 5 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/(tabs)/_layout.tsx | 2 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/(tabs)/index.tsx | 5 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/(tabs)/lists.tsx | 3 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/(tabs)/search.tsx | 5 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/(tabs)/settings.tsx | 3 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/add-link.tsx | 11 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/add-note.tsx | 11 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/archive.tsx | 1 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/favourites.tsx | 1 | ||||
| -rw-r--r-- | apps/mobile/app/dashboard/lists/[slug].tsx | 3 | ||||
| -rw-r--r-- | apps/mobile/app/error.tsx | 2 | ||||
| -rw-r--r-- | apps/mobile/app/index.tsx | 3 | ||||
| -rw-r--r-- | apps/mobile/app/sharing.tsx | 12 | ||||
| -rw-r--r-- | apps/mobile/app/signin.tsx | 5 |
15 files changed, 30 insertions, 42 deletions
diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsx index 6304ced5..b338af5e 100644 --- a/apps/mobile/app/_layout.tsx +++ b/apps/mobile/app/_layout.tsx @@ -1,13 +1,12 @@ import "@/globals.css"; import "expo-dev-client"; +import { useEffect } from "react"; +import { View } from "react-native"; import { useRouter } from "expo-router"; import { Stack } from "expo-router/stack"; import { useShareIntent } from "expo-share-intent"; import { StatusBar } from "expo-status-bar"; -import { useEffect } from "react"; -import { View } from "react-native"; - import { useLastSharedIntent } from "@/lib/last-shared-intent"; import { Providers } from "@/lib/providers"; diff --git a/apps/mobile/app/dashboard/(tabs)/_layout.tsx b/apps/mobile/app/dashboard/(tabs)/_layout.tsx index 5b2d810a..ce73a5c9 100644 --- a/apps/mobile/app/dashboard/(tabs)/_layout.tsx +++ b/apps/mobile/app/dashboard/(tabs)/_layout.tsx @@ -1,6 +1,6 @@ +import React from "react"; import { Tabs } from "expo-router"; import { ClipboardList, Home, Search, Settings } from "lucide-react-native"; -import React from "react"; export default function TabLayout() { return ( diff --git a/apps/mobile/app/dashboard/(tabs)/index.tsx b/apps/mobile/app/dashboard/(tabs)/index.tsx index b2349525..fe15956c 100644 --- a/apps/mobile/app/dashboard/(tabs)/index.tsx +++ b/apps/mobile/app/dashboard/(tabs)/index.tsx @@ -1,8 +1,7 @@ -import { Link, Stack } from "expo-router"; -import { SquarePen, Link as LinkIcon } from "lucide-react-native"; import { View } from "react-native"; - +import { Link, Stack } from "expo-router"; import BookmarkList from "@/components/bookmarks/BookmarkList"; +import { Link as LinkIcon, SquarePen } from "lucide-react-native"; function HeaderRight() { return ( diff --git a/apps/mobile/app/dashboard/(tabs)/lists.tsx b/apps/mobile/app/dashboard/(tabs)/lists.tsx index b534ddda..a293757b 100644 --- a/apps/mobile/app/dashboard/(tabs)/lists.tsx +++ b/apps/mobile/app/dashboard/(tabs)/lists.tsx @@ -1,7 +1,6 @@ -import { Link } from "expo-router"; import { useEffect, useState } from "react"; import { FlatList, View } from "react-native"; - +import { Link } from "expo-router"; import { api } from "@/lib/trpc"; export default function Lists() { diff --git a/apps/mobile/app/dashboard/(tabs)/search.tsx b/apps/mobile/app/dashboard/(tabs)/search.tsx index 980cab36..0025262e 100644 --- a/apps/mobile/app/dashboard/(tabs)/search.tsx +++ b/apps/mobile/app/dashboard/(tabs)/search.tsx @@ -1,12 +1,11 @@ -import { keepPreviousData } from "@tanstack/react-query"; import { useState } from "react"; import { View } from "react-native"; -import { useDebounce } from "use-debounce"; - import BookmarkList from "@/components/bookmarks/BookmarkList"; import { Divider } from "@/components/ui/Divider"; import { Input } from "@/components/ui/Input"; import { api } from "@/lib/trpc"; +import { keepPreviousData } from "@tanstack/react-query"; +import { useDebounce } from "use-debounce"; 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 9f86d5ec..81b21fc8 100644 --- a/apps/mobile/app/dashboard/(tabs)/settings.tsx +++ b/apps/mobile/app/dashboard/(tabs)/settings.tsx @@ -1,7 +1,6 @@ -import { useRouter } from "expo-router"; import { useEffect } from "react"; import { Text, View } from "react-native"; - +import { useRouter } from "expo-router"; import Logo from "@/components/Logo"; import { Button } from "@/components/ui/Button"; import { useSession } from "@/lib/session"; diff --git a/apps/mobile/app/dashboard/add-link.tsx b/apps/mobile/app/dashboard/add-link.tsx index 69a9c7a2..568a36b6 100644 --- a/apps/mobile/app/dashboard/add-link.tsx +++ b/apps/mobile/app/dashboard/add-link.tsx @@ -1,7 +1,6 @@ -import { useRouter } from "expo-router"; import { useState } from "react"; -import { View, Text } from "react-native"; - +import { Text, View } from "react-native"; +import { useRouter } from "expo-router"; import { Button } from "@/components/ui/Button"; import { Input } from "@/components/ui/Input"; import { api } from "@/lib/trpc"; @@ -24,9 +23,9 @@ export default function AddNote() { }, onError: (e) => { let message; - if (e.data?.code === "BAD_REQUEST") { - const error = JSON.parse(e.message)[0]; - message = error.message; + if (e.data?.zodError) { + const zodError = e.data.zodError; + message = JSON.stringify(zodError); } else { message = `Something went wrong: ${e.message}`; } diff --git a/apps/mobile/app/dashboard/add-note.tsx b/apps/mobile/app/dashboard/add-note.tsx index cf775a15..1f903e94 100644 --- a/apps/mobile/app/dashboard/add-note.tsx +++ b/apps/mobile/app/dashboard/add-note.tsx @@ -1,7 +1,6 @@ -import { useRouter } from "expo-router"; import { useState } from "react"; -import { View, Text } from "react-native"; - +import { Text, View } from "react-native"; +import { useRouter } from "expo-router"; import { Button } from "@/components/ui/Button"; import { Input } from "@/components/ui/Input"; import { api } from "@/lib/trpc"; @@ -24,9 +23,9 @@ export default function AddNote() { }, onError: (e) => { let message; - if (e.data?.code === "BAD_REQUEST") { - const error = JSON.parse(e.message)[0]; - message = error.message; + if (e.data?.zodError) { + const zodError = e.data.zodError; + message = JSON.stringify(zodError); } else { message = `Something went wrong: ${e.message}`; } diff --git a/apps/mobile/app/dashboard/archive.tsx b/apps/mobile/app/dashboard/archive.tsx index d75cfe22..2c559684 100644 --- a/apps/mobile/app/dashboard/archive.tsx +++ b/apps/mobile/app/dashboard/archive.tsx @@ -1,5 +1,4 @@ import { View } from "react-native"; - import BookmarkList from "@/components/bookmarks/BookmarkList"; export default function Archive() { diff --git a/apps/mobile/app/dashboard/favourites.tsx b/apps/mobile/app/dashboard/favourites.tsx index 90374f18..42a139f9 100644 --- a/apps/mobile/app/dashboard/favourites.tsx +++ b/apps/mobile/app/dashboard/favourites.tsx @@ -1,5 +1,4 @@ import { View } from "react-native"; - import BookmarkList from "@/components/bookmarks/BookmarkList"; export default function Favourites() { diff --git a/apps/mobile/app/dashboard/lists/[slug].tsx b/apps/mobile/app/dashboard/lists/[slug].tsx index 54744874..fdd67763 100644 --- a/apps/mobile/app/dashboard/lists/[slug].tsx +++ b/apps/mobile/app/dashboard/lists/[slug].tsx @@ -1,6 +1,5 @@ -import { useLocalSearchParams, Stack } from "expo-router"; import { View } from "react-native"; - +import { Stack, useLocalSearchParams } from "expo-router"; import BookmarkList from "@/components/bookmarks/BookmarkList"; import FullPageSpinner from "@/components/ui/FullPageSpinner"; import { api } from "@/lib/trpc"; diff --git a/apps/mobile/app/error.tsx b/apps/mobile/app/error.tsx index 2ca227a4..d0e4a7df 100644 --- a/apps/mobile/app/error.tsx +++ b/apps/mobile/app/error.tsx @@ -1,4 +1,4 @@ -import { View, Text } from "react-native"; +import { Text, View } from "react-native"; export default function ErrorPage() { return ( diff --git a/apps/mobile/app/index.tsx b/apps/mobile/app/index.tsx index 5ce20cda..f075fd6d 100644 --- a/apps/mobile/app/index.tsx +++ b/apps/mobile/app/index.tsx @@ -1,7 +1,6 @@ -import { useRouter } from "expo-router"; import { useEffect } from "react"; import { View } from "react-native"; - +import { useRouter } from "expo-router"; import { useSession } from "@/lib/session"; export default function App() { diff --git a/apps/mobile/app/sharing.tsx b/apps/mobile/app/sharing.tsx index 64bbd933..f9f423b5 100644 --- a/apps/mobile/app/sharing.tsx +++ b/apps/mobile/app/sharing.tsx @@ -1,10 +1,10 @@ -import { Link, useLocalSearchParams, useRouter } from "expo-router"; -import { ShareIntent, useShareIntent } from "expo-share-intent"; +import type { ShareIntent } from "expo-share-intent"; import { useEffect, useMemo, useState } from "react"; -import { View, Text } from "react-native"; -import { z } from "zod"; - +import { Text, View } from "react-native"; +import { Link, useLocalSearchParams, useRouter } from "expo-router"; +import { useShareIntent } from "expo-share-intent"; import { api } from "@/lib/trpc"; +import { z } from "zod"; type Mode = | { type: "idle" } @@ -18,7 +18,7 @@ function SaveBookmark({ setMode }: { setMode: (mode: Mode) => void }) { const params = useLocalSearchParams(); const shareIntent = useMemo(() => { - if (params && params.shareIntent) { + if (params?.shareIntent) { if (typeof params.shareIntent === "string") { return JSON.parse(params.shareIntent) as ShareIntent; } diff --git a/apps/mobile/app/signin.tsx b/apps/mobile/app/signin.tsx index a89b0087..63e48f22 100644 --- a/apps/mobile/app/signin.tsx +++ b/apps/mobile/app/signin.tsx @@ -1,7 +1,6 @@ -import { useRouter } from "expo-router"; import { useEffect, useState } from "react"; -import { View, Text } from "react-native"; - +import { Text, View } from "react-native"; +import { useRouter } from "expo-router"; import Logo from "@/components/Logo"; import { Button } from "@/components/ui/Button"; import { Input } from "@/components/ui/Input"; |
