Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Cancel check in now pops an Alert (#1413)
Browse files Browse the repository at this point in the history
  • Loading branch information
smcmurtry authored Feb 15, 2021
1 parent b8e387b commit 67f892a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 32 deletions.
5 changes: 2 additions & 3 deletions src/locale/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -499,16 +499,15 @@
},
"CheckInView": {
"Title": "Scanned",
"CTA1": "Ok",
"CTA1": "OK",
"CTA2": "Cancel",
"MoreInfo": "Learn more about QR codes and COVID alert"
},
"Exposed": {
"Title": "You've been Exposed"
},
"CancelCheckIn": {
"Title": "Successfully cancelled check in",
"Body": "You have successfully cancelled this check in, you may close this screen"
"Title": "Scan cancelled"
},
"ScanAPlace": {
"Title": "Scan a place",
Expand Down
5 changes: 4 additions & 1 deletion src/locale/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@
},
"CheckInView": {
"Title": "Lieu scanné",
"CTA1": "Ok",
"CTA1": "OK",
"CTA2": "Annuler la visite",
"MoreInfo": "Annuler"
},
Expand All @@ -500,6 +500,9 @@
"CTA": "Autoriser l’accès dans les paramètres",
"CTA2": "En savoir plus sur Scanner un lieu"
},
"CancelCheckIn": {
"Title": "FR Scan cancelled"
},
"ScanAPlace": {
"Title": "Scanner un lieu",
"Body": "Vous pouvez être notifié si des personnes contagieuses ont visité le même lieu que vous. Lorsque vous scannez un code QR Alerte COVID à l’entrée d’un lieu, l’application l’enregistre sur votre téléphone.\n\nLes lieux que vous visitez",
Expand Down
2 changes: 1 addition & 1 deletion src/locale/translations/index.js

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions src/navigation/MainNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {QRCodeReaderScreen} from 'screens/qr/QRCodeReaderScreen';
import {DismissAlertScreen} from 'screens/home/views/ClearExposureView';
import {FrameworkUnavailableView} from 'screens/home/views/FrameworkUnavailableView';
import {CheckInSuccessfulScreen} from 'screens/qr/CheckInSuccessfulScreen';
import {CheckInCancelScreen} from 'screens/qr/CheckInCancelScreen';
import {InvalidQRCodeScreen} from 'screens/qr/InvalidQRCodeScreen';
import {LearnAboutQRScreen} from 'screens/qr/LearnAboutQRScreen';
import {CheckInHistoryScreen} from 'screens/qr/CheckInHistoryScreen';
Expand Down Expand Up @@ -97,7 +96,6 @@ const ErrorScreenWithNavBar = withDarkNav(ErrorScreen);
const DismissAlertScreenWithNavBar = withDarkNav(DismissAlertScreen);
const QRCodeReaderScreenWithNavBar = withDarkNav(QRCodeReaderScreen);
const CheckInSuccessfulScreenWithNavBar = withDarkNav(CheckInSuccessfulScreen);
const CheckInCancelScreenWithNavBar = withDarkNav(CheckInCancelScreen);
const InvalidQRCodeScreenWithNavBar = withDarkNav(InvalidQRCodeScreen);
const LearnAboutQRScreenWithNavBar = withDarkNav(LearnAboutQRScreen);
const OnboardingWithNavBar = withDarkNavNonModal(OnboardingScreen);
Expand Down Expand Up @@ -152,7 +150,6 @@ const QRCodeNavigator = () => {
<QRCodeStack.Screen name="QRCodeReaderScreen" component={QRCodeReaderScreenWithNavBar} />
<QRCodeStack.Screen name="InvalidQRCodeScreen" component={InvalidQRCodeScreenWithNavBar} />
<QRCodeStack.Screen name="CheckInSuccessfulScreen" component={CheckInSuccessfulScreenWithNavBar} />
<QRCodeStack.Screen name="CheckInCancelScreen" component={CheckInCancelScreenWithNavBar} />
<QRCodeStack.Screen name="LearnAboutQRScreen" component={LearnAboutQRScreenWithNavBar} />
<QRCodeStack.Screen name="QRCodeIntroScreen" component={QRCodeIntroScreenWithNavBar} />
</QRCodeStack.Navigator>
Expand Down
21 changes: 0 additions & 21 deletions src/screens/qr/CheckInCancelScreen.tsx

This file was deleted.

8 changes: 5 additions & 3 deletions src/screens/qr/CheckInSuccessfulScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {useCallback} from 'react';
import {Alert} from 'react-native';
import {Box, Button, Text, Icon, InfoBlock} from 'components';
import {useNavigation} from '@react-navigation/native';
import {useI18n} from 'locale';
Expand All @@ -18,11 +19,12 @@ export const CheckInSuccessfulScreen = ({route}: CheckInSuccessfulRoute) => {
const i18n = useI18n();
const navigation = useNavigation();
const navigateHome = useCallback(() => navigation.navigate('Home'), [navigation]);
const navigateCancelCheckIn = useCallback(() => navigation.navigate('CheckInCancelScreen'), [navigation]);
const popAlert = useCallback(() => Alert.alert('', i18n.translate('QRCode.CancelCheckIn.Title')), [i18n]);
const cancelCheckIn = useCallback(() => {
removeCheckIn();
navigateCancelCheckIn();
}, [removeCheckIn, navigateCancelCheckIn]);
popAlert();
navigateHome();
}, [removeCheckIn, popAlert, navigateHome]);

return (
<BaseQRCodeScreen>
Expand Down

0 comments on commit 67f892a

Please sign in to comment.