Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wallet] keep awake verification loading screen + fix upgrade screen #5007

Merged
merged 11 commits into from
Sep 24, 2020
4 changes: 2 additions & 2 deletions packages/mobile/locales/en-US/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
"networkConnectionFailed": "Could not connect with the network, please check your data connection",
"firebaseFailed": "Could not connect to Firebase",
"gasPriceUpdateFailed": "Could not update fee",
"appHasToBeUpdated": "App has to be updated",
"thisVersionIsInsecure": "This version is insecure",
"appUpdateAvailable": "App Update Available",
"appIsOutdated": "Your current version is out of date, please update to the latest version",
"update": "Update",
"qrFailedNoAddress": "QR code read failed. Reason: wallet address not found.",
"qrFailedInvalidAddress": "QR code read failed. Reason: wallet address invalid.",
Expand Down
4 changes: 2 additions & 2 deletions packages/mobile/locales/es-419/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
"networkConnectionFailed": "No se pudo conectar a la red, por favor verifica tu conexión",
"firebaseFailed": "No se pudo conectar al Firebase",
"gasPriceUpdateFailed": "No se pudo actualizar la comisión",
"appHasToBeUpdated": "La aplicación tiene que ser actualizada",
"thisVersionIsInsecure": "Esta versión es insegura.",
"appUpdateAvailable": "Actualización de la aplicación disponible",
"appIsOutdated": "Su versión actual está desactualizada, actualice a la última versión",
"update": "Actualizar",
"qrFailedNoAddress": "Código QR no se pudo leer. Motivo: no se encontró la dirección de el monedero.",
"qrFailedInvalidAddress": "Código QR no se pudo leer. Razón: la dirección de la cartera no es válida.",
Expand Down
13 changes: 8 additions & 5 deletions packages/mobile/src/app/UpgradeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@ import FullscreenCTA from '@celo/react-components/components/FullscreenCTA'
import * as React from 'react'
import { WithTranslation } from 'react-i18next'
import { Namespaces, withTranslation } from 'src/i18n'
import { navigateToWalletPlayStorePage } from 'src/utils/linking'
import { headerWithCloseButton } from 'src/navigator/Headers.v2'
import { navigateToWalletStorePage } from 'src/utils/linking'

type Props = WithTranslation

