diff --git a/apps/mobile/app/(app)/(tabs)/_layout.tsx b/apps/mobile/app/(app)/(tabs)/_layout.tsx index 4cde6049..f534b150 100644 --- a/apps/mobile/app/(app)/(tabs)/_layout.tsx +++ b/apps/mobile/app/(app)/(tabs)/_layout.tsx @@ -3,7 +3,12 @@ import { theme } from '@/lib/theme' import { t } from '@lingui/macro' import { useLingui } from '@lingui/react' import { Tabs } from 'expo-router' -import { CogIcon, LandPlotIcon, ScanTextIcon, WalletIcon } from 'lucide-react-native' +import { + CogIcon, + LandPlotIcon, + ScanTextIcon, + WalletIcon, +} from 'lucide-react-native' export default function TabLayout() { const { colorScheme } = useColorScheme() @@ -25,7 +30,7 @@ export default function TabLayout() { }, headerStyle: { backgroundColor: theme[colorScheme ?? 'light'].background, - } + }, }} > ( - ) + ), }) }, []) @@ -90,12 +96,13 @@ export default function EditAccountScreen() { > { - const adjustedBalance = (balance ?? 0) - ((walletAccount.balance as number) ?? 0) + const adjustedBalance = + (balance ?? 0) - ((walletAccount.balance as number) ?? 0) mutateUpdate({ id: walletId as string, data: { ...data, - balance: adjustedBalance + balance: adjustedBalance, }, }) }} diff --git a/apps/mobile/app/(app)/wallet/accounts.tsx b/apps/mobile/app/(app)/wallet/accounts.tsx index 6923a611..cfc44b4d 100644 --- a/apps/mobile/app/(app)/wallet/accounts.tsx +++ b/apps/mobile/app/(app)/wallet/accounts.tsx @@ -36,9 +36,9 @@ export default function WalletAccountsScreen() { ListEmptyComponent={ isLoading ? ( <> - - - + + + ) : ( diff --git a/apps/mobile/app/(auth)/login.tsx b/apps/mobile/app/(auth)/login.tsx index e0c144b3..ba76521a 100644 --- a/apps/mobile/app/(auth)/login.tsx +++ b/apps/mobile/app/(auth)/login.tsx @@ -25,7 +25,7 @@ export default function LoginScreen() { keyboardShouldPersistTaps="handled" > - + Manage your expense seamlessly @@ -38,10 +38,7 @@ export default function LoginScreen() { - diff --git a/apps/mobile/app/(aux)/privacy-policy.tsx b/apps/mobile/app/(aux)/privacy-policy.tsx index 892d77b3..cb4ee990 100644 --- a/apps/mobile/app/(aux)/privacy-policy.tsx +++ b/apps/mobile/app/(aux)/privacy-policy.tsx @@ -3,7 +3,13 @@ import { Text } from 'react-native' export default function PrivacyScreen() { return ( - lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim + veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea + commodo consequat. Duis aute irure dolor in reprehenderit in voluptate + velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat + cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id + est laborum. ) } diff --git a/apps/mobile/app/(aux)/terms-of-service.tsx b/apps/mobile/app/(aux)/terms-of-service.tsx index 38ad72e8..166f4990 100644 --- a/apps/mobile/app/(aux)/terms-of-service.tsx +++ b/apps/mobile/app/(aux)/terms-of-service.tsx @@ -3,7 +3,13 @@ import { Text } from 'react-native' export default function TermsScreen() { return ( - lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim + veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea + commodo consequat. Duis aute irure dolor in reprehenderit in voluptate + velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat + cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id + est laborum. ) } diff --git a/apps/mobile/components/auth/emailSchema.tsx b/apps/mobile/components/auth/emailSchema.tsx index a368cfca..6a5c3b4c 100644 --- a/apps/mobile/components/auth/emailSchema.tsx +++ b/apps/mobile/components/auth/emailSchema.tsx @@ -1,13 +1,16 @@ -import * as z from 'zod'; +import * as z from 'zod' export const emailFormSchema = z.object({ - emailAddress: z.string().email().min(1, { message: 'Input your email address' }), -}); + emailAddress: z + .string() + .email() + .min(1, { message: 'Input your email address' }), +}) -export type EmailFormValues = z.infer; +export type EmailFormValues = z.infer export const verifyEmailFormSchema = z.object({ code: z.string().min(1, { message: 'Input the verification code' }), -}); +}) -export type VerifyEmailFormValues = z.infer; +export type VerifyEmailFormValues = z.infer diff --git a/apps/mobile/components/common/add-new-button.tsx b/apps/mobile/components/common/add-new-button.tsx index d3ff8593..7680adc3 100644 --- a/apps/mobile/components/common/add-new-button.tsx +++ b/apps/mobile/components/common/add-new-button.tsx @@ -1,7 +1,7 @@ -import { cn } from "@/lib/utils" -import { PlusCircleIcon } from "lucide-react-native" -import { Button } from "../ui/button" -import { Text } from "../ui/text" +import { cn } from '@/lib/utils' +import { PlusCircleIcon } from 'lucide-react-native' +import { Button } from '../ui/button' +import { Text } from '../ui/text' type AddNewButtonProps = { label: string @@ -9,18 +9,18 @@ type AddNewButtonProps = { onPress?: () => void } -export function AddNewButton( - { label, className, onPress }: AddNewButtonProps, -) { +export function AddNewButton({ label, className, onPress }: AddNewButtonProps) { return ( - ) -} \ No newline at end of file +} diff --git a/apps/mobile/components/common/back-button.tsx b/apps/mobile/components/common/back-button.tsx index 9d72bb18..b2e6668e 100644 --- a/apps/mobile/components/common/back-button.tsx +++ b/apps/mobile/components/common/back-button.tsx @@ -1,6 +1,6 @@ -import { useRouter } from "expo-router"; -import { ArrowLeftIcon } from "lucide-react-native"; -import { Button } from "../ui/button"; +import { useRouter } from 'expo-router' +import { ArrowLeftIcon } from 'lucide-react-native' +import { Button } from '../ui/button' export function BackButton() { const router = useRouter() @@ -8,8 +8,8 @@ export function BackButton() { return null } return ( - ) -} \ No newline at end of file +} diff --git a/apps/mobile/components/common/currency-sheet.tsx b/apps/mobile/components/common/currency-sheet.tsx index 6b216866..8a323108 100644 --- a/apps/mobile/components/common/currency-sheet.tsx +++ b/apps/mobile/components/common/currency-sheet.tsx @@ -1,16 +1,16 @@ -import { currencies } from "@6pm/currency"; -import { BottomSheetFlatList, BottomSheetTextInput } from "@gorhom/bottom-sheet"; -import { t } from "@lingui/macro"; -import { useLingui } from "@lingui/react"; -import { SearchIcon } from "lucide-react-native"; -import { useState } from "react"; -import { View } from "react-native"; -import { Text } from "../ui/text"; -import { MenuItem } from "./menu-item"; +import { currencies } from '@6pm/currency' +import { BottomSheetFlatList, BottomSheetTextInput } from '@gorhom/bottom-sheet' +import { t } from '@lingui/macro' +import { useLingui } from '@lingui/react' +import { SearchIcon } from 'lucide-react-native' +import { useState } from 'react' +import { View } from 'react-native' +import { Text } from '../ui/text' +import { MenuItem } from './menu-item' type CurrencySheetListProps = { - onSelect: (currency: typeof currencies[number]) => void; - value: string; + onSelect: (currency: (typeof currencies)[number]) => void + value: string } export function CurrencySheetList({ onSelect, value }: CurrencySheetListProps) { @@ -19,7 +19,10 @@ export function CurrencySheetList({ onSelect, value }: CurrencySheetListProps) { const filteredCurrencies = currencies.filter((currency) => { const search = searchValue.toLowerCase() - return currency.name.toLowerCase().includes(search) || currency.code.toLowerCase().includes(search) + return ( + currency.name.toLowerCase().includes(search) || + currency.code.toLowerCase().includes(search) + ) }) return ( @@ -36,7 +39,7 @@ export function CurrencySheetList({ onSelect, value }: CurrencySheetListProps) { @@ -47,11 +50,7 @@ export function CurrencySheetList({ onSelect, value }: CurrencySheetListProps) { label={item.name} onPress={() => onSelect(item)} className={item.code === value ? 'bg-muted' : ''} - rightSection={ - - {item.code} - - } + rightSection={{item.code}} /> )} /> diff --git a/apps/mobile/components/common/generic-icon.tsx b/apps/mobile/components/common/generic-icon.tsx index 6c017623..fbbe1ae9 100644 --- a/apps/mobile/components/common/generic-icon.tsx +++ b/apps/mobile/components/common/generic-icon.tsx @@ -2,8 +2,8 @@ import { type LucideProps, icons } from 'lucide-react-native' import type { FC } from 'react' /** -* TODO: Only export the icons that are used to reduce the bundle size -*/ + * TODO: Only export the icons that are used to reduce the bundle size + */ const GenericIcon: FC< LucideProps & { diff --git a/apps/mobile/components/common/logo.tsx b/apps/mobile/components/common/logo.tsx index b4f910b7..cd306d61 100644 --- a/apps/mobile/components/common/logo.tsx +++ b/apps/mobile/components/common/logo.tsx @@ -1,10 +1,7 @@ import Svg, { type SvgProps, Path } from 'react-native-svg' export const Logo = (props: SvgProps) => ( - + >, ) { return ( @@ -23,8 +30,8 @@ export const MenuItem = forwardRef(function( ref={ref} disabled={disabled} className={cn( - "flex flex-row items-center gap-4 px-6 justify-between h-14 active:bg-muted", - disabled && "opacity-50", + 'flex flex-row items-center gap-4 px-6 justify-between h-14 active:bg-muted', + disabled && 'opacity-50', className, )} > diff --git a/apps/mobile/components/common/toolbar.tsx b/apps/mobile/components/common/toolbar.tsx index f7dd1bd7..8ed426e9 100644 --- a/apps/mobile/components/common/toolbar.tsx +++ b/apps/mobile/components/common/toolbar.tsx @@ -10,20 +10,20 @@ export function Toolbar() { const { i18n } = useLingui() return ( - + - diff --git a/apps/mobile/components/home/header.tsx b/apps/mobile/components/home/header.tsx index d5f703b7..cd09c439 100644 --- a/apps/mobile/components/home/header.tsx +++ b/apps/mobile/components/home/header.tsx @@ -1,10 +1,10 @@ -import { useUser } from "@clerk/clerk-expo"; -import { t } from "@lingui/macro"; -import { useLingui } from "@lingui/react"; -import { ArrowDownUp, Bell } from "lucide-react-native"; -import { Text, TouchableOpacity, View } from "react-native"; -import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar"; -import { Button } from "../ui/button"; +import { useUser } from '@clerk/clerk-expo' +import { t } from '@lingui/macro' +import { useLingui } from '@lingui/react' +import { ArrowDownUp, Bell } from 'lucide-react-native' +import { Text, TouchableOpacity, View } from 'react-native' +import { Avatar, AvatarFallback, AvatarImage } from '../ui/avatar' +import { Button } from '../ui/button' export function HomeHeader() { const { user } = useUser() @@ -13,7 +13,7 @@ export function HomeHeader() { return ( - + {user?.fullName ?? user?.primaryEmailAddress?.emailAddress} - + {t(i18n)`All Accounts`} @@ -33,9 +36,9 @@ export function HomeHeader() { - ) -} \ No newline at end of file +} diff --git a/apps/mobile/components/primitives/label/label.tsx b/apps/mobile/components/primitives/label/label.tsx index 88faef36..b872e66b 100644 --- a/apps/mobile/components/primitives/label/label.tsx +++ b/apps/mobile/components/primitives/label/label.tsx @@ -1,31 +1,32 @@ -import * as Slot from '@/components/primitives/slot'; +import * as Slot from '@/components/primitives/slot' import type { PressableRef, SlottablePressableProps, SlottableTextProps, TextRef, -} from '@/components/primitives/types'; -import * as React from 'react'; -import { Pressable, Text as RNText } from 'react-native'; -import type { LabelRootProps, LabelTextProps } from './types'; +} from '@/components/primitives/types' +import * as React from 'react' +import { Pressable, Text as RNText } from 'react-native' +import type { LabelRootProps, LabelTextProps } from './types' const Root = React.forwardRef< PressableRef, - Omit & LabelRootProps + Omit & + LabelRootProps >(({ asChild, ...props }, ref) => { - const Component = asChild ? Slot.Pressable : Pressable; - return ; -}); + const Component = asChild ? Slot.Pressable : Pressable + return +}) -Root.displayName = 'RootNativeLabel'; +Root.displayName = 'RootNativeLabel' const Text = React.forwardRef( ({ asChild, ...props }, ref) => { - const Component = asChild ? Slot.Text : RNText; - return ; - } -); + const Component = asChild ? Slot.Text : RNText + return + }, +) -Text.displayName = 'TextNativeLabel'; +Text.displayName = 'TextNativeLabel' -export { Root, Text }; \ No newline at end of file +export { Root, Text } diff --git a/apps/mobile/components/primitives/label/label.web.tsx b/apps/mobile/components/primitives/label/label.web.tsx index 5fed2364..025fa26c 100644 --- a/apps/mobile/components/primitives/label/label.web.tsx +++ b/apps/mobile/components/primitives/label/label.web.tsx @@ -1,36 +1,37 @@ -import * as Slot from '@/components/primitives/slot'; +import * as Slot from '@/components/primitives/slot' import type { PressableRef, SlottablePressableProps, SlottableTextProps, TextRef, -} from '@/components/primitives/types'; -import * as Label from '@radix-ui/react-label'; -import * as React from 'react'; -import { Text as RNText } from 'react-native'; -import type { LabelRootProps, LabelTextProps } from './types'; +} from '@/components/primitives/types' +import * as Label from '@radix-ui/react-label' +import * as React from 'react' +import { Text as RNText } from 'react-native' +import type { LabelRootProps, LabelTextProps } from './types' const Root = React.forwardRef< PressableRef, - Omit & LabelRootProps + Omit & + LabelRootProps >(({ asChild, ...props }, ref) => { - const Component = asChild ? Slot.View : Slot.View; - return ; -}); + const Component = asChild ? Slot.View : Slot.View + return +}) -Root.displayName = 'RootWebLabel'; +Root.displayName = 'RootWebLabel' const Text = React.forwardRef( ({ asChild, nativeID, ...props }, ref) => { - const Component = asChild ? Slot.Text : RNText; + const Component = asChild ? Slot.Text : RNText return ( - ); - } -); + ) + }, +) -Text.displayName = 'TextWebLabel'; +Text.displayName = 'TextWebLabel' -export { Root, Text }; \ No newline at end of file +export { Root, Text } diff --git a/apps/mobile/components/primitives/separator/index.tsx b/apps/mobile/components/primitives/separator/index.tsx index f1f16ce1..9b3596a5 100644 --- a/apps/mobile/components/primitives/separator/index.tsx +++ b/apps/mobile/components/primitives/separator/index.tsx @@ -1,12 +1,12 @@ -import * as Slot from '@/components/primitives/slot'; -import type { SlottableViewProps, ViewRef } from '@/components/primitives/types'; -import * as React from 'react'; -import { View } from 'react-native'; -import type { SeparatorRootProps } from './types'; +import * as Slot from '@/components/primitives/slot' +import type { SlottableViewProps, ViewRef } from '@/components/primitives/types' +import * as React from 'react' +import { View } from 'react-native' +import type { SeparatorRootProps } from './types' const Root = React.forwardRef( ({ asChild, decorative, orientation = 'horizontal', ...props }, ref) => { - const Component = asChild ? Slot.View : View; + const Component = asChild ? Slot.View : View return ( ( ref={ref} {...props} /> - ); - } -); + ) + }, +) -Root.displayName = 'RootSeparator'; +Root.displayName = 'RootSeparator' -export { Root }; +export { Root } diff --git a/apps/mobile/components/primitives/slot.tsx b/apps/mobile/components/primitives/slot.tsx index 6c6dcf60..7c4dee50 100644 --- a/apps/mobile/components/primitives/slot.tsx +++ b/apps/mobile/components/primitives/slot.tsx @@ -32,10 +32,10 @@ const Pressable = React.forwardRef< >(isTextChildren(children) ? <> : children, { ...mergeProps(pressableSlotProps, children.props), ref: forwardedRef - // biome-ignore lint/suspicious/noExplicitAny: - ? composeRefs(forwardedRef, (children as any).ref) - // biome-ignore lint/suspicious/noExplicitAny: - : (children as any).ref, + ? // biome-ignore lint/suspicious/noExplicitAny: + composeRefs(forwardedRef, (children as any).ref) + : // biome-ignore lint/suspicious/noExplicitAny: + (children as any).ref, }) }) @@ -57,10 +57,10 @@ const View = React.forwardRef, RNViewProps>( >(isTextChildren(children) ? <> : children, { ...mergeProps(viewSlotProps, children.props), ref: forwardedRef - // biome-ignore lint/suspicious/noExplicitAny: - ? composeRefs(forwardedRef, (children as any).ref) - // biome-ignore lint/suspicious/noExplicitAny: - : (children as any).ref, + ? // biome-ignore lint/suspicious/noExplicitAny: + composeRefs(forwardedRef, (children as any).ref) + : // biome-ignore lint/suspicious/noExplicitAny: + (children as any).ref, }) }, ) @@ -83,10 +83,10 @@ const Text = React.forwardRef, RNTextProps>( >(isTextChildren(children) ? <> : children, { ...mergeProps(textSlotProps, children.props), ref: forwardedRef - // biome-ignore lint/suspicious/noExplicitAny: - ? composeRefs(forwardedRef, (children as any).ref) - // biome-ignore lint/suspicious/noExplicitAny: - : (children as any).ref, + ? // biome-ignore lint/suspicious/noExplicitAny: + composeRefs(forwardedRef, (children as any).ref) + : // biome-ignore lint/suspicious/noExplicitAny: + (children as any).ref, }) }, ) @@ -115,10 +115,10 @@ const Image = React.forwardRef< >(isTextChildren(children) ? <> : children, { ...mergeProps(imageSlotProps, children.props), ref: forwardedRef - // biome-ignore lint/suspicious/noExplicitAny: - ? composeRefs(forwardedRef, (children as any).ref) - // biome-ignore lint/suspicious/noExplicitAny: - : (children as any).ref, + ? // biome-ignore lint/suspicious/noExplicitAny: + composeRefs(forwardedRef, (children as any).ref) + : // biome-ignore lint/suspicious/noExplicitAny: + (children as any).ref, }) }) @@ -136,7 +136,7 @@ function composeRefs(...refs: (React.Ref | undefined)[]) { if (typeof ref === 'function') { ref(node) } else if (ref != null) { - ; (ref as React.MutableRefObject).current = node + ;(ref as React.MutableRefObject).current = node } }) } diff --git a/apps/mobile/components/primitives/switch/index.ts b/apps/mobile/components/primitives/switch/index.ts index 4dd22567..ccfa3133 100644 --- a/apps/mobile/components/primitives/switch/index.ts +++ b/apps/mobile/components/primitives/switch/index.ts @@ -1 +1 @@ -export * from './switch'; +export * from './switch' diff --git a/apps/mobile/components/primitives/switch/switch.tsx b/apps/mobile/components/primitives/switch/switch.tsx index 808f7971..9f0c7e90 100644 --- a/apps/mobile/components/primitives/switch/switch.tsx +++ b/apps/mobile/components/primitives/switch/switch.tsx @@ -1,13 +1,13 @@ -import * as Slot from '@/components/primitives/slot'; +import * as Slot from '@/components/primitives/slot' import type { PressableRef, SlottablePressableProps, SlottableViewProps, ViewRef, -} from '@/components/primitives/types'; -import * as React from 'react'; -import { type GestureResponderEvent, Pressable, View } from 'react-native'; -import type { SwitchRootProps } from './types'; +} from '@/components/primitives/types' +import * as React from 'react' +import { type GestureResponderEvent, Pressable, View } from 'react-native' +import type { SwitchRootProps } from './types' const Root = React.forwardRef< PressableRef, @@ -23,20 +23,22 @@ const Root = React.forwardRef< 'aria-valuetext': ariaValueText, ...props }, - ref + ref, ) => { function onPress(ev: GestureResponderEvent) { - if (disabled) { return }; - onCheckedChange(!checked); - onPressProp?.(ev); + if (disabled) { + return + } + onCheckedChange(!checked) + onPressProp?.(ev) } - const Component = asChild ? Slot.Pressable : Pressable; + const Component = asChild ? Slot.Pressable : Pressable return ( - ); - } -); + ) + }, +) -Root.displayName = 'RootNativeSwitch'; +Root.displayName = 'RootNativeSwitch' const Thumb = React.forwardRef( ({ asChild, ...props }, ref) => { - const Component = asChild ? Slot.View : View; - return ; - } -); + const Component = asChild ? Slot.View : View + return + }, +) -Thumb.displayName = 'ThumbNativeSwitch'; +Thumb.displayName = 'ThumbNativeSwitch' -export { Root, Thumb }; +export { Root, Thumb } diff --git a/apps/mobile/components/primitives/switch/switch.web.tsx b/apps/mobile/components/primitives/switch/switch.web.tsx index 09c9c4fa..3d1bae6d 100644 --- a/apps/mobile/components/primitives/switch/switch.web.tsx +++ b/apps/mobile/components/primitives/switch/switch.web.tsx @@ -1,16 +1,19 @@ -import * as Switch from '@radix-ui/react-switch'; -import * as React from 'react'; -import { Pressable, View, type GestureResponderEvent } from 'react-native'; -import * as Slot from '@/components/primitives/slot'; +import * as Slot from '@/components/primitives/slot' import type { PressableRef, SlottablePressableProps, SlottableViewProps, ViewRef, -} from '@/components/primitives/types'; -import type { SwitchRootProps } from './types'; +} from '@/components/primitives/types' +import * as Switch from '@radix-ui/react-switch' +import * as React from 'react' +import { type GestureResponderEvent, Pressable, View } from 'react-native' +import type { SwitchRootProps } from './types' -const Root = React.forwardRef( +const Root = React.forwardRef< + PressableRef, + SlottablePressableProps & SwitchRootProps +>( ( { asChild, @@ -21,23 +24,28 @@ const Root = React.forwardRef { function onPress(ev: GestureResponderEvent) { - onCheckedChange(!checked); - onPressProp?.(ev); + onCheckedChange(!checked) + onPressProp?.(ev) } function onKeyDown(ev: React.KeyboardEvent) { - onKeyDownProp?.(ev); + onKeyDownProp?.(ev) if (ev.key === ' ') { - onCheckedChange(!checked); + onCheckedChange(!checked) } } - const Component = asChild ? Slot.Pressable : Pressable; + const Component = asChild ? Slot.Pressable : Pressable return ( - + - ); - } -); + ) + }, +) -Root.displayName = 'RootWebSwitch'; +Root.displayName = 'RootWebSwitch' -const Thumb = React.forwardRef(({ asChild, ...props }, ref) => { - const Component = asChild ? Slot.View : View; - return ( - - - - ); -}); +const Thumb = React.forwardRef( + ({ asChild, ...props }, ref) => { + const Component = asChild ? Slot.View : View + return ( + + + + ) + }, +) -Thumb.displayName = 'ThumbWebSwitch'; +Thumb.displayName = 'ThumbWebSwitch' -export { Root, Thumb }; +export { Root, Thumb } diff --git a/apps/mobile/components/primitives/switch/types.ts b/apps/mobile/components/primitives/switch/types.ts index 986c2049..ec5c3872 100644 --- a/apps/mobile/components/primitives/switch/types.ts +++ b/apps/mobile/components/primitives/switch/types.ts @@ -1,11 +1,11 @@ interface SwitchRootProps { - checked: boolean; - onCheckedChange: (checked: boolean) => void; - disabled?: boolean; + checked: boolean + onCheckedChange: (checked: boolean) => void + disabled?: boolean /** * Platform: WEB ONLY */ - onKeyDown?: (ev: React.KeyboardEvent) => void; + onKeyDown?: (ev: React.KeyboardEvent) => void } -export type { SwitchRootProps }; +export type { SwitchRootProps } diff --git a/apps/mobile/components/primitives/tabs/tabs.tsx b/apps/mobile/components/primitives/tabs/tabs.tsx index 31dad9f3..41a23162 100644 --- a/apps/mobile/components/primitives/tabs/tabs.tsx +++ b/apps/mobile/components/primitives/tabs/tabs.tsx @@ -79,7 +79,9 @@ const Trigger = React.forwardRef< const { onValueChange, value: rootValue, nativeID } = useRootContext() function onPress(ev: GestureResponderEvent) { - if (disabled) { return } + if (disabled) { + return + } onValueChange(tabValue) onPressProp?.(ev) } diff --git a/apps/mobile/components/primitives/tabs/tabs.web.tsx b/apps/mobile/components/primitives/tabs/tabs.web.tsx index 9dd12606..038350e6 100644 --- a/apps/mobile/components/primitives/tabs/tabs.web.tsx +++ b/apps/mobile/components/primitives/tabs/tabs.web.tsx @@ -1,14 +1,29 @@ -import * as Slot from '@/components/primitives/slot'; -import type { ComponentPropsWithAsChild, SlottableViewProps, ViewRef } from '@/components/primitives/types'; -import * as Tabs from '@radix-ui/react-tabs'; -import * as React from 'react'; -import { Pressable, View } from 'react-native'; -import type { TabsContentProps, TabsRootProps } from './types'; +import * as Slot from '@/components/primitives/slot' +import type { + ComponentPropsWithAsChild, + SlottableViewProps, + ViewRef, +} from '@/components/primitives/types' +import * as Tabs from '@radix-ui/react-tabs' +import * as React from 'react' +import { Pressable, View } from 'react-native' +import type { TabsContentProps, TabsRootProps } from './types' -const TabsContext = React.createContext(null); +const TabsContext = React.createContext(null) const Root = React.forwardRef( - ({ asChild, value, onValueChange, orientation, dir, activationMode, ...viewProps }, ref) => { - const Component = asChild ? Slot.View : View; + ( + { + asChild, + value, + onValueChange, + orientation, + dir, + activationMode, + ...viewProps + }, + ref, + ) => { + const Component = asChild ? Slot.View : View return ( ( - ); - } -); + ) + }, +) -Root.displayName = 'RootWebTabs'; +Root.displayName = 'RootWebTabs' function useRootContext() { - const context = React.useContext(TabsContext); + const context = React.useContext(TabsContext) if (!context) { - throw new Error('Tabs compound components cannot be rendered outside the Tabs component'); + throw new Error( + 'Tabs compound components cannot be rendered outside the Tabs component', + ) } - return context; + return context } -const List = React.forwardRef(({ asChild, ...props }, ref) => { - const Component = asChild ? Slot.View : View; - return ( - - - - ); -}); +const List = React.forwardRef( + ({ asChild, ...props }, ref) => { + const Component = asChild ? Slot.View : View + return ( + + + + ) + }, +) -List.displayName = 'ListWebTabs'; +List.displayName = 'ListWebTabs' -const TriggerContext = React.createContext<{ value: string } | null>(null); +const TriggerContext = React.createContext<{ value: string } | null>(null) const Trigger = React.forwardRef< React.ElementRef, ComponentPropsWithAsChild & { - value: string; + value: string } >(({ asChild, value: tabValue, ...props }, ref) => { - const Component = asChild ? Slot.Pressable : Pressable; + const Component = asChild ? Slot.Pressable : Pressable return ( - ); -}); + ) +}) -Trigger.displayName = 'TriggerWebTabs'; +Trigger.displayName = 'TriggerWebTabs' function useTriggerContext() { - const context = React.useContext(TriggerContext); + const context = React.useContext(TriggerContext) if (!context) { throw new Error( - 'Tabs.Trigger compound components cannot be rendered outside the Tabs.Trigger component' - ); + 'Tabs.Trigger compound components cannot be rendered outside the Tabs.Trigger component', + ) } - return context; + return context } -const Content = React.forwardRef( - ({ asChild, forceMount, value, ...props }, ref) => { - const Component = asChild ? Slot.View : View; - return ( - - - - ); - } -); +const Content = React.forwardRef< + ViewRef, + SlottableViewProps & TabsContentProps +>(({ asChild, forceMount, value, ...props }, ref) => { + const Component = asChild ? Slot.View : View + return ( + + + + ) +}) -Content.displayName = 'ContentWebTabs'; +Content.displayName = 'ContentWebTabs' -export { Content, List, Root, Trigger, useRootContext, useTriggerContext }; \ No newline at end of file +export { Content, List, Root, Trigger, useRootContext, useTriggerContext } diff --git a/apps/mobile/components/svg-assets/auth-illustration.tsx b/apps/mobile/components/svg-assets/auth-illustration.tsx index 35cd0629..e578e66d 100644 --- a/apps/mobile/components/svg-assets/auth-illustration.tsx +++ b/apps/mobile/components/svg-assets/auth-illustration.tsx @@ -1,11 +1,8 @@ -import { cssInterop } from 'nativewind'; +import { cssInterop } from 'nativewind' import Svg, { type SvgProps, Path } from 'react-native-svg' export const AuthIllustration = (props: SvgProps) => ( - + ( cssInterop(Svg, { className: { - target: "style", + target: 'style', nativeStyleToProp: { width: true, height: true }, }, }) diff --git a/apps/mobile/components/ui/avatar.tsx b/apps/mobile/components/ui/avatar.tsx index 564089e3..0cc42d58 100644 --- a/apps/mobile/components/ui/avatar.tsx +++ b/apps/mobile/components/ui/avatar.tsx @@ -1,6 +1,6 @@ -import * as AvatarPrimitive from '@/components/primitives/avatar'; -import { cn } from '@/lib/utils'; -import * as React from 'react'; +import * as AvatarPrimitive from '@/components/primitives/avatar' +import { cn } from '@/lib/utils' +import * as React from 'react' const Avatar = React.forwardRef< React.ElementRef, @@ -8,11 +8,14 @@ const Avatar = React.forwardRef< >(({ className, ...props }, ref) => ( -)); -Avatar.displayName = AvatarPrimitive.Root.displayName; +)) +Avatar.displayName = AvatarPrimitive.Root.displayName const AvatarImage = React.forwardRef< React.ElementRef, @@ -23,8 +26,8 @@ const AvatarImage = React.forwardRef< className={cn('aspect-square h-full w-full', className)} {...props} /> -)); -AvatarImage.displayName = AvatarPrimitive.Image.displayName; +)) +AvatarImage.displayName = AvatarPrimitive.Image.displayName const AvatarFallback = React.forwardRef< React.ElementRef, @@ -34,11 +37,11 @@ const AvatarFallback = React.forwardRef< ref={ref} className={cn( 'flex h-full w-full items-center justify-center rounded-full bg-muted', - className + className, )} {...props} /> -)); -AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName; +)) +AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName -export { Avatar, AvatarFallback, AvatarImage }; +export { Avatar, AvatarFallback, AvatarImage } diff --git a/apps/mobile/components/ui/badge.tsx b/apps/mobile/components/ui/badge.tsx index 9b76afdc..a1fc95e3 100644 --- a/apps/mobile/components/ui/badge.tsx +++ b/apps/mobile/components/ui/badge.tsx @@ -1,26 +1,29 @@ -import * as Slot from '@/components/primitives/slot'; -import type { SlottableViewProps } from '@/components/primitives/types'; -import { TextClassContext } from '@/components/ui/text'; -import { cn } from '@/lib/utils'; -import { type VariantProps, cva } from 'class-variance-authority'; -import { View } from 'react-native'; +import * as Slot from '@/components/primitives/slot' +import type { SlottableViewProps } from '@/components/primitives/types' +import { TextClassContext } from '@/components/ui/text' +import { cn } from '@/lib/utils' +import { type VariantProps, cva } from 'class-variance-authority' +import { View } from 'react-native' const badgeVariants = cva( 'web:inline-flex items-center rounded-full border border-border px-2.5 py-0.5 web:transition-colors web:focus:outline-none web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2', { variants: { variant: { - default: 'border-transparent bg-primary web:hover:opacity-80 active:opacity-80', - secondary: 'border-transparent bg-secondary web:hover:opacity-80 active:opacity-80', - destructive: 'border-transparent bg-destructive web:hover:opacity-80 active:opacity-80', + default: + 'border-transparent bg-primary web:hover:opacity-80 active:opacity-80', + secondary: + 'border-transparent bg-secondary web:hover:opacity-80 active:opacity-80', + destructive: + 'border-transparent bg-destructive web:hover:opacity-80 active:opacity-80', outline: 'text-foreground', }, }, defaultVariants: { variant: 'default', }, - } -); + }, +) const badgeTextVariants = cva('text-xs font-semibold ', { variants: { @@ -34,18 +37,21 @@ const badgeTextVariants = cva('text-xs font-semibold ', { defaultVariants: { variant: 'default', }, -}); +}) -type BadgeProps = SlottableViewProps & VariantProps; +type BadgeProps = SlottableViewProps & VariantProps function Badge({ className, variant, asChild, ...props }: BadgeProps) { - const Component = asChild ? Slot.View : View; + const Component = asChild ? Slot.View : View return ( - + - ); + ) } -export { Badge, badgeTextVariants, badgeVariants }; -export type { BadgeProps }; +export { Badge, badgeTextVariants, badgeVariants } +export type { BadgeProps } diff --git a/apps/mobile/components/ui/button.tsx b/apps/mobile/components/ui/button.tsx index 62006d70..1f836927 100644 --- a/apps/mobile/components/ui/button.tsx +++ b/apps/mobile/components/ui/button.tsx @@ -1,8 +1,8 @@ -import { TextClassContext } from '@/components/ui/text'; -import { cn } from '@/lib/utils'; -import { type VariantProps, cva } from 'class-variance-authority'; -import * as React from 'react'; -import { Pressable } from 'react-native'; +import { TextClassContext } from '@/components/ui/text' +import { cn } from '@/lib/utils' +import { type VariantProps, cva } from 'class-variance-authority' +import * as React from 'react' +import { Pressable } from 'react-native' const buttonVariants = cva( 'group flex items-center flex-row gap-2 justify-center rounded-md web:ring-offset-background web:transition-colors web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2', @@ -14,7 +14,8 @@ const buttonVariants = cva( outline: 'border border-input bg-background web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent', secondary: 'bg-secondary web:hover:opacity-80 active:opacity-80', - ghost: 'web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent', + ghost: + 'web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent', link: 'web:underline-offset-4 web:hover:underline web:focus:underline ', }, size: { @@ -28,8 +29,8 @@ const buttonVariants = cva( variant: 'default', size: 'default', }, - } -); + }, +) const buttonTextVariants = cva( 'web:whitespace-nowrap text-sm native:text-base font-medium text-foreground web:transition-colors', @@ -39,7 +40,8 @@ const buttonTextVariants = cva( default: 'text-primary-foreground', destructive: 'text-destructive-foreground', outline: 'group-active:text-accent-foreground', - secondary: 'text-secondary-foreground group-active:text-secondary-foreground', + secondary: + 'text-secondary-foreground group-active:text-secondary-foreground', ghost: 'group-active:text-accent-foreground', link: 'text-primary group-active:underline', }, @@ -54,35 +56,36 @@ const buttonTextVariants = cva( variant: 'default', size: 'default', }, - } -); + }, +) type ButtonProps = React.ComponentPropsWithoutRef & - VariantProps; + VariantProps -const Button = React.forwardRef, ButtonProps>( - ({ className, variant, size, ...props }, ref) => { - return ( - , + ButtonProps +>(({ className, variant, size, ...props }, ref) => { + return ( + + - - - ); - } -); -Button.displayName = 'Button'; + ref={ref} + role="button" + {...props} + /> + + ) +}) +Button.displayName = 'Button' -export { Button, buttonTextVariants, buttonVariants }; -export type { ButtonProps }; \ No newline at end of file +export { Button, buttonTextVariants, buttonVariants } +export type { ButtonProps } diff --git a/apps/mobile/components/ui/input.tsx b/apps/mobile/components/ui/input.tsx index f525c444..4f39e4b6 100644 --- a/apps/mobile/components/ui/input.tsx +++ b/apps/mobile/components/ui/input.tsx @@ -1,6 +1,6 @@ -import { cn } from '@/lib/utils'; -import * as React from 'react'; -import { TextInput } from 'react-native'; +import { cn } from '@/lib/utils' +import * as React from 'react' +import { TextInput } from 'react-native' const Input = React.forwardRef< React.ElementRef, @@ -12,14 +12,17 @@ const Input = React.forwardRef< className={cn( 'web:flex h-11 web:w-full rounded-md border border-input bg-background px-3 web:py-2 text-sm lg:text-sm native:text-base native:leading-[1.25] text-foreground placeholder:text-muted-foreground web:ring-offset-background file:border-0 file:bg-transparent file:font-medium web:focus-visible:outline-none web:focus-visible:ring-2 font-sans web:focus-visible:ring-ring web:focus-visible:ring-offset-2', props.editable === false && 'opacity-50 web:cursor-not-allowed', - className + className, + )} + placeholderClassName={cn( + 'text-muted-foreground font-sans', + placeholderClassName, )} - placeholderClassName={cn('text-muted-foreground font-sans', placeholderClassName)} {...props} /> - ); -}); + ) +}) -Input.displayName = 'Input'; +Input.displayName = 'Input' -export { Input }; \ No newline at end of file +export { Input } diff --git a/apps/mobile/components/ui/label.tsx b/apps/mobile/components/ui/label.tsx index 82151771..19e9fb5d 100644 --- a/apps/mobile/components/ui/label.tsx +++ b/apps/mobile/components/ui/label.tsx @@ -1,28 +1,33 @@ -import * as LabelPrimitive from '@/components/primitives/label'; -import { cn } from '@/lib/utils'; -import * as React from 'react'; +import * as LabelPrimitive from '@/components/primitives/label' +import { cn } from '@/lib/utils' +import * as React from 'react' const Label = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef ->(({ className, onPress, onLongPress, onPressIn, onPressOut, ...props }, ref) => ( - - - -)); -Label.displayName = LabelPrimitive.Root.displayName; +>( + ( + { className, onPress, onLongPress, onPressIn, onPressOut, ...props }, + ref, + ) => ( + + + + ), +) +Label.displayName = LabelPrimitive.Root.displayName -export { Label }; \ No newline at end of file +export { Label } diff --git a/apps/mobile/components/ui/separator.tsx b/apps/mobile/components/ui/separator.tsx index 3cb783fd..e2920ce4 100644 --- a/apps/mobile/components/ui/separator.tsx +++ b/apps/mobile/components/ui/separator.tsx @@ -1,23 +1,28 @@ -import * as SeparatorPrimitive from '@/components/primitives/separator'; -import { cn } from '@/lib/utils'; -import * as React from 'react'; +import * as SeparatorPrimitive from '@/components/primitives/separator' +import { cn } from '@/lib/utils' +import * as React from 'react' const Separator = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef ->(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => ( - -)); -Separator.displayName = SeparatorPrimitive.Root.displayName; +>( + ( + { className, orientation = 'horizontal', decorative = true, ...props }, + ref, + ) => ( + + ), +) +Separator.displayName = SeparatorPrimitive.Root.displayName -export { Separator }; +export { Separator } diff --git a/apps/mobile/components/ui/skeleton.tsx b/apps/mobile/components/ui/skeleton.tsx index 70d90615..80a92556 100644 --- a/apps/mobile/components/ui/skeleton.tsx +++ b/apps/mobile/components/ui/skeleton.tsx @@ -1,32 +1,32 @@ -import { cn } from '@/lib/utils'; -import { useEffect } from 'react'; +import { cn } from '@/lib/utils' +import { useEffect } from 'react' import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withSequence, withTiming, -} from 'react-native-reanimated'; +} from 'react-native-reanimated' -const duration = 1000; +const duration = 1000 function Skeleton({ className, ...props }: Omit, 'style'>) { - const sv = useSharedValue(1); + const sv = useSharedValue(1) // biome-ignore lint/correctness/useExhaustiveDependencies: useEffect(() => { sv.value = withRepeat( withSequence(withTiming(0.5, { duration }), withTiming(1, { duration })), - -1 - ); - }, []); + -1, + ) + }, []) const style = useAnimatedStyle(() => ({ opacity: sv.value, - })); + })) return ( - ); + ) } -export { Skeleton }; +export { Skeleton } diff --git a/apps/mobile/components/ui/switch.tsx b/apps/mobile/components/ui/switch.tsx index ef6c7f35..f8d100db 100644 --- a/apps/mobile/components/ui/switch.tsx +++ b/apps/mobile/components/ui/switch.tsx @@ -1,15 +1,15 @@ -import * as SwitchPrimitives from '@/components/primitives/switch'; -import * as React from 'react'; -import { Platform } from 'react-native'; +import * as SwitchPrimitives from '@/components/primitives/switch' +import * as React from 'react' +import { Platform } from 'react-native' import Animated, { interpolateColor, useAnimatedStyle, useDerivedValue, withTiming, -} from 'react-native-reanimated'; +} from 'react-native-reanimated' -import { useColorScheme } from '@/hooks/useColorScheme'; -import { cn } from '@/lib/utils'; +import { useColorScheme } from '@/hooks/useColorScheme' +import { cn } from '@/lib/utils' const SwitchWeb = React.forwardRef< React.ElementRef, @@ -20,7 +20,7 @@ const SwitchWeb = React.forwardRef< 'peer flex-row h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed', props.checked ? 'bg-primary' : 'bg-input', props.disabled && 'opacity-50', - className + className, )} {...props} ref={ref} @@ -28,13 +28,13 @@ const SwitchWeb = React.forwardRef< -)); +)) -SwitchWeb.displayName = 'SwitchWeb'; +SwitchWeb.displayName = 'SwitchWeb' const RGB_COLORS = { light: { @@ -45,53 +45,60 @@ const RGB_COLORS = { primary: 'rgb(250, 250, 250)', input: 'rgb(39, 39, 42)', }, -} as const; +} as const const SwitchNative = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => { - const { colorScheme } = useColorScheme(); - const translateX = useDerivedValue(() => (props.checked ? 18 : 0)); + const { colorScheme } = useColorScheme() + const translateX = useDerivedValue(() => (props.checked ? 18 : 0)) const animatedRootStyle = useAnimatedStyle(() => { return { backgroundColor: interpolateColor( translateX.value, [0, 18], - [RGB_COLORS[colorScheme].input, RGB_COLORS[colorScheme].primary] + [RGB_COLORS[colorScheme].input, RGB_COLORS[colorScheme].primary], ), - }; - }); + } + }) const animatedThumbStyle = useAnimatedStyle(() => ({ - transform: [{ translateX: withTiming(translateX.value, { duration: 200 }) }], - })); + transform: [ + { translateX: withTiming(translateX.value, { duration: 200 }) }, + ], + })) return ( - ); -}); -SwitchNative.displayName = 'SwitchNative'; + ) +}) +SwitchNative.displayName = 'SwitchNative' const Switch = Platform.select({ web: SwitchWeb, default: SwitchNative, -}); +}) -export { Switch }; +export { Switch } diff --git a/apps/mobile/components/ui/tabs.tsx b/apps/mobile/components/ui/tabs.tsx index 09f80cc6..dc6cd8a0 100644 --- a/apps/mobile/components/ui/tabs.tsx +++ b/apps/mobile/components/ui/tabs.tsx @@ -1,9 +1,9 @@ -import * as TabsPrimitive from '@/components/primitives/tabs'; -import { TextClassContext } from '@/components/ui/text'; -import { cn } from '@/lib/utils'; -import * as React from 'react'; +import * as TabsPrimitive from '@/components/primitives/tabs' +import { TextClassContext } from '@/components/ui/text' +import { cn } from '@/lib/utils' +import * as React from 'react' -const Tabs = TabsPrimitive.Root; +const Tabs = TabsPrimitive.Root const TabsList = React.forwardRef< React.ElementRef, @@ -13,23 +13,23 @@ const TabsList = React.forwardRef< ref={ref} className={cn( 'web:inline-flex flex-row h-10 native:h-12 items-center justify-center rounded-md bg-muted p-1 native:px-1.5', - className + className, )} {...props} /> -)); -TabsList.displayName = TabsPrimitive.List.displayName; +)) +TabsList.displayName = TabsPrimitive.List.displayName const TabsTrigger = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => { - const { value } = TabsPrimitive.useRootContext(); + const { value } = TabsPrimitive.useRootContext() return ( - ); -}); -TabsTrigger.displayName = TabsPrimitive.Trigger.displayName; + ) +}) +TabsTrigger.displayName = TabsPrimitive.Trigger.displayName const TabsContent = React.forwardRef< React.ElementRef, @@ -55,11 +56,11 @@ const TabsContent = React.forwardRef< ref={ref} className={cn( 'web:ring-offset-background web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2', - className + className, )} {...props} /> -)); -TabsContent.displayName = TabsPrimitive.Content.displayName; +)) +TabsContent.displayName = TabsPrimitive.Content.displayName -export { Tabs, TabsContent, TabsList, TabsTrigger }; \ No newline at end of file +export { Tabs, TabsContent, TabsList, TabsTrigger } diff --git a/apps/mobile/components/wallet/select-account-icon-field.tsx b/apps/mobile/components/wallet/select-account-icon-field.tsx index 3e4e5070..1941d711 100644 --- a/apps/mobile/components/wallet/select-account-icon-field.tsx +++ b/apps/mobile/components/wallet/select-account-icon-field.tsx @@ -46,7 +46,9 @@ export function SelectAccountIconField({ enableTouchThrough /> )} - containerComponent={(props) => {props.children}} + containerComponent={(props) => ( + {props.children} + )} > )} - containerComponent={(props) => {props.children}} + containerComponent={(props) => ( + {props.children} + )} > { React.useEffect(() => { // biome-ignore lint/complexity/noVoid: - void WebBrowser.warmUpAsync(); + void WebBrowser.warmUpAsync() return () => { // biome-ignore lint/complexity/noVoid: - void WebBrowser.coolDownAsync(); - }; - }, []); -}; + void WebBrowser.coolDownAsync() + } + }, []) +} diff --git a/apps/mobile/hooks/useColorScheme.ts b/apps/mobile/hooks/useColorScheme.ts index e83e8226..89a69fd5 100644 --- a/apps/mobile/hooks/useColorScheme.ts +++ b/apps/mobile/hooks/useColorScheme.ts @@ -3,7 +3,7 @@ import { useColorScheme as useNativewindColorScheme } from 'nativewind' export function useColorScheme() { const { colorScheme, setColorScheme, toggleColorScheme } = useNativewindColorScheme() - + return { colorScheme: colorScheme ?? 'dark', isDarkColorScheme: colorScheme === 'dark', diff --git a/apps/mobile/locales/en/messages.ts b/apps/mobile/locales/en/messages.ts index 5e7dd16d..da15bb07 100644 --- a/apps/mobile/locales/en/messages.ts +++ b/apps/mobile/locales/en/messages.ts @@ -1 +1,4 @@ -/*eslint-disable*/import type{Messages}from"@lingui/core";export const messages:Messages=JSON.parse("{\"FEZKSz\":[[\"language\"]],\"VE5ikN\":\"<0><1>Manage your expense seamlessly<2>Let <3>6pm a good time to spend\",\"AYTmQ1\":\"<0>By continuing, you acknowledge that you understand and agree to the <1><2>Terms & Conditions and <3><4>Privacy Policy\",\"pXc4dB\":\"All Accounts\",\"Vw8l6h\":\"An error occurred\",\"2Yw5Eq\":\"App settings\",\"rg8lHb\":\"App theme\",\"aAIQg2\":\"Appearance\",\"apLLSU\":\"Are you sure you want to sign out?\",\"X2pgJW\":\"Ask AI anything...\",\"IGsZpB\":\"Budgets\",\"dEgA5A\":\"Cancel\",\"h4wXn9\":\"Choose a preferred theme for the 6pm\",\"xGVfLh\":\"Continue\",\"RvVi9c\":\"Continue with Email\",\"pvnfJD\":\"Dark\",\"O3oNi5\":\"Email\",\"lYGfRP\":\"English\",\"EmV+r3\":\"Enter the code sent to your email\",\"xRPn3U\":\"Enter your email address\",\"vXIe7J\":\"Language\",\"1njn7W\":\"Light\",\"NuKR0h\":\"Others\",\"WDgJiV\":\"Scanner\",\"Tz0i8g\":\"Settings\",\"5lWFkC\":\"Sign in\",\"+EnZBU\":\"Sign in with Apple\",\"dbWo0h\":\"Sign in with Google\",\"fcWrnU\":\"Sign out\",\"e+RpCP\":\"Sign up\",\"D+NlUC\":\"System\",\"AdWhjZ\":\"Verification code\",\"fROFIL\":\"Vietnamese\"}"); \ No newline at end of file +/*eslint-disable*/ import type { Messages } from '@lingui/core' +export const messages: Messages = JSON.parse( + '{"FEZKSz":[["language"]],"VE5ikN":"<0><1>Manage your expense seamlessly<2>Let <3>6pm a good time to spend","AYTmQ1":"<0>By continuing, you acknowledge that you understand and agree to the <1><2>Terms & Conditions and <3><4>Privacy Policy","pXc4dB":"All Accounts","Vw8l6h":"An error occurred","2Yw5Eq":"App settings","rg8lHb":"App theme","aAIQg2":"Appearance","apLLSU":"Are you sure you want to sign out?","X2pgJW":"Ask AI anything...","IGsZpB":"Budgets","dEgA5A":"Cancel","h4wXn9":"Choose a preferred theme for the 6pm","xGVfLh":"Continue","RvVi9c":"Continue with Email","pvnfJD":"Dark","O3oNi5":"Email","lYGfRP":"English","EmV+r3":"Enter the code sent to your email","xRPn3U":"Enter your email address","vXIe7J":"Language","1njn7W":"Light","NuKR0h":"Others","WDgJiV":"Scanner","Tz0i8g":"Settings","5lWFkC":"Sign in","+EnZBU":"Sign in with Apple","dbWo0h":"Sign in with Google","fcWrnU":"Sign out","e+RpCP":"Sign up","D+NlUC":"System","AdWhjZ":"Verification code","fROFIL":"Vietnamese"}', +) diff --git a/apps/mobile/locales/provider.tsx b/apps/mobile/locales/provider.tsx index f9700221..5cee3fb9 100644 --- a/apps/mobile/locales/provider.tsx +++ b/apps/mobile/locales/provider.tsx @@ -1,14 +1,22 @@ -import { i18n } from "@lingui/core" +import { i18n } from '@lingui/core' import { I18nProvider } from '@lingui/react' -import AsyncStorage from '@react-native-async-storage/async-storage'; -import { getLocales } from 'expo-localization'; -import { createContext, useContext, useEffect, useLayoutEffect, useState } from 'react'; +import AsyncStorage from '@react-native-async-storage/async-storage' +import { getLocales } from 'expo-localization' +import { + createContext, + useContext, + useEffect, + useLayoutEffect, + useState, +} from 'react' import { Text } from 'react-native' -import { messages as enMessages } from './en/messages'; -import { messages as viMessages } from './vi/messages'; +import { messages as enMessages } from './en/messages' +import { messages as viMessages } from './vi/messages' -const deviceLanguage = getLocales()[0]?.languageCode ?? 'en'; -const defaultLanguage = ['en', 'vi'].includes(deviceLanguage) ? deviceLanguage : 'en'; +const deviceLanguage = getLocales()[0]?.languageCode ?? 'en' +const defaultLanguage = ['en', 'vi'].includes(deviceLanguage) + ? deviceLanguage + : 'en' const messages = { en: enMessages, @@ -19,12 +27,12 @@ i18n.load(messages) i18n.activate(defaultLanguage) export const LocaleContext = createContext<{ - language: string; - setLanguage: (language: string) => void; + language: string + setLanguage: (language: string) => void }>({ language: defaultLanguage, // biome-ignore lint/suspicious/noEmptyBlockStatements: - setLanguage: () => { }, + setLanguage: () => {}, }) export function LocaleProvider({ @@ -36,7 +44,9 @@ export function LocaleProvider({ useLayoutEffect(() => { async function main() { - const persistedLanguage = await AsyncStorage.getItem('@preferred_language') + const persistedLanguage = await AsyncStorage.getItem( + '@preferred_language', + ) if (persistedLanguage) { setLanguage(persistedLanguage) } @@ -65,4 +75,4 @@ export function LocaleProvider({ export function useLocale() { const { language, setLanguage } = useContext(LocaleContext) return { language, setLanguage } -} \ No newline at end of file +} diff --git a/apps/mobile/locales/vi/messages.ts b/apps/mobile/locales/vi/messages.ts index 0adfbbf9..16e70aa5 100644 --- a/apps/mobile/locales/vi/messages.ts +++ b/apps/mobile/locales/vi/messages.ts @@ -1 +1,4 @@ -/*eslint-disable*/import type{Messages}from"@lingui/core";export const messages:Messages=JSON.parse("{\"FEZKSz\":[[\"language\"]],\"VE5ikN\":\"<0><1>Quản lý chi tiêu trong lòng bàn tay<2>Không lo cháy túi mỗi <3>6pm\",\"AYTmQ1\":\"<0>Bằng cách tiếp tục, bạn đã hiểu và đồng ý với <1><2>Điều khoản sử dụng và <3><4>Chính sách bảo mật\",\"pXc4dB\":\"Tất cả tài khoản\",\"Vw8l6h\":\"Có lỗi xảy ra\",\"2Yw5Eq\":\"Cài đặt ứng dụng\",\"rg8lHb\":\"Chủ đề ứng dụng\",\"aAIQg2\":\"Giao diện\",\"apLLSU\":\"Bạn có chắc chắn muốn đăng xuất?\",\"X2pgJW\":\"Hỏi AI bất kỳ gì...\",\"IGsZpB\":\"Ngân sách\",\"dEgA5A\":\"Huỷ\",\"h4wXn9\":\"Chọn chủ đề giao diện cho 6pm\",\"xGVfLh\":\"Tiếp tục\",\"RvVi9c\":\"Tiếp tục với Email\",\"pvnfJD\":\"Tối\",\"O3oNi5\":\"Email\",\"lYGfRP\":\"Tiếng Anh\",\"EmV+r3\":\"Nhập mã xác nhận gửi đến email của bạn\",\"xRPn3U\":\"Nhập địa chỉ email của bạn\",\"vXIe7J\":\"Ngôn ngữ\",\"1njn7W\":\"Sáng\",\"NuKR0h\":\"Khác\",\"WDgJiV\":\"Quét hoá đơn\",\"Tz0i8g\":\"Cài đặt\",\"5lWFkC\":\"Đăng nhập\",\"+EnZBU\":\"Tiếp tục với Apple\",\"dbWo0h\":\"Tiếp tục với Google\",\"fcWrnU\":\"Đăng xuất\",\"e+RpCP\":\"Đăng ký\",\"D+NlUC\":\"Hệ thống\",\"AdWhjZ\":\"Mã xác nhận\",\"fROFIL\":\"Tiếng Việt\"}"); \ No newline at end of file +/*eslint-disable*/ import type { Messages } from '@lingui/core' +export const messages: Messages = JSON.parse( + '{"FEZKSz":[["language"]],"VE5ikN":"<0><1>Quản lý chi tiêu trong lòng bàn tay<2>Không lo cháy túi mỗi <3>6pm","AYTmQ1":"<0>Bằng cách tiếp tục, bạn đã hiểu và đồng ý với <1><2>Điều khoản sử dụng và <3><4>Chính sách bảo mật","pXc4dB":"Tất cả tài khoản","Vw8l6h":"Có lỗi xảy ra","2Yw5Eq":"Cài đặt ứng dụng","rg8lHb":"Chủ đề ứng dụng","aAIQg2":"Giao diện","apLLSU":"Bạn có chắc chắn muốn đăng xuất?","X2pgJW":"Hỏi AI bất kỳ gì...","IGsZpB":"Ngân sách","dEgA5A":"Huỷ","h4wXn9":"Chọn chủ đề giao diện cho 6pm","xGVfLh":"Tiếp tục","RvVi9c":"Tiếp tục với Email","pvnfJD":"Tối","O3oNi5":"Email","lYGfRP":"Tiếng Anh","EmV+r3":"Nhập mã xác nhận gửi đến email của bạn","xRPn3U":"Nhập địa chỉ email của bạn","vXIe7J":"Ngôn ngữ","1njn7W":"Sáng","NuKR0h":"Khác","WDgJiV":"Quét hoá đơn","Tz0i8g":"Cài đặt","5lWFkC":"Đăng nhập","+EnZBU":"Tiếp tục với Apple","dbWo0h":"Tiếp tục với Google","fcWrnU":"Đăng xuất","e+RpCP":"Đăng ký","D+NlUC":"Hệ thống","AdWhjZ":"Mã xác nhận","fROFIL":"Tiếng Việt"}', +)