Improve user feedback and modal behavior in ErrorReportModal and PolicyUpdateModal
This commit is contained in:
@@ -329,7 +329,7 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
|||||||
level='body-sm'
|
level='body-sm'
|
||||||
sx={{ color: 'text.secondary', mt: 0.5 }}
|
sx={{ color: 'text.secondary', mt: 0.5 }}
|
||||||
>
|
>
|
||||||
Thanks — this goes straight to the people who can fix it.
|
Thanks! this goes straight to the people who can fix it.
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
|
|||||||
@@ -27,13 +27,16 @@ const PolicyUpdateModal = ({ onAcknowledge, onClose, open }) => {
|
|||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const { ResponsiveModal } = useResponsiveModal()
|
const { ResponsiveModal } = useResponsiveModal()
|
||||||
|
|
||||||
const handleClose = () => {
|
// Acknowledgement is the only way out: the backdrop, escape key, and close
|
||||||
|
// button are all disabled so the user must press "Got it".
|
||||||
|
const handleAcknowledge = () => {
|
||||||
onAcknowledge?.()
|
onAcknowledge?.()
|
||||||
onClose()
|
onClose()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reading a document must not dismiss the notice; the modal is still waiting
|
||||||
|
// on an acknowledgement when the user returns from the browser.
|
||||||
const openDocument = path => {
|
const openDocument = path => {
|
||||||
handleClose()
|
|
||||||
openUrl(`${POLICY_BASE_URL}${path}`)
|
openUrl(`${POLICY_BASE_URL}${path}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +50,10 @@ const PolicyUpdateModal = ({ onAcknowledge, onClose, open }) => {
|
|||||||
return (
|
return (
|
||||||
<ResponsiveModal
|
<ResponsiveModal
|
||||||
open={open}
|
open={open}
|
||||||
onClose={handleClose}
|
onClose={handleAcknowledge}
|
||||||
|
closeOnBackdrop={false}
|
||||||
|
closeOnEscape={false}
|
||||||
|
showCloseButton={false}
|
||||||
size='sm'
|
size='sm'
|
||||||
title={t('policyUpdate.title')}
|
title={t('policyUpdate.title')}
|
||||||
description={t('policyUpdate.subtitle')}
|
description={t('policyUpdate.subtitle')}
|
||||||
@@ -55,7 +61,7 @@ const PolicyUpdateModal = ({ onAcknowledge, onClose, open }) => {
|
|||||||
<ModalActions
|
<ModalActions
|
||||||
primary={{
|
primary={{
|
||||||
label: t('policyUpdate.acknowledge'),
|
label: t('policyUpdate.acknowledge'),
|
||||||
onClick: handleClose,
|
onClick: handleAcknowledge,
|
||||||
sx: { width: { xs: '100%', sm: 'auto' } },
|
sx: { width: { xs: '100%', sm: 'auto' } },
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user