From 03600e5c2396f3784e1db62616f87dd4bfa9f0ab Mon Sep 17 00:00:00 2001 From: Phuong Ngo Date: Wed, 22 May 2024 09:06:25 +0700 Subject: [PATCH 1/5] Add Expo Metro runtime --- package.json | 1 + yarn.lock | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/package.json b/package.json index bbd8e94..77cb5d0 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "web": "expo start --web" }, "dependencies": { + "@expo/metro-runtime": "~3.2.1", "@react-native-async-storage/async-storage": "1.23.1", "@react-native-community/netinfo": "11.3.1", "@react-navigation/bottom-tabs": "^6.4.0", diff --git a/yarn.lock b/yarn.lock index 34513b3..95bc9ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1441,6 +1441,11 @@ postcss "~8.4.32" resolve-from "^5.0.0" +"@expo/metro-runtime@~3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@expo/metro-runtime/-/metro-runtime-3.2.1.tgz#bbab2ca9d0c8d256172eb4688123af6be67c7674" + integrity sha512-L7xNo5SmK+rcuXDm/+VBBImpA7FZsVB+m/rNr3fNl5or+1+yrZe99ViF7LZ8DOoVqAqcb4aCAXvGrP2JNYo1/Q== + "@expo/osascript@^2.0.31": version "2.0.33" resolved "https://registry.npmjs.org/@expo/osascript/-/osascript-2.0.33.tgz" From 37ff19253beee5d3e6bc950881d4199f5f8850ec Mon Sep 17 00:00:00 2001 From: Phuong Ngo Date: Wed, 22 May 2024 10:30:21 +0700 Subject: [PATCH 2/5] Add Expo font package --- package.json | 2 ++ yarn.lock | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/package.json b/package.json index 77cb5d0..2d6b064 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "web": "expo start --web" }, "dependencies": { + "@expo-google-fonts/sriracha": "^0.2.3", "@expo/metro-runtime": "~3.2.1", "@react-native-async-storage/async-storage": "1.23.1", "@react-native-community/netinfo": "11.3.1", @@ -21,6 +22,7 @@ "expo": "^51.0.8", "expo-camera": "~15.0.9", "expo-device": "~6.0.2", + "expo-font": "~12.0.5", "expo-image-picker": "~15.0.5", "expo-localization": "~15.0.3", "expo-status-bar": "~1.12.1", diff --git a/yarn.lock b/yarn.lock index 95bc9ee..22b5622 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1196,6 +1196,11 @@ deepmerge "^3.2.0" hoist-non-react-statics "^3.3.0" +"@expo-google-fonts/sriracha@^0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@expo-google-fonts/sriracha/-/sriracha-0.2.3.tgz#1e525b20c6048d6093fa76a52cddef08cb3ee6a6" + integrity sha512-CQozKvtS30hZ/6RVaTuGoeUqofJaMy9Hz35V7tNszGAZKfi1+O6fIx6a/QVcZVEe7dBcNnFn6QHkyx7zoYBrSg== + "@expo/bunyan@^4.0.0": version "4.0.0" resolved "https://registry.npmjs.org/@expo/bunyan/-/bunyan-4.0.0.tgz" From 8b6cbe3e2578edf7632328f25bd0893eb340c879 Mon Sep 17 00:00:00 2001 From: Phuong Ngo Date: Wed, 22 May 2024 10:31:13 +0700 Subject: [PATCH 3/5] Adjust some typo in nav --- src/Navigation/Main/index.tsx | 10 +++++----- src/Navigation/NavigationBar.tsx | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Navigation/Main/index.tsx b/src/Navigation/Main/index.tsx index c773522..15c2c7f 100644 --- a/src/Navigation/Main/index.tsx +++ b/src/Navigation/Main/index.tsx @@ -25,7 +25,7 @@ export const MainNavigator = () => { options={{ tabBarLabel: i18n.t(LocalizationKey.HOME), tabBarIcon: ({ color }) => ( - + ), }} /> @@ -35,7 +35,7 @@ export const MainNavigator = () => { options={{ tabBarLabel: i18n.t(LocalizationKey.TRANSACTIONS), tabBarIcon: ({ color }) => ( - + ), }} /> @@ -45,7 +45,7 @@ export const MainNavigator = () => { options={{ tabBarLabel: i18n.t(LocalizationKey.ADD), tabBarIcon: ({ color }) => ( - + ), }} /> @@ -55,7 +55,7 @@ export const MainNavigator = () => { options={{ tabBarLabel: i18n.t(LocalizationKey.WALLETS), tabBarIcon: ({ color }) => ( - + ), }} /> @@ -65,7 +65,7 @@ export const MainNavigator = () => { options={{ tabBarLabel: i18n.t(LocalizationKey.BUDGETS), tabBarIcon: ({ color }) => ( - + ), }} /> diff --git a/src/Navigation/NavigationBar.tsx b/src/Navigation/NavigationBar.tsx index 4e60cb7..28642b1 100644 --- a/src/Navigation/NavigationBar.tsx +++ b/src/Navigation/NavigationBar.tsx @@ -22,7 +22,7 @@ export const NavigationBar: FC = ({ navigation, route, o ? : null } - + ) } @@ -33,9 +33,9 @@ export const NavigationBar: FC = ({ navigation, route, o ? : null } - + - + { // TODO: logout (clear user info and disable back action) navigation.navigate(RootScreens.LOGIN); From 97ad09dafe6769d9c7fa399485c78746d34cbea4 Mon Sep 17 00:00:00 2001 From: Phuong Ngo Date: Wed, 22 May 2024 10:31:47 +0700 Subject: [PATCH 4/5] Add loading screen --- src/Components/Brand.tsx | 22 +++++++++++++++ src/Components/Loading.tsx | 58 ++++++++++++++++++++++++++++++++++++++ src/Components/Logo.tsx | 25 ++++++++++++++++ src/Components/index.ts | 3 ++ 4 files changed, 108 insertions(+) create mode 100644 src/Components/Brand.tsx create mode 100644 src/Components/Loading.tsx create mode 100644 src/Components/Logo.tsx diff --git a/src/Components/Brand.tsx b/src/Components/Brand.tsx new file mode 100644 index 0000000..c0d732f --- /dev/null +++ b/src/Components/Brand.tsx @@ -0,0 +1,22 @@ +import { Colors } from "@/Theme"; +import { Sriracha_400Regular, useFonts } from "@expo-google-fonts/sriracha"; +import React, { FC } from "react"; +import { Text } from "react-native"; + +export const Brand: FC<{size: number}> = ({ size }) => { + let [fontsLoaded, fontError] = useFonts({Sriracha_400Regular}); + + if (!fontsLoaded && !fontError) { + return null; + } + + return ( + + Finwise + + ) +} \ No newline at end of file diff --git a/src/Components/Loading.tsx b/src/Components/Loading.tsx new file mode 100644 index 0000000..cf4060c --- /dev/null +++ b/src/Components/Loading.tsx @@ -0,0 +1,58 @@ +import { View } from "native-base"; +import React from "react"; +import { StyleSheet } from "react-native"; +import { Logo } from "./Logo"; +import { Brand } from "./Brand"; +import { ActivityIndicator, Text } from "react-native-paper"; +import { Language, LocalizationKey, i18n } from "@/Localization"; +import { Colors } from "@/Theme"; + +export const Loading = () => { + return ( + + + + + { i18n.locale === Language.ENGLISH + ? + + Make wise financial moves with + + : + + Tài chính thông minh + dẫn bước cùng + + } + + + + {i18n.t(LocalizationKey.LOADING)} + + + ) +} + +const styles = StyleSheet.create({ + container: { + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + gap: 20, + backgroundColor: Colors.NEUTRAL99, + height: '100%' + }, + logo: { + alignItems: 'center' + }, + slogan: { + alignItems: 'center' + }, + loading: { + display: 'flex', + gap: 20, + position: 'absolute', + bottom: 0, + marginBottom: 20 + } +}) \ No newline at end of file diff --git a/src/Components/Logo.tsx b/src/Components/Logo.tsx new file mode 100644 index 0000000..80ae01c --- /dev/null +++ b/src/Components/Logo.tsx @@ -0,0 +1,25 @@ +import * as React from "react"; +import Svg, { SvgProps, Path } from "react-native-svg"; + +export const Logo = (props: SvgProps) => ( + + + + + +) diff --git a/src/Components/index.ts b/src/Components/index.ts index e69de29..569b627 100644 --- a/src/Components/index.ts +++ b/src/Components/index.ts @@ -0,0 +1,3 @@ +export * from "./Brand"; +export * from "./Loading"; +export * from "./Logo"; \ No newline at end of file From 33a6263ce934d0c1983c37175c29029e3534b327 Mon Sep 17 00:00:00 2001 From: Phuong Ngo Date: Wed, 22 May 2024 10:32:34 +0700 Subject: [PATCH 5/5] Loading preview in Budgets tab --- src/Screens/Budgets/BudgetsContainer.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Screens/Budgets/BudgetsContainer.tsx b/src/Screens/Budgets/BudgetsContainer.tsx index cf33191..ededbc8 100644 --- a/src/Screens/Budgets/BudgetsContainer.tsx +++ b/src/Screens/Budgets/BudgetsContainer.tsx @@ -1,9 +1,12 @@ +import { Loading } from "@/Components/Loading"; import React from "react"; +import { View } from "react-native"; export const BudgetsContainer = () => { // TODO return ( - <> - + + + ) } \ No newline at end of file