From d75a062523e4d01190287dceae2d8bbb21711028 Mon Sep 17 00:00:00 2001 From: thoreyjona Date: Wed, 2 Oct 2024 12:41:49 +0000 Subject: [PATCH] feat: address minor comments from PR --- apps/native/app/src/screens/home/home.tsx | 4 ++-- apps/native/app/src/screens/update-app/update-app.tsx | 5 ++--- apps/native/app/src/utils/minimum-app-version.ts | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/native/app/src/screens/home/home.tsx b/apps/native/app/src/screens/home/home.tsx index 227ab965b753..057b658de585 100644 --- a/apps/native/app/src/screens/home/home.tsx +++ b/apps/native/app/src/screens/home/home.tsx @@ -256,7 +256,7 @@ export const MainHomeScreen: NavigationFunctionComponent = ({ const keyExtractor = useCallback((item: ListItem) => item.id, []) const scrollY = useRef(new Animated.Value(0)).current - const checkAppVersion = useCallback(async () => { + const isAppUpdateRequired = useCallback(async () => { const needsUpdate = await needsToUpdateAppVersion() if (needsUpdate) { navigateTo('/update-app', { closable: false }) @@ -270,7 +270,7 @@ export const MainHomeScreen: NavigationFunctionComponent = ({ // Get user locale from server getAndSetLocale() // Check if upgrade wall should be shown - checkAppVersion() + isAppUpdateRequired() }, []) const refetch = useCallback(async () => { diff --git a/apps/native/app/src/screens/update-app/update-app.tsx b/apps/native/app/src/screens/update-app/update-app.tsx index ae9ba5cd64fc..9f9b06863c1c 100644 --- a/apps/native/app/src/screens/update-app/update-app.tsx +++ b/apps/native/app/src/screens/update-app/update-app.tsx @@ -16,8 +16,7 @@ import { preferencesStore } from '../../stores/preferences-store' const Text = styled.View` margin-horizontal: ${({ theme }) => theme.spacing[7]}px; text-align: center; - margin-bottom: ${({ theme }) => theme.spacing[5]}px; - margin-top: ${({ theme }) => theme.spacing[5]}px; + margin-vertical: ${({ theme }) => theme.spacing[5]}px; ` const Host = styled.View` @@ -95,7 +94,7 @@ export const UpdateAppScreen: NavigationFunctionComponent<{ => { const currentVersion = DeviceInfo.getVersion() + // @example compare('2.0.0', '1.5.0', '>') => true (update needed) return compareVersions.compare(minimumVersionSupported, currentVersion, '>') }