From 963b9c49763fc1afdec82467c060e752cfcccddb Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Mon, 31 Oct 2022 10:05:37 +0100 Subject: [PATCH] improvements; bugfixes --- .../DecryptionPasswordMissingAlert.tsx | 18 ++++-- src/hooks/index.ts | 2 + src/hooks/use-navigate-to-next.ts | 27 ++++++++ .../CompleteAccountRoute/PasswordForm.tsx | 14 +++-- src/routes/CompleteAccountRoute.tsx | 63 ++++++++++++++----- 5 files changed, 100 insertions(+), 24 deletions(-) create mode 100644 src/hooks/use-navigate-to-next.ts diff --git a/src/components/DecryptionPasswordMissingAlert.tsx b/src/components/DecryptionPasswordMissingAlert.tsx index 720047f..3c798b0 100644 --- a/src/components/DecryptionPasswordMissingAlert.tsx +++ b/src/components/DecryptionPasswordMissingAlert.tsx @@ -2,7 +2,7 @@ import {useContext} from "react" import {MdLock} from "react-icons/md" import {Link as RouterLink} from "react-router-dom" -import {Button, Grid, Typography} from "@mui/material" +import {Button, Grid, Typography, useTheme} from "@mui/material" import AuthContext, {EncryptionStatus} from "~/AuthContext/AuthContext" import LockNavigationContext from "~/LockNavigationContext/LockNavigationContext" @@ -16,11 +16,19 @@ export default function DecryptionPasswordMissingAlert({ }: WithEncryptionRequiredProps): JSX.Element { const {handleAnchorClick} = useContext(LockNavigationContext) const {encryptionStatus} = useContext(AuthContext) + const theme = useTheme() switch (encryptionStatus) { case EncryptionStatus.Unavailable: { return ( - + Encryption required @@ -35,7 +43,7 @@ export default function DecryptionPasswordMissingAlert({