diff --git a/apps/mobile/app/(app)/(tabs)/settings.tsx b/apps/mobile/app/(app)/(tabs)/settings.tsx index b5f506f1..0e3f6dfc 100644 --- a/apps/mobile/app/(app)/(tabs)/settings.tsx +++ b/apps/mobile/app/(app)/(tabs)/settings.tsx @@ -3,6 +3,7 @@ import * as Application from 'expo-application' import { Logo } from '@/components/common/logo' import { MenuItem } from '@/components/common/menu-item' import { UserAvatar } from '@/components/common/user-avatar' +import { SelectDefaultCurrency } from '@/components/setting/select-default-currency' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' import { Switch } from '@/components/ui/switch' @@ -15,7 +16,6 @@ import { Link } from 'expo-router' import { BellIcon, ChevronRightIcon, - CurrencyIcon, EarthIcon, GithubIcon, InboxIcon, @@ -124,7 +124,7 @@ export default function SettingsScreen() { icon={EarthIcon} rightSection={ - + {t(i18n)`${language}`} @@ -132,20 +132,7 @@ export default function SettingsScreen() { } /> - - - - {/* */} - - - - } - /> - + (null) const amountInputRef = useRef(null) + const defaultCurrency = useDefaultCurrency() const budgetForm = useForm({ resolver: zodResolver(zBudgetFormValues), defaultValues: { name: '', description: '', - preferredCurrency: 'USD', + preferredCurrency: defaultCurrency, type: BudgetTypeSchema.Enum.SPENDING, ...defaultValues, period: { diff --git a/apps/mobile/components/budget/budget-statistic.tsx b/apps/mobile/components/budget/budget-statistic.tsx index 1ba5fcf5..48aaf2ef 100644 --- a/apps/mobile/components/budget/budget-statistic.tsx +++ b/apps/mobile/components/budget/budget-statistic.tsx @@ -1,3 +1,4 @@ +import { useDefaultCurrency } from '@/stores/user-settings/hooks' import { t } from '@lingui/macro' import { useLingui } from '@lingui/react' import { View } from 'react-native' @@ -13,13 +14,16 @@ export function BudgetStatistic({ remainingPerDay, }: BudgetStatisticProps) { const { i18n } = useLingui() + const defaultCurrency = useDefaultCurrency() return ( {totalRemaining?.toLocaleString() || '0.00'}{' '} - VND + + {defaultCurrency} + {t(i18n)`Left this month`} @@ -28,7 +32,9 @@ export function BudgetStatistic({ {remainingPerDay?.toLocaleString() || '0.00'}{' '} - VND + + {defaultCurrency} + {t(i18n)`Left per day`} diff --git a/apps/mobile/components/common/amount-format.tsx b/apps/mobile/components/common/amount-format.tsx index 3e46e6b2..ee11cdcf 100644 --- a/apps/mobile/components/common/amount-format.tsx +++ b/apps/mobile/components/common/amount-format.tsx @@ -1,4 +1,5 @@ import { cn } from '@/lib/utils' +import { useDefaultCurrency } from '@/stores/user-settings/hooks' import { type VariantProps, cva } from 'class-variance-authority' import { Text } from '../ui/text' @@ -40,12 +41,13 @@ type AmountFormatProps = { export function AmountFormat({ amount = 0, - currency = 'VND', + currency, className, size, displayNegativeSign, displayPositiveColor, }: AmountFormatProps) { + const defaultCurrency = useDefaultCurrency() return ( {(displayNegativeSign ? amount : Math.abs(amount)).toLocaleString() || '0.00'}{' '} - {currency} + + {currency || defaultCurrency} + ) } diff --git a/apps/mobile/components/setting/select-default-currency.tsx b/apps/mobile/components/setting/select-default-currency.tsx new file mode 100644 index 00000000..10165222 --- /dev/null +++ b/apps/mobile/components/setting/select-default-currency.tsx @@ -0,0 +1,72 @@ +import { BottomSheetBackdrop, BottomSheetModal } from '@gorhom/bottom-sheet' +import { useRef } from 'react' + +import { useColorScheme } from '@/hooks/useColorScheme' +import { theme } from '@/lib/theme' +import { sleep } from '@/lib/utils' +import { useDefaultCurrency } from '@/stores/user-settings/hooks' +import { useUserSettingsStore } from '@/stores/user-settings/store' +import { t } from '@lingui/macro' +import { useLingui } from '@lingui/react' +import { ChevronRightIcon, CurrencyIcon } from 'lucide-react-native' +import { Keyboard, View } from 'react-native' +import { FullWindowOverlay } from 'react-native-screens' +import { CurrencySheetList } from '../common/currency-sheet' +import { MenuItem } from '../common/menu-item' +import { Text } from '../ui/text' + +export function SelectDefaultCurrency() { + const { i18n } = useLingui() + const sheetRef = useRef(null) + const defaultCurrency = useDefaultCurrency() + const setPreferredCurrency = useUserSettingsStore().setPreferredCurrency + const { colorScheme } = useColorScheme() + return ( + <> + { + Keyboard.dismiss() + sheetRef.current?.present() + }} + rightSection={ + + + {defaultCurrency} + + + + } + /> + ( + + )} + containerComponent={(props) => ( + {props.children} + )} + > + { + sheetRef.current?.close() + await sleep(500) + setPreferredCurrency?.(currency.code) + }} + /> + + + ) +} diff --git a/apps/mobile/components/wallet/account-form.tsx b/apps/mobile/components/wallet/account-form.tsx index dc96500c..3b6c5d98 100644 --- a/apps/mobile/components/wallet/account-form.tsx +++ b/apps/mobile/components/wallet/account-form.tsx @@ -1,3 +1,4 @@ +import { useDefaultCurrency } from '@/stores/user-settings/hooks' import { type AccountFormValues, zAccountFormValues } from '@6pm/validation' import { zodResolver } from '@hookform/resolvers/zod' import { t } from '@lingui/macro' @@ -21,12 +22,13 @@ export const AccountForm = ({ onSubmit, defaultValues }: AccountFormProps) => { const { i18n } = useLingui() const nameInputRef = useRef(null) const balanceInputRef = useRef(null) + const defaultCurrency = useDefaultCurrency() const accountForm = useForm({ resolver: zodResolver(zAccountFormValues), defaultValues: { name: '', - preferredCurrency: 'USD', // TODO: get from user settings + preferredCurrency: defaultCurrency, icon: 'CreditCard', ...defaultValues, }, diff --git a/apps/mobile/locales/en/messages.po b/apps/mobile/locales/en/messages.po index 2d8c720c..83b3c66c 100644 --- a/apps/mobile/locales/en/messages.po +++ b/apps/mobile/locales/en/messages.po @@ -17,11 +17,11 @@ msgstr "" msgid "{0}" msgstr "" -#: apps/mobile/components/budget/budget-item.tsx:50 +#: apps/mobile/components/budget/budget-item.tsx:60 msgid "{0} left" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:135 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:130 msgid "{language}" msgstr "" @@ -33,7 +33,7 @@ msgstr "" msgid "<0>By continuing, you acknowledge that you understand and agree to the <1><2>Terms & Conditions and <3><4>Privacy Policy" msgstr "" -#: apps/mobile/components/budget/budget-form.tsx:118 +#: apps/mobile/components/budget/budget-form.tsx:120 #: apps/mobile/components/wallet/account-form.tsx:58 msgid "0.00" msgstr "" @@ -42,7 +42,7 @@ msgstr "" msgid "Add your first transaction here" msgstr "" -#: apps/mobile/components/home/header.tsx:33 +#: apps/mobile/components/home/header.tsx:26 msgid "All Accounts" msgstr "" @@ -50,7 +50,7 @@ msgstr "" msgid "An error occurred" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:116 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:111 msgid "App settings" msgstr "" @@ -59,11 +59,11 @@ msgid "App theme" msgstr "" #: apps/mobile/app/(app)/_layout.tsx:74 -#: apps/mobile/app/(app)/(tabs)/settings.tsx:121 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:116 msgid "Appearance" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:207 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:202 msgid "Are you sure you want to sign out?" msgstr "" @@ -83,7 +83,7 @@ msgstr "" msgid "Camera permissions are not granted" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:209 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:204 #: apps/mobile/app/(app)/transaction/[transactionId].tsx:90 #: apps/mobile/app/(app)/wallet/[walletId].tsx:74 msgid "Cancel" @@ -94,7 +94,7 @@ msgid "Cannot extract transaction data" msgstr "" #: apps/mobile/app/(app)/_layout.tsx:106 -#: apps/mobile/app/(app)/(tabs)/settings.tsx:96 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:91 msgid "Categories" msgstr "" @@ -114,7 +114,7 @@ msgstr "" msgid "Continue with Email" msgstr "" -#: apps/mobile/components/home/wallet-statistics.tsx:25 +#: apps/mobile/components/home/wallet-statistics.tsx:26 msgid "Current balance" msgstr "" @@ -122,12 +122,12 @@ msgstr "" msgid "Dark" msgstr "" -#: apps/mobile/app/(app)/(tabs)/budgets.tsx:31 -#: apps/mobile/components/budget/select-budget-type-field.tsx:55 +#: apps/mobile/app/(app)/(tabs)/budgets.tsx:136 +#: apps/mobile/components/budget/select-budget-type-field.tsx:57 msgid "Debt" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:144 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:139 msgid "Default currency" msgstr "" @@ -177,7 +177,7 @@ msgstr "" msgid "Expenses" msgstr "" -#: apps/mobile/components/budget/budget-form.tsx:110 +#: apps/mobile/components/budget/budget-form.tsx:111 msgid "Family budget" msgstr "" @@ -185,11 +185,11 @@ msgstr "" msgid "From date" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:82 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:77 msgid "General" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:72 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:67 msgid "Get 6pm Pro" msgstr "" @@ -205,13 +205,13 @@ msgstr "" msgid "Incomes" msgstr "" -#: apps/mobile/app/(app)/(tabs)/budgets.tsx:30 -#: apps/mobile/components/budget/select-budget-type-field.tsx:50 +#: apps/mobile/app/(app)/(tabs)/budgets.tsx:135 +#: apps/mobile/components/budget/select-budget-type-field.tsx:52 msgid "Investing" msgstr "" #: apps/mobile/app/(app)/_layout.tsx:69 -#: apps/mobile/app/(app)/(tabs)/settings.tsx:130 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:125 msgid "Language" msgstr "" @@ -227,19 +227,19 @@ msgstr "" msgid "Light" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:157 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:152 msgid "Login using FaceID" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:105 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:100 msgid "Magic inbox" msgstr "" -#: apps/mobile/components/budget/select-period-type-field.tsx:43 +#: apps/mobile/components/budget/select-period-type-field.tsx:45 msgid "Monthly" msgstr "" -#: apps/mobile/components/budget/budget-form.tsx:109 +#: apps/mobile/components/budget/budget-form.tsx:110 #: apps/mobile/components/category/category-form.tsx:66 #: apps/mobile/components/wallet/account-form.tsx:41 msgid "Name" @@ -267,11 +267,15 @@ msgstr "" msgid "No budget selected" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:174 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:169 msgid "Others" msgstr "" -#: apps/mobile/components/budget/budget-form.tsx:142 +#: apps/mobile/components/budget/budget-item.tsx:124 +msgid "per day" +msgstr "" + +#: apps/mobile/components/budget/budget-form.tsx:145 msgid "Period" msgstr "" @@ -283,7 +287,7 @@ msgstr "" msgid "Period start date" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:242 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:237 msgid "Privacy policy" msgstr "" @@ -295,23 +299,23 @@ msgstr "" msgid "Processing transaction..." msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:199 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:194 msgid "Proudly open source" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:164 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:159 msgid "Push notifications" msgstr "" -#: apps/mobile/components/budget/select-period-type-field.tsx:47 +#: apps/mobile/components/budget/select-period-type-field.tsx:49 msgid "Quarterly" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:187 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:182 msgid "Rate 6pm on App Store" msgstr "" -#: apps/mobile/components/budget/budget-form.tsx:52 +#: apps/mobile/components/budget/budget-form.tsx:51 #: apps/mobile/components/category/category-form.tsx:118 #: apps/mobile/components/common/date-picker.tsx:55 #: apps/mobile/components/common/date-range-picker.tsx:62 @@ -320,8 +324,8 @@ msgstr "" msgid "Save" msgstr "" -#: apps/mobile/app/(app)/(tabs)/budgets.tsx:29 -#: apps/mobile/components/budget/select-budget-type-field.tsx:45 +#: apps/mobile/app/(app)/(tabs)/budgets.tsx:134 +#: apps/mobile/components/budget/select-budget-type-field.tsx:47 msgid "Saving" msgstr "" @@ -337,15 +341,15 @@ msgstr "" msgid "Select account" msgstr "" -#: apps/mobile/components/budget/select-budget-type-field.tsx:76 +#: apps/mobile/components/budget/select-budget-type-field.tsx:78 msgid "Select budget type" msgstr "" -#: apps/mobile/components/budget/select-period-type-field.tsx:70 +#: apps/mobile/components/budget/select-period-type-field.tsx:72 msgid "Select period type" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:179 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:174 msgid "Send feedback" msgstr "" @@ -353,7 +357,7 @@ msgstr "" msgid "Settings" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:193 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:188 msgid "Share with friends" msgstr "" @@ -369,8 +373,8 @@ msgstr "" msgid "Sign in with Google" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:213 -#: apps/mobile/app/(app)/(tabs)/settings.tsx:223 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:208 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:218 msgid "Sign out" msgstr "" @@ -378,12 +382,12 @@ msgstr "" msgid "Sign up" msgstr "" -#: apps/mobile/components/budget/select-period-type-field.tsx:55 +#: apps/mobile/components/budget/select-period-type-field.tsx:57 msgid "Specific dates" msgstr "" -#: apps/mobile/app/(app)/(tabs)/budgets.tsx:28 -#: apps/mobile/components/budget/select-budget-type-field.tsx:40 +#: apps/mobile/app/(app)/(tabs)/budgets.tsx:133 +#: apps/mobile/components/budget/select-budget-type-field.tsx:42 msgid "Spending" msgstr "" @@ -395,7 +399,7 @@ msgstr "" msgid "Take a picture of your transaction" msgstr "" -#: apps/mobile/components/budget/budget-form.tsx:117 +#: apps/mobile/components/budget/budget-form.tsx:119 msgid "Target" msgstr "" @@ -403,7 +407,7 @@ msgstr "" msgid "Terms & Conditions" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:237 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:232 msgid "Terms of use" msgstr "" @@ -431,7 +435,6 @@ msgstr "" msgid "transaction note" msgstr "" -#: apps/mobile/components/budget/budget-form.tsx:94 #: apps/mobile/components/category/category-form.tsx:83 msgid "Type" msgstr "" @@ -441,15 +444,15 @@ msgstr "" msgid "Uncategorized" msgstr "" -#: apps/mobile/components/budget/budget-item.tsx:36 +#: apps/mobile/components/budget/budget-item.tsx:46 msgid "Unknown" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:75 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:70 msgid "Unlocks full AI power and more!" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:231 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:226 msgid "ver." msgstr "" @@ -466,7 +469,7 @@ msgid "Wallet account name" msgstr "" #: apps/mobile/app/(app)/_layout.tsx:79 -#: apps/mobile/app/(app)/(tabs)/settings.tsx:87 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:82 msgid "Wallet accounts" msgstr "" @@ -474,11 +477,11 @@ msgstr "" msgid "Wallet Accounts" msgstr "" -#: apps/mobile/components/budget/select-period-type-field.tsx:39 +#: apps/mobile/components/budget/select-period-type-field.tsx:41 msgid "Weekly" msgstr "" -#: apps/mobile/components/budget/select-period-type-field.tsx:51 +#: apps/mobile/components/budget/select-period-type-field.tsx:53 msgid "Yearly" msgstr "" diff --git a/apps/mobile/locales/en/messages.ts b/apps/mobile/locales/en/messages.ts index c64e034c..3303b76a 100644 --- a/apps/mobile/locales/en/messages.ts +++ b/apps/mobile/locales/en/messages.ts @@ -1,4 +1,4 @@ /*eslint-disable*/ import type { Messages } from '@lingui/core' export const messages: Messages = JSON.parse( - '{"J/hVSQ":[["0"]],"6MIiOI":[["0"]," left"],"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","LjsgKU":"0.00","103Xyi":"Add your first transaction here","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...","fsBGk0":"Balance","IGsZpB":"Budgets","HjYcC9":"Camera permissions are not granted","dEgA5A":"Cancel","dZYaqU":"Cannot extract transaction data","NUrY9o":"Categories","i+de8A":"Category name","h4wXn9":"Choose a preferred theme for the 6pm","xGVfLh":"Continue","RvVi9c":"Continue with Email","PxMcud":"Current balance","pvnfJD":"Dark","o5ooMr":"Debt","WRwm0h":"Default currency","cnGeoo":"Delete","VbtMs5":"Delete wallet account will also delete all related transactions!","rrOW2A":"Edit account","j1Jl7s":"Edit category","O3oNi5":"Email","QOINDn":"empty","lYGfRP":"English","EmV+r3":"Enter the code sent to your email","xRPn3U":"Enter your email address","/o/2Tm":"Expense","aSBbnl":"Expenses","AL8ocL":"Family budget","xRJSOj":"From date","Weq9zb":"General","h52e9T":"Get 6pm Pro","M1w7jC":"Grant camera permissions","xxsw3W":"Income","Z2b5qm":"Incomes","13aTWr":"Investing","vXIe7J":"Language","brkKQW":"Left per day","PRzhQh":"Left this month","1njn7W":"Light","UC3YIm":"Login using FaceID","lkAlEG":"Magic inbox","+8Nek/":"Monthly","6YtxFj":"Name","6WSYbN":["New ",["0"]],"Kcr9Fr":"New account","5OdwzH":"New budget","tl5vsv":"New category","ApQ2nt":"No budget selected","NuKR0h":"Others","NtQvjo":"Period","66fYpz":"Period end date","QTWhG5":"Period start date","ScJ9fj":"Privacy policy","LcET2C":"Privacy Policy","Z8pOEI":"Processing transaction...","++8ZXz":"Proudly open source","SZJG6+":"Push notifications","kCxe8K":"Quarterly","j75BA9":"Rate 6pm on App Store","tfDRzk":"Save","uF9ruK":"Saving","WDgJiV":"Scanner","P9vd26":"Search currency...","+O3PfQ":"Select account","PtoMco":"Select budget type","5dfUzo":"Select period type","RoafuO":"Send feedback","Tz0i8g":"Settings","RDprz0":"Share with friends","5lWFkC":"Sign in","+EnZBU":"Sign in with Apple","dbWo0h":"Sign in with Google","fcWrnU":"Sign out","e+RpCP":"Sign up","TOm5Xo":"Specific dates","Q14cFX":"Spending","D+NlUC":"System","IL5Ibf":"Take a picture of your transaction","Yrrg+y":"Target","KWUgwY":"Terms & Conditions","Emv+V7":"Terms of use","OR1t9P":"This will delete the transaction. Are you sure you want to continue?","w4eKlT":"To date","ecUA8p":"Today","BRMXj0":"Tomorrow","38Gho6":"Transaction created","6D8usS":"transaction note","+zy2Nq":"Type","b2vAoQ":"Uncategorized","Ef7StM":"Unknown","QQX2/q":"Unlocks full AI power and more!","KALubG":"ver.","AdWhjZ":"Verification code","fROFIL":"Vietnamese","q19YJ1":"Wallet account name","rUcnTU":"Wallet accounts","mdad9N":"Wallet Accounts","4XSc4l":"Weekly","zkWmBh":"Yearly","y/0uwd":"Yesterday"}', + '{"J/hVSQ":[["0"]],"6MIiOI":[["0"]," left"],"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","LjsgKU":"0.00","103Xyi":"Add your first transaction here","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...","fsBGk0":"Balance","IGsZpB":"Budgets","HjYcC9":"Camera permissions are not granted","dEgA5A":"Cancel","dZYaqU":"Cannot extract transaction data","NUrY9o":"Categories","i+de8A":"Category name","h4wXn9":"Choose a preferred theme for the 6pm","xGVfLh":"Continue","RvVi9c":"Continue with Email","PxMcud":"Current balance","pvnfJD":"Dark","o5ooMr":"Debt","WRwm0h":"Default currency","cnGeoo":"Delete","VbtMs5":"Delete wallet account will also delete all related transactions!","rrOW2A":"Edit account","j1Jl7s":"Edit category","O3oNi5":"Email","QOINDn":"empty","RRb2CS":"English","lYGfRP":"English","EmV+r3":"Enter the code sent to your email","xRPn3U":"Enter your email address","/o/2Tm":"Expense","aSBbnl":"Expenses","AL8ocL":"Family budget","xRJSOj":"From date","Weq9zb":"General","h52e9T":"Get 6pm Pro","M1w7jC":"Grant camera permissions","xxsw3W":"Income","Z2b5qm":"Incomes","13aTWr":"Investing","vXIe7J":"Language","brkKQW":"Left per day","PRzhQh":"Left this month","1njn7W":"Light","UC3YIm":"Login using FaceID","lkAlEG":"Magic inbox","+8Nek/":"Monthly","6YtxFj":"Name","6WSYbN":["New ",["0"]],"Kcr9Fr":"New account","5OdwzH":"New budget","tl5vsv":"New category","ApQ2nt":"No budget selected","NuKR0h":"Others","198luN":"per day","NtQvjo":"Period","66fYpz":"Period end date","QTWhG5":"Period start date","ScJ9fj":"Privacy policy","LcET2C":"Privacy Policy","Z8pOEI":"Processing transaction...","++8ZXz":"Proudly open source","SZJG6+":"Push notifications","kCxe8K":"Quarterly","j75BA9":"Rate 6pm on App Store","tfDRzk":"Save","uF9ruK":"Saving","WDgJiV":"Scanner","P9vd26":"Search currency...","+O3PfQ":"Select account","PtoMco":"Select budget type","5dfUzo":"Select period type","RoafuO":"Send feedback","Tz0i8g":"Settings","RDprz0":"Share with friends","5lWFkC":"Sign in","+EnZBU":"Sign in with Apple","dbWo0h":"Sign in with Google","fcWrnU":"Sign out","e+RpCP":"Sign up","TOm5Xo":"Specific dates","Q14cFX":"Spending","D+NlUC":"System","IL5Ibf":"Take a picture of your transaction","Yrrg+y":"Target","KWUgwY":"Terms & Conditions","Emv+V7":"Terms of use","OR1t9P":"This will delete the transaction. Are you sure you want to continue?","w4eKlT":"To date","ecUA8p":"Today","BRMXj0":"Tomorrow","38Gho6":"Transaction created","6D8usS":"transaction note","+zy2Nq":"Type","b2vAoQ":"Uncategorized","Ef7StM":"Unknown","QQX2/q":"Unlocks full AI power and more!","KALubG":"ver.","AdWhjZ":"Verification code","vlIJ12":"Vietnamese","fROFIL":"Vietnamese","q19YJ1":"Wallet account name","rUcnTU":"Wallet accounts","mdad9N":"Wallet Accounts","4XSc4l":"Weekly","zkWmBh":"Yearly","y/0uwd":"Yesterday"}', ) diff --git a/apps/mobile/locales/vi/messages.po b/apps/mobile/locales/vi/messages.po index 118c717b..8881666f 100644 --- a/apps/mobile/locales/vi/messages.po +++ b/apps/mobile/locales/vi/messages.po @@ -17,11 +17,11 @@ msgstr "" msgid "{0}" msgstr "" -#: apps/mobile/components/budget/budget-item.tsx:50 +#: apps/mobile/components/budget/budget-item.tsx:60 msgid "{0} left" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:135 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:130 msgid "{language}" msgstr "" @@ -33,7 +33,7 @@ msgstr "<0><1>Quản lý chi tiêu trong lòng bàn tay<2>Không lo cháy t msgid "<0>By continuing, you acknowledge that you understand and agree to the <1><2>Terms & Conditions and <3><4>Privacy Policy" msgstr "<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 của 6pm." -#: apps/mobile/components/budget/budget-form.tsx:118 +#: apps/mobile/components/budget/budget-form.tsx:120 #: apps/mobile/components/wallet/account-form.tsx:58 msgid "0.00" msgstr "" @@ -42,7 +42,7 @@ msgstr "" msgid "Add your first transaction here" msgstr "" -#: apps/mobile/components/home/header.tsx:33 +#: apps/mobile/components/home/header.tsx:26 msgid "All Accounts" msgstr "Tất cả tài khoản" @@ -50,7 +50,7 @@ msgstr "Tất cả tài khoản" msgid "An error occurred" msgstr "Có lỗi xảy ra" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:116 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:111 msgid "App settings" msgstr "Cài đặt ứng dụng" @@ -59,11 +59,11 @@ msgid "App theme" msgstr "Chủ đề ứng dụng" #: apps/mobile/app/(app)/_layout.tsx:74 -#: apps/mobile/app/(app)/(tabs)/settings.tsx:121 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:116 msgid "Appearance" msgstr "Giao diện" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:207 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:202 msgid "Are you sure you want to sign out?" msgstr "Bạn có chắc chắn muốn đăng xuất?" @@ -83,7 +83,7 @@ msgstr "Ngân sách" msgid "Camera permissions are not granted" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:209 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:204 #: apps/mobile/app/(app)/transaction/[transactionId].tsx:90 #: apps/mobile/app/(app)/wallet/[walletId].tsx:74 msgid "Cancel" @@ -94,7 +94,7 @@ msgid "Cannot extract transaction data" msgstr "" #: apps/mobile/app/(app)/_layout.tsx:106 -#: apps/mobile/app/(app)/(tabs)/settings.tsx:96 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:91 msgid "Categories" msgstr "" @@ -114,7 +114,7 @@ msgstr "Tiếp tục" msgid "Continue with Email" msgstr "Tiếp tục với Email" -#: apps/mobile/components/home/wallet-statistics.tsx:25 +#: apps/mobile/components/home/wallet-statistics.tsx:26 msgid "Current balance" msgstr "" @@ -122,12 +122,12 @@ msgstr "" msgid "Dark" msgstr "Tối" -#: apps/mobile/app/(app)/(tabs)/budgets.tsx:31 -#: apps/mobile/components/budget/select-budget-type-field.tsx:55 +#: apps/mobile/app/(app)/(tabs)/budgets.tsx:136 +#: apps/mobile/components/budget/select-budget-type-field.tsx:57 msgid "Debt" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:144 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:139 msgid "Default currency" msgstr "" @@ -177,7 +177,7 @@ msgstr "" msgid "Expenses" msgstr "" -#: apps/mobile/components/budget/budget-form.tsx:110 +#: apps/mobile/components/budget/budget-form.tsx:111 msgid "Family budget" msgstr "" @@ -185,11 +185,11 @@ msgstr "" msgid "From date" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:82 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:77 msgid "General" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:72 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:67 msgid "Get 6pm Pro" msgstr "" @@ -205,13 +205,13 @@ msgstr "" msgid "Incomes" msgstr "" -#: apps/mobile/app/(app)/(tabs)/budgets.tsx:30 -#: apps/mobile/components/budget/select-budget-type-field.tsx:50 +#: apps/mobile/app/(app)/(tabs)/budgets.tsx:135 +#: apps/mobile/components/budget/select-budget-type-field.tsx:52 msgid "Investing" msgstr "" #: apps/mobile/app/(app)/_layout.tsx:69 -#: apps/mobile/app/(app)/(tabs)/settings.tsx:130 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:125 msgid "Language" msgstr "Ngôn ngữ" @@ -227,19 +227,19 @@ msgstr "" msgid "Light" msgstr "Sáng" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:157 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:152 msgid "Login using FaceID" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:105 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:100 msgid "Magic inbox" msgstr "" -#: apps/mobile/components/budget/select-period-type-field.tsx:43 +#: apps/mobile/components/budget/select-period-type-field.tsx:45 msgid "Monthly" msgstr "" -#: apps/mobile/components/budget/budget-form.tsx:109 +#: apps/mobile/components/budget/budget-form.tsx:110 #: apps/mobile/components/category/category-form.tsx:66 #: apps/mobile/components/wallet/account-form.tsx:41 msgid "Name" @@ -267,11 +267,15 @@ msgstr "" msgid "No budget selected" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:174 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:169 msgid "Others" msgstr "Khác" -#: apps/mobile/components/budget/budget-form.tsx:142 +#: apps/mobile/components/budget/budget-item.tsx:124 +msgid "per day" +msgstr "" + +#: apps/mobile/components/budget/budget-form.tsx:145 msgid "Period" msgstr "" @@ -283,7 +287,7 @@ msgstr "" msgid "Period start date" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:242 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:237 msgid "Privacy policy" msgstr "" @@ -295,23 +299,23 @@ msgstr "" msgid "Processing transaction..." msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:199 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:194 msgid "Proudly open source" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:164 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:159 msgid "Push notifications" msgstr "" -#: apps/mobile/components/budget/select-period-type-field.tsx:47 +#: apps/mobile/components/budget/select-period-type-field.tsx:49 msgid "Quarterly" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:187 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:182 msgid "Rate 6pm on App Store" msgstr "" -#: apps/mobile/components/budget/budget-form.tsx:52 +#: apps/mobile/components/budget/budget-form.tsx:51 #: apps/mobile/components/category/category-form.tsx:118 #: apps/mobile/components/common/date-picker.tsx:55 #: apps/mobile/components/common/date-range-picker.tsx:62 @@ -320,8 +324,8 @@ msgstr "" msgid "Save" msgstr "" -#: apps/mobile/app/(app)/(tabs)/budgets.tsx:29 -#: apps/mobile/components/budget/select-budget-type-field.tsx:45 +#: apps/mobile/app/(app)/(tabs)/budgets.tsx:134 +#: apps/mobile/components/budget/select-budget-type-field.tsx:47 msgid "Saving" msgstr "" @@ -337,15 +341,15 @@ msgstr "" msgid "Select account" msgstr "" -#: apps/mobile/components/budget/select-budget-type-field.tsx:76 +#: apps/mobile/components/budget/select-budget-type-field.tsx:78 msgid "Select budget type" msgstr "" -#: apps/mobile/components/budget/select-period-type-field.tsx:70 +#: apps/mobile/components/budget/select-period-type-field.tsx:72 msgid "Select period type" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:179 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:174 msgid "Send feedback" msgstr "" @@ -353,7 +357,7 @@ msgstr "" msgid "Settings" msgstr "Cài đặt" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:193 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:188 msgid "Share with friends" msgstr "" @@ -369,8 +373,8 @@ msgstr "Tiếp tục với Apple" msgid "Sign in with Google" msgstr "Tiếp tục với Google" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:213 -#: apps/mobile/app/(app)/(tabs)/settings.tsx:223 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:208 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:218 msgid "Sign out" msgstr "Đăng xuất" @@ -378,12 +382,12 @@ msgstr "Đăng xuất" msgid "Sign up" msgstr "Đăng ký" -#: apps/mobile/components/budget/select-period-type-field.tsx:55 +#: apps/mobile/components/budget/select-period-type-field.tsx:57 msgid "Specific dates" msgstr "" -#: apps/mobile/app/(app)/(tabs)/budgets.tsx:28 -#: apps/mobile/components/budget/select-budget-type-field.tsx:40 +#: apps/mobile/app/(app)/(tabs)/budgets.tsx:133 +#: apps/mobile/components/budget/select-budget-type-field.tsx:42 msgid "Spending" msgstr "" @@ -395,7 +399,7 @@ msgstr "" msgid "Take a picture of your transaction" msgstr "" -#: apps/mobile/components/budget/budget-form.tsx:117 +#: apps/mobile/components/budget/budget-form.tsx:119 msgid "Target" msgstr "" @@ -403,7 +407,7 @@ msgstr "" msgid "Terms & Conditions" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:237 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:232 msgid "Terms of use" msgstr "" @@ -431,7 +435,6 @@ msgstr "" msgid "transaction note" msgstr "" -#: apps/mobile/components/budget/budget-form.tsx:94 #: apps/mobile/components/category/category-form.tsx:83 msgid "Type" msgstr "" @@ -441,15 +444,15 @@ msgstr "" msgid "Uncategorized" msgstr "" -#: apps/mobile/components/budget/budget-item.tsx:36 +#: apps/mobile/components/budget/budget-item.tsx:46 msgid "Unknown" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:75 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:70 msgid "Unlocks full AI power and more!" msgstr "" -#: apps/mobile/app/(app)/(tabs)/settings.tsx:231 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:226 msgid "ver." msgstr "" @@ -466,7 +469,7 @@ msgid "Wallet account name" msgstr "" #: apps/mobile/app/(app)/_layout.tsx:79 -#: apps/mobile/app/(app)/(tabs)/settings.tsx:87 +#: apps/mobile/app/(app)/(tabs)/settings.tsx:82 msgid "Wallet accounts" msgstr "" @@ -474,11 +477,11 @@ msgstr "" msgid "Wallet Accounts" msgstr "" -#: apps/mobile/components/budget/select-period-type-field.tsx:39 +#: apps/mobile/components/budget/select-period-type-field.tsx:41 msgid "Weekly" msgstr "" -#: apps/mobile/components/budget/select-period-type-field.tsx:51 +#: apps/mobile/components/budget/select-period-type-field.tsx:53 msgid "Yearly" msgstr "" diff --git a/apps/mobile/locales/vi/messages.ts b/apps/mobile/locales/vi/messages.ts index 31182853..6eef8326 100644 --- a/apps/mobile/locales/vi/messages.ts +++ b/apps/mobile/locales/vi/messages.ts @@ -1,4 +1,4 @@ /*eslint-disable*/ import type { Messages } from '@lingui/core' export const messages: Messages = JSON.parse( - '{"J/hVSQ":[["0"]],"6MIiOI":[["0"]," left"],"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 của 6pm.","LjsgKU":"0.00","103Xyi":"Add your first transaction here","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ì...","fsBGk0":"Balance","IGsZpB":"Ngân sách","HjYcC9":"Camera permissions are not granted","dEgA5A":"Huỷ","dZYaqU":"Cannot extract transaction data","NUrY9o":"Categories","i+de8A":"Category name","h4wXn9":"Chọn chủ đề giao diện cho 6pm","xGVfLh":"Tiếp tục","RvVi9c":"Tiếp tục với Email","PxMcud":"Current balance","pvnfJD":"Tối","o5ooMr":"Debt","WRwm0h":"Default currency","cnGeoo":"Delete","VbtMs5":"Delete wallet account will also delete all related transactions!","rrOW2A":"Edit account","j1Jl7s":"Edit category","O3oNi5":"Email","QOINDn":"empty","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","/o/2Tm":"Expense","aSBbnl":"Expenses","AL8ocL":"Family budget","xRJSOj":"From date","Weq9zb":"General","h52e9T":"Get 6pm Pro","M1w7jC":"Grant camera permissions","xxsw3W":"Income","Z2b5qm":"Incomes","13aTWr":"Investing","vXIe7J":"Ngôn ngữ","brkKQW":"Left per day","PRzhQh":"Left this month","1njn7W":"Sáng","UC3YIm":"Login using FaceID","lkAlEG":"Magic inbox","+8Nek/":"Monthly","6YtxFj":"Name","6WSYbN":["New ",["0"]],"Kcr9Fr":"New account","5OdwzH":"New budget","tl5vsv":"New category","ApQ2nt":"No budget selected","NuKR0h":"Khác","NtQvjo":"Period","66fYpz":"Period end date","QTWhG5":"Period start date","ScJ9fj":"Privacy policy","LcET2C":"Privacy Policy","Z8pOEI":"Processing transaction...","++8ZXz":"Proudly open source","SZJG6+":"Push notifications","kCxe8K":"Quarterly","j75BA9":"Rate 6pm on App Store","tfDRzk":"Save","uF9ruK":"Saving","WDgJiV":"Quét hoá đơn","P9vd26":"Search currency...","+O3PfQ":"Select account","PtoMco":"Select budget type","5dfUzo":"Select period type","RoafuO":"Send feedback","Tz0i8g":"Cài đặt","RDprz0":"Share with friends","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ý","TOm5Xo":"Specific dates","Q14cFX":"Spending","D+NlUC":"Hệ thống","IL5Ibf":"Take a picture of your transaction","Yrrg+y":"Target","KWUgwY":"Terms & Conditions","Emv+V7":"Terms of use","OR1t9P":"This will delete the transaction. Are you sure you want to continue?","w4eKlT":"To date","ecUA8p":"Today","BRMXj0":"Tomorrow","38Gho6":"Transaction created","6D8usS":"transaction note","+zy2Nq":"Type","b2vAoQ":"Uncategorized","Ef7StM":"Unknown","QQX2/q":"Unlocks full AI power and more!","KALubG":"ver.","AdWhjZ":"Mã xác nhận","fROFIL":"Tiếng Việt","q19YJ1":"Wallet account name","rUcnTU":"Wallet accounts","mdad9N":"Wallet Accounts","4XSc4l":"Weekly","zkWmBh":"Yearly","y/0uwd":"Yesterday"}', + '{"J/hVSQ":[["0"]],"6MIiOI":[["0"]," left"],"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 của 6pm.","LjsgKU":"0.00","103Xyi":"Add your first transaction here","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ì...","fsBGk0":"Balance","IGsZpB":"Ngân sách","HjYcC9":"Camera permissions are not granted","dEgA5A":"Huỷ","dZYaqU":"Cannot extract transaction data","NUrY9o":"Categories","i+de8A":"Category name","h4wXn9":"Chọn chủ đề giao diện cho 6pm","xGVfLh":"Tiếp tục","RvVi9c":"Tiếp tục với Email","PxMcud":"Current balance","pvnfJD":"Tối","o5ooMr":"Debt","WRwm0h":"Default currency","cnGeoo":"Delete","VbtMs5":"Delete wallet account will also delete all related transactions!","rrOW2A":"Edit account","j1Jl7s":"Edit category","O3oNi5":"Email","QOINDn":"empty","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","/o/2Tm":"Expense","aSBbnl":"Expenses","AL8ocL":"Family budget","xRJSOj":"From date","Weq9zb":"General","h52e9T":"Get 6pm Pro","M1w7jC":"Grant camera permissions","xxsw3W":"Income","Z2b5qm":"Incomes","13aTWr":"Investing","vXIe7J":"Ngôn ngữ","brkKQW":"Left per day","PRzhQh":"Left this month","1njn7W":"Sáng","UC3YIm":"Login using FaceID","lkAlEG":"Magic inbox","+8Nek/":"Monthly","6YtxFj":"Name","6WSYbN":["New ",["0"]],"Kcr9Fr":"New account","5OdwzH":"New budget","tl5vsv":"New category","ApQ2nt":"No budget selected","NuKR0h":"Khác","198luN":"per day","NtQvjo":"Period","66fYpz":"Period end date","QTWhG5":"Period start date","ScJ9fj":"Privacy policy","LcET2C":"Privacy Policy","Z8pOEI":"Processing transaction...","++8ZXz":"Proudly open source","SZJG6+":"Push notifications","kCxe8K":"Quarterly","j75BA9":"Rate 6pm on App Store","tfDRzk":"Save","uF9ruK":"Saving","WDgJiV":"Quét hoá đơn","P9vd26":"Search currency...","+O3PfQ":"Select account","PtoMco":"Select budget type","5dfUzo":"Select period type","RoafuO":"Send feedback","Tz0i8g":"Cài đặt","RDprz0":"Share with friends","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ý","TOm5Xo":"Specific dates","Q14cFX":"Spending","D+NlUC":"Hệ thống","IL5Ibf":"Take a picture of your transaction","Yrrg+y":"Target","KWUgwY":"Terms & Conditions","Emv+V7":"Terms of use","OR1t9P":"This will delete the transaction. Are you sure you want to continue?","w4eKlT":"To date","ecUA8p":"Today","BRMXj0":"Tomorrow","38Gho6":"Transaction created","6D8usS":"transaction note","+zy2Nq":"Type","b2vAoQ":"Uncategorized","Ef7StM":"Unknown","QQX2/q":"Unlocks full AI power and more!","KALubG":"ver.","AdWhjZ":"Mã xác nhận","fROFIL":"Tiếng Việt","q19YJ1":"Wallet account name","rUcnTU":"Wallet accounts","mdad9N":"Wallet Accounts","4XSc4l":"Weekly","zkWmBh":"Yearly","y/0uwd":"Yesterday"}', ) diff --git a/apps/mobile/stores/user-settings/hooks.ts b/apps/mobile/stores/user-settings/hooks.ts new file mode 100644 index 00000000..6ac8ed8e --- /dev/null +++ b/apps/mobile/stores/user-settings/hooks.ts @@ -0,0 +1,10 @@ +import { getLocales } from 'expo-localization' +import { useUserSettingsStore } from './store' + +const deviceCurrency = getLocales()[0]?.currencyCode + +export function useDefaultCurrency() { + const { preferredCurrency } = useUserSettingsStore() + + return preferredCurrency || deviceCurrency || 'USD' +} diff --git a/apps/mobile/stores/user-settings/store.ts b/apps/mobile/stores/user-settings/store.ts new file mode 100644 index 00000000..7601015e --- /dev/null +++ b/apps/mobile/stores/user-settings/store.ts @@ -0,0 +1,21 @@ +import AsyncStorage from '@react-native-async-storage/async-storage' +import { create } from 'zustand' +import { createJSONStorage, persist } from 'zustand/middleware' + +interface UserSettingsStore { + preferredCurrency?: string + setPreferredCurrency: (preferredCurrency: string) => void +} + +export const useUserSettingsStore = create()( + persist( + (set) => ({ + preferredCurrency: undefined, + setPreferredCurrency: (preferredCurrency) => set({ preferredCurrency }), + }), + { + name: 'user-settings-storage', + storage: createJSONStorage(() => AsyncStorage), + }, + ), +)