|
@ -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> |
|
|