class UpgradeScreen extends React.Component<Props> {
static navigationOptions = { header: null }
static navigationOptions = {
...headerWithCloseButton,
}
Comment on lines +11 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we didn't want this screen to be closed.
Sure we want to change this now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, otherwise there is no way to close this screen if you are not in the mood of updating atm


render() {
const { t } = this.props
return (
<FullscreenCTA
title={t('appHasToBeUpdated')}
subtitle={t('thisVersionIsInsecure')}
title={t('appUpdateAvailable')}
subtitle={t('appIsOutdated')}
CTAText={t('update')}
CTAHandler={navigateToWalletPlayStorePage}
CTAHandler={navigateToWalletStorePage}
/>
)
}
Expand Down
216 changes: 88 additions & 128 deletions packages/mobile/src/app/__snapshots__/ErrorScreen.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exports[`ErrorScreen with errorMessage renders correctly 1`] = `
<RNCSafeAreaView
style={
Object {
"alignItems": "center",
"flex": 1,
"height": 1292,
"justifyContent": "space-between",
Expand All @@ -16,16 +15,21 @@ exports[`ErrorScreen with errorMessage renders correctly 1`] = `
}
>
<View
style={Object {}}
style={
Object {
"alignItems": "center",
"height": 72,
"justifyContent": "space-between",
}
}
>
<Text
style={
Object {
"color": "#2E3338",
"fontFamily": "Hind-Light",
"fontSize": 22,
"paddingBottom": 20,
"textAlign": "center",
"fontFamily": "Jost-Book",
"fontSize": 26,
"lineHeight": 32,
}
}
>
Expand All @@ -35,9 +39,9 @@ exports[`ErrorScreen with errorMessage renders correctly 1`] = `
style={
Object {
"color": "#2E3338",
"fontFamily": "Hind-Light",
"fontSize": 18,
"textAlign": "center",
"fontFamily": "Jost-Medium",
"fontSize": 22,
"lineHeight": 28,
}
}
>
Expand Down Expand Up @@ -72,86 +76,62 @@ exports[`ErrorScreen with errorMessage renders correctly 1`] = `
style={
Array [
Object {
"alignItems": "center",
"borderRadius": 3,
"flexDirection": "row",
},
Object {
"marginVertical": 10,
},
Object {
"marginBottom": 10,
},
undefined,
Object {
"backgroundColor": "#42D689",
},
]
}
>
<View
accessible={true}
focusable={true}
nativeBackgroundAndroid={
Object {
"attribute": "selectableItemBackground",
"type": "ThemeAttrAndroid",
}
}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Array [
Object {
"alignItems": "center",
"flex": 1,
"justifyContent": "center",
},
Object {
"backgroundColor": "#42D689",
"overflow": "hidden",
},
Object {
"height": 50,
},
Object {
"borderColor": "#42D689",
"borderRadius": 3,
"borderWidth": 2,
"borderRadius": 100,
},
]
}
testID="ErrorContinueButton"
>
<View
accessible={true}
focusable={true}
nativeBackgroundAndroid={
Object {
"attribute": "selectableItemBackground",
"type": "ThemeAttrAndroid",
}
}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "space-between",
"backgroundColor": "#1AB775",
"height": 48,
"justifyContent": "center",
"minWidth": 120,
"opacity": undefined,
"paddingHorizontal": 24,
"paddingVertical": 5,
}
}
testID="ErrorContinueButton"
>
<Text
style={
Array [
Object {
"fontFamily": "Hind-SemiBold",
"fontSize": 16,
},
Object {
"color": "#FFFFFF",
},
Object {
"paddingLeft": 5,
"paddingRight": 5,
},
]
Object {
"color": "#FFFFFF",
"fontFamily": "Inter-SemiBold",
"fontSize": 16,
"lineHeight": 22,
}
}
>
restartApp
Expand All @@ -167,7 +147,6 @@ exports[`ErrorScreen without errorMessage renders correctly 1`] = `
<RNCSafeAreaView
style={
Object {
"alignItems": "center",
"flex": 1,
"height": 1292,
"justifyContent": "space-between",
Expand All @@ -179,16 +158,21 @@ exports[`ErrorScreen without errorMessage renders correctly 1`] = `
}
>
<View
style={Object {}}
style={
Object {
"alignItems": "center",
"height": 72,
"justifyContent": "space-between",
}
}
>
<Text
style={
Object {
"color": "#2E3338",
"fontFamily": "Hind-Light",
"fontSize": 22,
"paddingBottom": 20,
"textAlign": "center",
"fontFamily": "Jost-Book",
"fontSize": 26,
"lineHeight": 32,
}
}
>
Expand All @@ -198,9 +182,9 @@ exports[`ErrorScreen without errorMessage renders correctly 1`] = `
style={
Object {
"color": "#2E3338",
"fontFamily": "Hind-Light",
"fontSize": 18,
"textAlign": "center",
"fontFamily": "Jost-Medium",
"fontSize": 22,
"lineHeight": 28,
}
}
>
Expand Down Expand Up @@ -235,86 +219,62 @@ exports[`ErrorScreen without errorMessage renders correctly 1`] = `
style={
Array [
Object {
"alignItems": "center",
"borderRadius": 3,
"flexDirection": "row",
},
Object {
"marginVertical": 10,
},
Object {
"marginBottom": 10,
},
undefined,
Object {
"backgroundColor": "#42D689",
},
]
}
>
<View
accessible={true}
focusable={true}
nativeBackgroundAndroid={
Object {
"attribute": "selectableItemBackground",
"type": "ThemeAttrAndroid",
}
}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Array [
Object {
"alignItems": "center",
"flex": 1,
"justifyContent": "center",
},
Object {
"backgroundColor": "#42D689",
"overflow": "hidden",
},
Object {
"height": 50,
},
Object {
"borderColor": "#42D689",
"borderRadius": 3,
"borderWidth": 2,
"borderRadius": 100,
},
]
}
testID="ErrorContinueButton"
>
<View
accessible={true}
focusable={true}
nativeBackgroundAndroid={
Object {
"attribute": "selectableItemBackground",
"type": "ThemeAttrAndroid",
}
}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "space-between",
"backgroundColor": "#1AB775",
"height": 48,
"justifyContent": "center",
"minWidth": 120,
"opacity": undefined,
"paddingHorizontal": 24,
"paddingVertical": 5,
}
}
testID="ErrorContinueButton"
>
<Text
style={
Array [
Object {
"fontFamily": "Hind-SemiBold",
"fontSize": 16,
},
Object {
"color": "#FFFFFF",
},
Object {
"paddingLeft": 5,
"paddingRight": 5,
},
]
Object {
"color": "#FFFFFF",
"fontFamily": "Inter-SemiBold",
"fontSize": 16,
"lineHeight": 22,
}
}
>
restartApp
Expand Down
6 changes: 5 additions & 1 deletion packages/mobile/src/navigator/Navigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ const commonScreens = (Navigator: typeof Stack) => {
return (
<>
<Navigator.Screen name={Screens.ErrorScreen} component={ErrorScreen} options={noHeader} />
<Navigator.Screen name={Screens.UpgradeScreen} component={UpgradeScreen} />
<Navigator.Screen
name={Screens.UpgradeScreen}
component={UpgradeScreen}
options={UpgradeScreen.navigationOptions}
/>
<Navigator.Screen
name={Screens.DappKitAccountAuth}
component={DappKitAccountScreen}
Expand Down
Loading