1
1
import React from 'react' ;
2
- import { View } from 'react-native' ;
2
+ import { NativeModules , View } from 'react-native' ;
3
3
import Button from '@components/Button' ;
4
4
import Header from '@components/Header' ;
5
5
import HeaderGap from '@components/HeaderGap' ;
6
6
import Lottie from '@components/Lottie' ;
7
7
import LottieAnimations from '@components/LottieAnimations' ;
8
8
import Text from '@components/Text' ;
9
+ import useEnvironment from '@hooks/useEnvironment' ;
9
10
import useLocalize from '@hooks/useLocalize' ;
10
11
import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
11
12
import useSafeAreaInsets from '@hooks/useSafeAreaInsets' ;
@@ -19,6 +20,10 @@ function UpdateRequiredView() {
19
20
const StyleUtils = useStyleUtils ( ) ;
20
21
const { translate} = useLocalize ( ) ;
21
22
const { shouldUseNarrowLayout} = useResponsiveLayout ( ) ;
23
+
24
+ const { isProduction} = useEnvironment ( ) ;
25
+ const isStandaloneNewAppProduction = isProduction && ! NativeModules . HybridAppModule ;
26
+
22
27
return (
23
28
< View style = { [ styles . appBG , styles . h100 , StyleUtils . getSafeAreaPadding ( insets ) ] } >
24
29
< HeaderGap />
@@ -37,17 +42,21 @@ function UpdateRequiredView() {
37
42
< View style = { [ styles . ph5 , styles . alignItemsCenter , styles . mt5 ] } >
38
43
< View style = { styles . updateRequiredViewTextContainer } >
39
44
< View style = { [ styles . mb3 ] } >
40
- < Text style = { [ styles . newKansasLarge , styles . textAlignCenter ] } > { translate ( 'updateRequiredView.pleaseInstall' ) } </ Text >
45
+ < Text style = { [ styles . newKansasLarge , styles . textAlignCenter ] } >
46
+ { isStandaloneNewAppProduction ? translate ( 'updateRequiredView.pleaseInstallExpensifyClassic' ) : translate ( 'updateRequiredView.pleaseInstall' ) }
47
+ </ Text >
41
48
</ View >
42
49
< View style = { styles . mb5 } >
43
- < Text style = { [ styles . textAlignCenter , styles . textSupporting ] } > { translate ( 'updateRequiredView.toGetLatestChanges' ) } </ Text >
50
+ < Text style = { [ styles . textAlignCenter , styles . textSupporting ] } >
51
+ { isStandaloneNewAppProduction ? translate ( 'updateRequiredView.newAppNotAvailable' ) : translate ( 'updateRequiredView.toGetLatestChanges' ) }
52
+ </ Text >
44
53
</ View >
45
54
</ View >
46
55
</ View >
47
56
< Button
48
57
success
49
58
large
50
- onPress = { ( ) => AppUpdate . updateApp ( ) }
59
+ onPress = { ( ) => AppUpdate . updateApp ( isProduction ) }
51
60
text = { translate ( 'common.update' ) }
52
61
style = { styles . updateRequiredViewTextContainer }
53
62
/>
0 commit comments