Browse Source

ran linter

pull/9/head
Nareshkumar Rao 3 years ago
parent
commit
16bdd75903
  1. 32
      src/i18n.js
  2. 2
      src/index.js
  3. 70
      src/locales/en/common.json
  4. 70
      src/locales/ms/common.json
  5. 36
      src/screens/HomeScreen.js
  6. 30
      src/screens/LockoutScreen.js
  7. 58
      src/screens/LoginScreen.js
  8. 12
      src/screens/ScannerScreen.js
  9. 6
      src/screens/SuccessScreen.js
  10. 8
      src/screens/VerifyScreen.js

32
src/i18n.js

@ -1,8 +1,8 @@
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import enTranslation from "./locales/en/common.json";
import msTranslation from "./locales/ms/common.json";
import enTranslation from './locales/en/common.json';
import msTranslation from './locales/ms/common.json';
const resources = { const resources = {
en: { en: {
@ -10,19 +10,17 @@ const resources = {
}, },
ms: { ms: {
common: msTranslation, common: msTranslation,
}
},
}; };
i18n
.use(initReactI18next)
.init({
resources,
lng: "ms",
defaultNS: 'common',
interpolation: {
escapeValue: false
},
debug:true
});
i18n.use(initReactI18next).init({
resources,
lng: 'ms',
defaultNS: 'common',
interpolation: {
escapeValue: false,
},
debug: true,
});
export default i18n;
export default i18n;

2
src/index.js

@ -6,7 +6,7 @@ import App from './App';
import { store } from './app/store'; import { store } from './app/store';
import reportWebVitals from './reportWebVitals'; import reportWebVitals from './reportWebVitals';
import * as serviceWorker from './serviceWorker'; import * as serviceWorker from './serviceWorker';
import "./i18n"
import './i18n';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
require('dotenv').config(); require('dotenv').config();

70
src/locales/en/common.json

@ -1,49 +1,49 @@
{ {
"appTitle": "OurSejahtera Contact Tracing",
"appTitle": "OurSejahtera Contact Tracing",
"homeExplanation": "This is your QR code. Show this to others to allow them to confirm a contact, or allow them to create an account!",
"scanButtonLabel": "Scan a QR Code",
"homeExplanation": "This is your QR code. Show this to others to allow them to confirm a contact, or allow them to create an account!",
"scanButtonLabel": "Scan a QR Code",
"donateButtonLabel": "Donate!",
"donateButtonParagraph": "Servers require money to run, and apps require labor to develop and maintain. You can show your support by donating what you can. Every cent counts, buy me my next coffee, or help pay for a month of server usage!",
"donateButtonLabel": "Donate!",
"donateButtonParagraph": "Servers require money to run, and apps require labor to develop and maintain. You can show your support by donating what you can. Every cent counts, buy me my next coffee, or help pay for a month of server usage!",
"logOutButtonLabel": "Log Out!",
"logOutButtonLabel": "Log Out!",
"covidPositiveReportButton": "Report Positive COVID19",
"covidPositiveAlertHeader": "Confirm Tested COVID19 Positive",
"covidPositiveAlertBody": "Please confirm that you have been tested POSITIVE with COVID19. Upon confirmation, this app will inform the people you have come in contact with in the last 7 days.",
"covidPositiveReportButton": "Report Positive COVID19",
"covidPositiveAlertHeader": "Confirm Tested COVID19 Positive",
"covidPositiveAlertBody": "Please confirm that you have been tested POSITIVE with COVID19. Upon confirmation, this app will inform the people you have come in contact with in the last 7 days.",
"confirm": "Confirm",
"cancel": "Cancel",
"confirm": "Confirm",
"cancel": "Cancel",
"errorToastTitle": "Error!",
"defaultErrorToastDescription": "An error has occured.",
"confirmedToastTitle": "Confirmed!",
"confirmingToastTitle": "Confirming",
"confirmingToastDescription": "Hold on while we confirm with our servers.",
"notLoggedInToastDescription": "You are not logged in!",
"failedLoginToastTitle": "Login Failed",
"failedLoginToastDescription": "The wrong credentials were used",
"loggingInToastTitle": "Logging you in",
"loggingInToastDescription": "Hold on, we're logging you in.",
"checkingLockoutToastTitle": "Checking your lockout status...",
"badVerificationToastTitle": "Bad Verification",
"badQRCodeToastTitle": "Bad QR Code",
"contactLoggedToastTitle": "Contact Successfully Logged",
"checkingQRToastTitle": "Hold on, we're checking this QR code.",
"errorToastTitle": "Error!",
"defaultErrorToastDescription": "An error has occured.",
"confirmedToastTitle": "Confirmed!",
"confirmingToastTitle": "Confirming",
"confirmingToastDescription": "Hold on while we confirm with our servers.",
"notLoggedInToastDescription": "You are not logged in!",
"failedLoginToastTitle": "Login Failed",
"failedLoginToastDescription": "The wrong credentials were used",
"loggingInToastTitle": "Logging you in",
"loggingInToastDescription": "Hold on, we're logging you in.",
"checkingLockoutToastTitle": "Checking your lockout status...",
"badVerificationToastTitle": "Bad Verification",
"badQRCodeToastTitle": "Bad QR Code",
"contactLoggedToastTitle": "Contact Successfully Logged",
"checkingQRToastTitle": "Hold on, we're checking this QR code.",
"login": "Login",
"login": "Login",
"loginPrivacyNotice": "<0><0>Privacy notes:</0> <br/>Telegram Login allows us to verify your identity, without collecting any of your data. Telegram does NOT give us your phone number. The only piece of information stored on our server is your Telegram ID, this is an internal ID Number Telegram uses that is SEPARATE from your Telegram Username.<br/><br/>All the code for this project is <8>Open Source</8>, that means anyone, including you can audit and verify that your information is being handled securely.</0>",
"loginPrivacyNotice": "<0><0>Privacy notes:</0> <br/>Telegram Login allows us to verify your identity, without collecting any of your data. Telegram does NOT give us your phone number. The only piece of information stored on our server is your Telegram ID, this is an internal ID Number Telegram uses that is SEPARATE from your Telegram Username.<br/><br/>All the code for this project is <8>Open Source</8>, that means anyone, including you can audit and verify that your information is being handled securely.</0>",
"lockout": "Lockout",
"lockoutExplanation": "<0>You have reported that you have been tested <1>POSITIVE</1> with COVID19. This lockout is to remind you to quarantine yourself according to local COVID19 health policies. This lockout will automatically be lifted after 14 days.<br/><br/><5>Please avoid contact with other people for the duration of this lockout!</5></0>",
"lockout": "Lockout",
"lockoutExplanation": "<0>You have reported that you have been tested <1>POSITIVE</1> with COVID19. This lockout is to remind you to quarantine yourself according to local COVID19 health policies. This lockout will automatically be lifted after 14 days.<br/><br/><5>Please avoid contact with other people for the duration of this lockout!</5></0>",
"showQRCode": "Show my QR Code",
"showQRCode": "Show my QR Code",
"contactSavedParagraph": "We have succesfully saved your contact! Stay safe out there, and let others scan your QR code too!",
"returnHomeButtonLabel": "Return home",
"contactSavedParagraph": "We have succesfully saved your contact! Stay safe out there, and let others scan your QR code too!",
"returnHomeButtonLabel": "Return home",
"verifyingParagraph": "We are currently verifying you. Please wait.",
"verifyingErrorParagraph": "An error has occured verifying you. Please try scanning the QR code again?"
"verifyingParagraph": "We are currently verifying you. Please wait.",
"verifyingErrorParagraph": "An error has occured verifying you. Please try scanning the QR code again?"
} }

70
src/locales/ms/common.json

@ -1,49 +1,49 @@
{ {
"appTitle": "OurSejahtera Contact Tracing",
"appTitle": "OurSejahtera Contact Tracing",
"homeExplanation": "Inilah kod QR anda. Show this to others to allow them to confirm a contact!",
"scanButtonLabel": "Mengimbas kod QR",
"homeExplanation": "Inilah kod QR anda. Show this to others to allow them to confirm a contact!",
"scanButtonLabel": "Mengimbas kod QR",
"donateButtonLabel": "Menderma!",
"donateButtonParagraph": "Servers require money to run, and apps require labor to develop and maintain. You can show your support by donating what you can. Every cent counts, buy me my next coffee, or help pay for a month of server usage!",
"donateButtonLabel": "Menderma!",
"donateButtonParagraph": "Servers require money to run, and apps require labor to develop and maintain. You can show your support by donating what you can. Every cent counts, buy me my next coffee, or help pay for a month of server usage!",
"logOutButtonLabel": "Daftar keluar!",
"logOutButtonLabel": "Daftar keluar!",
"covidPositiveReportButton": "Lapor kes COVID19",
"covidPositiveAlertHeader": "Confirm Tested COVID19 Positive",
"covidPositiveAlertBody": "Please confirm that you have been tested POSITIVE with COVID19. Upon confirmation, this app will inform the people you have come in contact with in the last 7 days.",
"covidPositiveReportButton": "Lapor kes COVID19",
"covidPositiveAlertHeader": "Confirm Tested COVID19 Positive",
"covidPositiveAlertBody": "Please confirm that you have been tested POSITIVE with COVID19. Upon confirmation, this app will inform the people you have come in contact with in the last 7 days.",
"confirm": "Confirm",
"cancel": "Cancel",
"confirm": "Confirm",
"cancel": "Cancel",
"errorToastTitle": "Error!",
"defaultErrorToastDescription": "An error has occured.",
"confirmedToastTitle": "Confirmed!",
"confirmingToastTitle": "Confirming",
"confirmingToastDescription": "Hold on while we confirm with our servers.",
"notLoggedInToastDescription": "You are not logged in!",
"failedLoginToastTitle": "Login Failed",
"failedLoginToastDescription": "The wrong credentials were used",
"loggingInToastTitle": "Logging you in",
"loggingInToastDescription": "Hold on, we're logging you in.",
"checkingLockoutToastTitle": "Checking your lockout status...",
"badVerificationToastTitle": "Bad Verification",
"badQRCodeToastTitle": "Bad QR Code",
"contactLoggedToastTitle": "Contact Successfully Logged",
"checkingQRToastTitle": "Hold on, we're checking this QR code.",
"errorToastTitle": "Error!",
"defaultErrorToastDescription": "An error has occured.",
"confirmedToastTitle": "Confirmed!",
"confirmingToastTitle": "Confirming",
"confirmingToastDescription": "Hold on while we confirm with our servers.",
"notLoggedInToastDescription": "You are not logged in!",
"failedLoginToastTitle": "Login Failed",
"failedLoginToastDescription": "The wrong credentials were used",
"loggingInToastTitle": "Logging you in",
"loggingInToastDescription": "Hold on, we're logging you in.",
"checkingLockoutToastTitle": "Checking your lockout status...",
"badVerificationToastTitle": "Bad Verification",
"badQRCodeToastTitle": "Bad QR Code",
"contactLoggedToastTitle": "Contact Successfully Logged",
"checkingQRToastTitle": "Hold on, we're checking this QR code.",
"login": "Login",
"login": "Login",
"loginPrivacyNotice": "<0><0>Privacy notes:</0> <br/>Telegram Login allows us to verify your identity, without collecting any of your data. Telegram does NOT give us your phone number. The only piece of information stored on our server is your Telegram ID, this is an internal ID Number Telegram uses that is SEPARATE from your Telegram Username.<br/><br/>All the code for this project is <8>Open Source</8>, that means anyone, including you can audit and verify that your information is being handled securely.</0>",
"loginPrivacyNotice": "<0><0>Privacy notes:</0> <br/>Telegram Login allows us to verify your identity, without collecting any of your data. Telegram does NOT give us your phone number. The only piece of information stored on our server is your Telegram ID, this is an internal ID Number Telegram uses that is SEPARATE from your Telegram Username.<br/><br/>All the code for this project is <8>Open Source</8>, that means anyone, including you can audit and verify that your information is being handled securely.</0>",
"lockout": "Lockout",
"lockoutExplanation": "<0>You have reported that you have been tested <1>POSITIVE</1> with COVID19. This lockout is to remind you to quarantine yourself according to local COVID19 health policies. This lockout will automatically be lifted after 14 days.<br/><br/><5>Please avoid contact with other people for the duration of this lockout!</5></0>",
"lockout": "Lockout",
"lockoutExplanation": "<0>You have reported that you have been tested <1>POSITIVE</1> with COVID19. This lockout is to remind you to quarantine yourself according to local COVID19 health policies. This lockout will automatically be lifted after 14 days.<br/><br/><5>Please avoid contact with other people for the duration of this lockout!</5></0>",
"showQRCode": "Show my QR Code",
"showQRCode": "Show my QR Code",
"contactSavedParagraph": "We have succesfully saved your contact! Stay safe out there, and let others scan your QR code too!",
"returnHomeButtonLabel": "Return home",
"contactSavedParagraph": "We have succesfully saved your contact! Stay safe out there, and let others scan your QR code too!",
"returnHomeButtonLabel": "Return home",
"verifyingParagraph": "We are currently verifying you. Please wait.",
"verifyingErrorParagraph": "An error has occured verifying you. Please try scanning the QR code again?"
"verifyingParagraph": "We are currently verifying you. Please wait.",
"verifyingErrorParagraph": "An error has occured verifying you. Please try scanning the QR code again?"
} }

36
src/screens/HomeScreen.js

@ -59,10 +59,10 @@ function ConfirmCOVIDPositiveAlertDialog() {
const onClose = () => { const onClose = () => {
setOpen(false); setOpen(false);
}; };
const showErrorToast = (errorMessage = t("defaultErrorToastDescription")) => {
const showErrorToast = (errorMessage = t('defaultErrorToastDescription')) => {
toast.closeAll(); toast.closeAll();
toast({ toast({
title: t("errorToastTitle"),
title: t('errorToastTitle'),
description: errorMessage, description: errorMessage,
status: 'error', status: 'error',
duration: 5000, duration: 5000,
@ -70,8 +70,8 @@ function ConfirmCOVIDPositiveAlertDialog() {
}; };
const onConfirm = () => { const onConfirm = () => {
toast({ toast({
title: t("confirmingToastTitle"),
description: t("confirmingToastDescription"),
title: t('confirmingToastTitle'),
description: t('confirmingToastDescription'),
status: 'info', status: 'info',
duration: 10000, duration: 10000,
}); });
@ -88,7 +88,7 @@ function ConfirmCOVIDPositiveAlertDialog() {
dispatch(setCovidPositive()); dispatch(setCovidPositive());
toast.closeAll(); toast.closeAll();
toast({ toast({
title: t("confirmedToastTitle"),
title: t('confirmedToastTitle'),
status: 'info', status: 'info',
duration: 2000, duration: 2000,
}); });
@ -100,7 +100,7 @@ function ConfirmCOVIDPositiveAlertDialog() {
console.log(err); console.log(err);
try { try {
if (err.response.status === 401) { if (err.response.status === 401) {
showErrorToast(t("notLoggedInToastDescription"));
showErrorToast(t('notLoggedInToastDescription'));
history.push('/login'); history.push('/login');
} else { } else {
showErrorToast(); showErrorToast();
@ -122,7 +122,7 @@ function ConfirmCOVIDPositiveAlertDialog() {
setOpen(true); setOpen(true);
}} }}
> >
{t("covidPositiveReportButton")}
{t('covidPositiveReportButton')}
</Button> </Button>
<AlertDialog <AlertDialog
isOpen={isOpen} isOpen={isOpen}
@ -132,17 +132,15 @@ function ConfirmCOVIDPositiveAlertDialog() {
<AlertDialogOverlay> <AlertDialogOverlay>
<AlertDialogContent> <AlertDialogContent>
<AlertDialogHeader> <AlertDialogHeader>
{t("covidPositiveAlertHeader")}
{t('covidPositiveAlertHeader')}
</AlertDialogHeader> </AlertDialogHeader>
<AlertDialogBody>
{t("covidPositiveAlertBody")}
</AlertDialogBody>
<AlertDialogBody>{t('covidPositiveAlertBody')}</AlertDialogBody>
<AlertDialogFooter> <AlertDialogFooter>
<Button ref={cancelRef} onClick={onClose}> <Button ref={cancelRef} onClick={onClose}>
{t("cancel")}
{t('cancel')}
</Button> </Button>
<Button colorScheme="red" onClick={onConfirm} ml={3}> <Button colorScheme="red" onClick={onConfirm} ml={3}>
{t("confirm")}
{t('confirm')}
</Button> </Button>
</AlertDialogFooter> </AlertDialogFooter>
</AlertDialogContent> </AlertDialogContent>
@ -199,7 +197,7 @@ function Home() {
> >
<QRCode /> <QRCode />
<Text mb={6} align="center" fontSize="lg"> <Text mb={6} align="center" fontSize="lg">
{t("homeExplanation")}
{t('homeExplanation')}
</Text> </Text>
<Divider mb={6} /> <Divider mb={6} />
<Button <Button
@ -208,26 +206,24 @@ function Home() {
history.push('/scanner'); history.push('/scanner');
}} }}
> >
{t("scanButtonLabel")}
{t('scanButtonLabel')}
</Button> </Button>
{process.env.REACT_APP_DONATE_LINK && ( {process.env.REACT_APP_DONATE_LINK && (
<Fragment> <Fragment>
<Divider mb={6} /> <Divider mb={6} />
<Link href={process.env.REACT_APP_DONATE_LINK}> <Link href={process.env.REACT_APP_DONATE_LINK}>
<Button style={{ width: '100% ' }} mb={6} colorScheme="blue"> <Button style={{ width: '100% ' }} mb={6} colorScheme="blue">
{t("donateButtonlabel")}
{t('donateButtonlabel')}
</Button> </Button>
</Link> </Link>
<Text mb={6}>
{t("donateButtonParagraph")}
</Text>
<Text mb={6}>{t('donateButtonParagraph')}</Text>
</Fragment> </Fragment>
)} )}
<Divider mb={6} /> <Divider mb={6} />
<ConfirmCOVIDPositiveAlertDialog /> <ConfirmCOVIDPositiveAlertDialog />
<Divider mb={6} /> <Divider mb={6} />
<Button colorScheme="blackAlpha" mb={6} onClick={handleLogout}> <Button colorScheme="blackAlpha" mb={6} onClick={handleLogout}>
{t("logOutButtonLabel")}
{t('logOutButtonLabel')}
</Button> </Button>
</Flex> </Flex>
</Flex> </Flex>

30
src/screens/LockoutScreen.js

@ -20,7 +20,7 @@ function Lockout() {
useEffect(() => { useEffect(() => {
toast({ toast({
title: t("checkingLockoutToastTitle"),
title: t('checkingLockoutToastTitle'),
status: 'info', status: 'info',
duration: 10000, duration: 10000,
}); });
@ -46,7 +46,7 @@ function Lockout() {
history.push('/login'); history.push('/login');
} else { } else {
toast({ toast({
title: t("defaultErrorToastDescription"),
title: t('defaultErrorToastDescription'),
status: 'error', status: 'error',
duration: 10000, duration: 10000,
}); });
@ -74,20 +74,20 @@ function Lockout() {
rounded={6} rounded={6}
id="contentFlex" id="contentFlex"
> >
<Heading>{t("Lockout")}</Heading>
<Heading>{t('Lockout')}</Heading>
<Trans i18nKey="lockoutExplanation"> <Trans i18nKey="lockoutExplanation">
<Text>
You have reported that you have been tested <b>POSITIVE</b> with
COVID19. This lockout is to remind you to quarantine yourself
according to local COVID19 health policies. This lockout will
automatically be lifted after 14 days.
<br />
<br />
<b>
Please avoid contact with other people for the duration of this
lockout!
</b>
</Text>
<Text>
You have reported that you have been tested <b>POSITIVE</b> with
COVID19. This lockout is to remind you to quarantine yourself
according to local COVID19 health policies. This lockout will
automatically be lifted after 14 days.
<br />
<br />
<b>
Please avoid contact with other people for the duration of this
lockout!
</b>
</Text>
</Trans> </Trans>
</Flex> </Flex>
</Flex> </Flex>

58
src/screens/LoginScreen.js

@ -19,8 +19,8 @@ function Login() {
const handleTelegramResponse = response => { const handleTelegramResponse = response => {
toast({ toast({
title: t("loggingInToastTitle"),
description: t("loggingInToastDescription"),
title: t('loggingInToastTitle'),
description: t('loggingInToastDescription'),
status: 'info', status: 'info',
duration: 10000, duration: 10000,
isClosable: false, isClosable: false,
@ -48,7 +48,7 @@ function Login() {
toast.closeAll(); toast.closeAll();
dispatch(authLogout()); dispatch(authLogout());
toast({ toast({
title: t("defaultErrorToastDescription"),
title: t('defaultErrorToastDescription'),
description: response.data.message, description: response.data.message,
status: 'error', status: 'error',
duration: 9000, duration: 9000,
@ -62,8 +62,8 @@ function Login() {
if (err.response.status === 401) { if (err.response.status === 401) {
dispatch(authLogout()); dispatch(authLogout());
toast({ toast({
title: t("failedLoginToastTitle"),
description: t("failedLoginToastDescription"),
title: t('failedLoginToastTitle'),
description: t('failedLoginToastDescription'),
status: 'error', status: 'error',
duration: 9000, duration: 9000,
isClosable: true, isClosable: true,
@ -71,8 +71,8 @@ function Login() {
} }
} else { } else {
toast({ toast({
title: t("errorToastTitle"),
description: t("defaultErrorToastDescription"),
title: t('errorToastTitle'),
description: t('defaultErrorToastDescription'),
status: 'error', status: 'error',
duration: 9000, duration: 9000,
isClosable: true, isClosable: true,
@ -98,10 +98,10 @@ function Login() {
id="contentFlex" id="contentFlex"
> >
<Heading size="xl" mb={6}> <Heading size="xl" mb={6}>
{t("appTitle")}
{t('appTitle')}
</Heading> </Heading>
<Heading size="lg" mb={4}> <Heading size="lg" mb={4}>
{t("login")}
{t('login')}
</Heading> </Heading>
<TelegramLoginButton <TelegramLoginButton
dataOnauth={handleTelegramResponse} dataOnauth={handleTelegramResponse}
@ -109,26 +109,26 @@ function Login() {
/> />
<Divider mb={6} mt={6} /> <Divider mb={6} mt={6} />
<Trans i18nKey="loginPrivacyNotice"> <Trans i18nKey="loginPrivacyNotice">
<Text fontSize="sm">
<b>Privacy notes:</b> <br />
Telegram Login allows us to verify your identity, without collecting
any of your data. Telegram does NOT give us your phone number. The
only piece of information stored on our server is your Telegram ID,
this is an internal ID Number Telegram uses that is SEPARATE from your
Telegram Username.
<br />
<br />
All the code for this project is{' '}
<Link
color="teal.500"
href="https://github.com/naresh97/our-sejahtera"
isExternal
>
Open Source
</Link>
, that means anyone, including you can audit and verify that your
information is being handled securely.
</Text>
<Text fontSize="sm">
<b>Privacy notes:</b> <br />
Telegram Login allows us to verify your identity, without collecting
any of your data. Telegram does NOT give us your phone number. The
only piece of information stored on our server is your Telegram ID,
this is an internal ID Number Telegram uses that is SEPARATE from
your Telegram Username.
<br />
<br />
All the code for this project is{' '}
<Link
color="teal.500"
href="https://github.com/naresh97/our-sejahtera"
isExternal
>
Open Source
</Link>
, that means anyone, including you can audit and verify that your
information is being handled securely.
</Text>
</Trans> </Trans>
</Flex> </Flex>
</Flex> </Flex>

12
src/screens/ScannerScreen.js

@ -34,7 +34,7 @@ function Scanner() {
const hash = re.exec(scanData); const hash = re.exec(scanData);
if (hash) { if (hash) {
toast({ toast({
title: t("checkingQRToastTitle"),
title: t('checkingQRToastTitle'),
status: 'info', status: 'info',
duration: 10000, duration: 10000,
isClosable: false, isClosable: false,
@ -52,13 +52,13 @@ function Scanner() {
if (res.data.loggedIn) { if (res.data.loggedIn) {
toast.closeAll(); toast.closeAll();
toast({ toast({
title: t("contactLoggedToastTitle"),
title: t('contactLoggedToastTitle'),
status: 'info', status: 'info',
duration: 2000, duration: 2000,
}); });
} else { } else {
toast({ toast({
title: t("notLoggedInToastDescription"),
title: t('notLoggedInToastDescription'),
status: 'error', status: 'error',
duration: 2000, duration: 2000,
}); });
@ -70,7 +70,7 @@ function Scanner() {
.catch(e => { .catch(e => {
toast.closeAll(); toast.closeAll();
toast({ toast({
title: t("badVerificationToastTitle"),
title: t('badVerificationToastTitle'),
status: 'error', status: 'error',
duration: 2000, duration: 2000,
}); });
@ -78,7 +78,7 @@ function Scanner() {
} else { } else {
toast.closeAll(); toast.closeAll();
toast({ toast({
title: t("badQRCodeToastTitle"),
title: t('badQRCodeToastTitle'),
status: 'error', status: 'error',
duration: 3000, duration: 3000,
isClosable: true, isClosable: true,
@ -135,7 +135,7 @@ function Scanner() {
history.push('/home'); history.push('/home');
}} }}
> >
{t("showQRCode")}
{t('showQRCode')}
</Button> </Button>
</Flex> </Flex>
</Flex> </Flex>

6
src/screens/SuccessScreen.js

@ -22,15 +22,13 @@ function Success() {
rounded={6} rounded={6}
> >
<Heading>Success!</Heading> <Heading>Success!</Heading>
<Text fontSize="lg">
{t("contactSavedParagraph")}
</Text>
<Text fontSize="lg">{t('contactSavedParagraph')}</Text>
<Button <Button
onClick={() => { onClick={() => {
history.push('/home'); history.push('/home');
}} }}
> >
{t("returnHomeButtonLabel")}
{t('returnHomeButtonLabel')}
</Button> </Button>
</Flex> </Flex>
</Flex> </Flex>

8
src/screens/VerifyScreen.js

@ -34,12 +34,8 @@ function Verify(props) {
}); });
}, [verifyError, history, verifyID]); }, [verifyError, history, verifyID]);
const errorMessage = (
<Text>{t("verifyingErrorParagraph")}</Text>
);
const loadingMessage = (
<Text>{t("verifyingParagraph")}</Text>
);
const errorMessage = <Text>{t('verifyingErrorParagraph')}</Text>;
const loadingMessage = <Text>{t('verifyingParagraph')}</Text>;
return ( return (
<Flex <Flex

Loading…
Cancel
Save