From 3d5246ef967c0406e49821b0ca10ac2a5184bc04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Qu=E1=BB=91c=20Kh=C3=A1nh?= Date: Sun, 9 Jun 2024 14:20:10 +0700 Subject: [PATCH] chore(mobile): biome fixes --- apps/mobile/app/(app)/(tabs)/_layout.tsx | 20 +++-- apps/mobile/app/(app)/(tabs)/explore.tsx | 27 +++--- apps/mobile/app/(app)/(tabs)/index.tsx | 6 +- apps/mobile/app/(app)/_layout.tsx | 16 ++-- apps/mobile/app/(auth)/_layout.tsx | 16 ++-- apps/mobile/app/(auth)/login.tsx | 8 +- apps/mobile/app/+html.tsx | 15 ++-- apps/mobile/app/+not-found.tsx | 12 +-- apps/mobile/app/_layout.tsx | 55 +++++++----- apps/mobile/biome.json | 8 ++ apps/mobile/components/Avatar.tsx | 30 +++---- apps/mobile/components/Badge.tsx | 20 ++--- apps/mobile/components/Button.tsx | 24 +++--- apps/mobile/components/Card.tsx | 32 +++---- apps/mobile/components/Checkbox.tsx | 24 +++--- apps/mobile/components/Dialog.tsx | 43 +++++----- apps/mobile/components/DropDown.tsx | 79 +++++++++--------- apps/mobile/components/Input.tsx | 21 ++--- apps/mobile/components/ParallaxScrollView.tsx | 39 +++++---- apps/mobile/components/Progress.tsx | 18 ++-- apps/mobile/components/RadioGroup.tsx | 56 ++++++------- apps/mobile/components/Skeleton.tsx | 18 ++-- apps/mobile/components/Switch.tsx | 22 ++--- apps/mobile/components/Tabs.tsx | 50 +++++------ apps/mobile/components/Toast.tsx | 83 ++++++++++--------- .../components/__tests__/ThemedText-test.tsx | 11 ++- apps/mobile/components/auth/auth-email.tsx | 78 ++++++++++------- .../components/navigation/TabBarIcon.tsx | 13 +-- apps/mobile/constants/Colors.ts | 26 ------ apps/mobile/global.css | 14 ++-- apps/mobile/hooks/useColorScheme.ts | 2 +- apps/mobile/hooks/useColorScheme.web.ts | 2 +- apps/mobile/hooks/useThemeColor.ts | 22 ----- apps/mobile/lib/cache.ts | 23 +++-- apps/mobile/lib/client.ts | 18 ++-- apps/mobile/lib/theme.ts | 2 +- apps/mobile/lib/utils.ts | 6 +- apps/mobile/package.json | 3 +- biome.json | 2 +- 39 files changed, 489 insertions(+), 475 deletions(-) create mode 100644 apps/mobile/biome.json delete mode 100644 apps/mobile/constants/Colors.ts delete mode 100644 apps/mobile/hooks/useThemeColor.ts diff --git a/apps/mobile/app/(app)/(tabs)/_layout.tsx b/apps/mobile/app/(app)/(tabs)/_layout.tsx index a5cbb77a..db31e18c 100644 --- a/apps/mobile/app/(app)/(tabs)/_layout.tsx +++ b/apps/mobile/app/(app)/(tabs)/_layout.tsx @@ -1,7 +1,6 @@ -import { Tabs } from 'expo-router'; -import React from 'react'; +import { Tabs } from 'expo-router' -import { TabBarIcon } from '@/components/navigation/TabBarIcon'; +import { TabBarIcon } from '@/components/navigation/TabBarIcon' export default function TabLayout() { return ( @@ -9,13 +8,17 @@ export default function TabLayout() { screenOptions={{ // tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint, headerShown: false, - }}> + }} + > ( - + ), }} /> @@ -24,10 +27,13 @@ export default function TabLayout() { options={{ tabBarShowLabel: false, tabBarIcon: ({ color, focused }) => ( - + ), }} /> - ); + ) } diff --git a/apps/mobile/app/(app)/(tabs)/explore.tsx b/apps/mobile/app/(app)/(tabs)/explore.tsx index 54875a39..99144fdc 100644 --- a/apps/mobile/app/(app)/(tabs)/explore.tsx +++ b/apps/mobile/app/(app)/(tabs)/explore.tsx @@ -1,27 +1,26 @@ -import { Avatar, AvatarFallback, AvatarImage } from '@/components/Avatar'; -import { Button } from '@/components/Button'; -import { useAuth } from '@clerk/clerk-expo'; -import { ScrollView, Text, View } from 'react-native'; -import { getHonoClient } from '@/lib/client'; -import { useQuery } from '@tanstack/react-query'; +import { Avatar, AvatarFallback, AvatarImage } from '@/components/Avatar' +import { Button } from '@/components/Button' +import { getHonoClient } from '@/lib/client' +import { useAuth } from '@clerk/clerk-expo' +import { useQuery } from '@tanstack/react-query' +import { ScrollView, Text, View } from 'react-native' export default function TabTwoScreen() { - const { signOut } = useAuth(); + const { signOut } = useAuth() const { data } = useQuery({ queryKey: ['me'], queryFn: async () => { const hc = await getHonoClient() const res = await hc.v1.auth.me.$get() - if (res.ok) { - return await res.json() - } else { + if (!res.ok) { throw new Error(await res.text()) } + return await res.json() }, }) return ( - + SS - {data?.email ? `Logged as ${data.email}` : 'loading...'} + + {data?.email ? `Logged as ${data.email}` : 'loading...'} +