Skip to content

Commit

Permalink
added cursor and closehandler
Browse files Browse the repository at this point in the history
  • Loading branch information
abhipatel0211 committed Feb 2, 2024
1 parent 0d7753c commit 8b94deb
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ const TwoFactorEmailModal = ({ onConfirm, onClose, emailOrUsername, invalidAttem
};

const id = useUniqueId();
const onCloseHandler = () => {
try {
if (typeof onClose === 'function') {
onClose();
// Change the URL without triggering a full page reload
window.location.href = 'http://localhost:3000';
}
} catch (error) {
console.error('Error in onClose function:', error);
}
};

return (
<GenericModal
Expand All @@ -53,6 +64,7 @@ const TwoFactorEmailModal = ({ onConfirm, onClose, emailOrUsername, invalidAttem
confirmText={t('Verify')}
title={t('Two-factor_authentication_email')}
onClose={onClose}
onClick={onCloseHandler}
variant='warning'
icon='info'
confirmDisabled={!code}
Expand All @@ -68,7 +80,7 @@ const TwoFactorEmailModal = ({ onConfirm, onClose, emailOrUsername, invalidAttem
{invalidAttempt && <FieldError>{t('Invalid_password')}</FieldError>}
</Field>
</FieldGroup>
<Box display='flex' justifyContent='end' is='a' onClick={onClickResendCode}>
<Box style={{ cursor: 'pointer' }} display='flex' justifyContent='end' is='a' onClick={onClickResendCode}>
{t('Cloud_resend_email')}
</Box>
</GenericModal>
Expand Down

0 comments on commit 8b94deb

Please sign in to comment.