From 5d05596b4d3bc730aba3211e4e6316ade51f60bd Mon Sep 17 00:00:00 2001 From: Usame Algan <5880855+usame-algan@users.noreply.github.com> Date: Mon, 23 Oct 2023 17:10:45 +0200 Subject: [PATCH] fix: Address design review, restructure components (#2683) --- .../common/ConnectWallet/PasswordRecovery.tsx | 2 +- .../ExportMPCAccountModal.tsx | 2 +- .../SocialSignerExport}/index.tsx | 10 ++-- .../SocialSignerExport}/styles.module.css | 0 .../SocialSignerMFA}/PasswordInput.tsx | 0 .../SocialSignerMFA}/helper.ts | 0 .../SocialSignerMFA/index.test.tsx} | 2 +- .../SocialSignerMFA/index.tsx} | 30 ++++++----- .../SocialSignerMFA}/styles.module.css | 0 .../settings/SecurityLogin/index.tsx | 51 +++++++++++++++++++ .../settings/SignerAccountMFA/index.tsx | 23 --------- .../sidebar/SidebarNavigation/config.tsx | 8 +-- .../welcome/WelcomeLogin/WalletLogin.tsx | 2 +- .../__tests__/WalletLogin.test.tsx | 2 - src/config/routes.ts | 4 +- src/pages/settings/security-login.tsx | 23 +++++++++ src/pages/settings/signer-account.tsx | 50 ------------------ 17 files changed, 106 insertions(+), 103 deletions(-) rename src/components/settings/{ExportMPCAccount => SecurityLogin/SocialSignerExport}/ExportMPCAccountModal.tsx (98%) rename src/components/settings/{ExportMPCAccount => SecurityLogin/SocialSignerExport}/index.tsx (72%) rename src/components/settings/{ExportMPCAccount => SecurityLogin/SocialSignerExport}/styles.module.css (100%) rename src/components/settings/{SignerAccountMFA => SecurityLogin/SocialSignerMFA}/PasswordInput.tsx (100%) rename src/components/settings/{SignerAccountMFA => SecurityLogin/SocialSignerMFA}/helper.ts (100%) rename src/components/settings/{SignerAccountMFA/PasswordForm.test.tsx => SecurityLogin/SocialSignerMFA/index.test.tsx} (96%) rename src/components/settings/{SignerAccountMFA/PasswordForm.tsx => SecurityLogin/SocialSignerMFA/index.tsx} (89%) rename src/components/settings/{SignerAccountMFA => SecurityLogin/SocialSignerMFA}/styles.module.css (100%) create mode 100644 src/components/settings/SecurityLogin/index.tsx delete mode 100644 src/components/settings/SignerAccountMFA/index.tsx create mode 100644 src/pages/settings/security-login.tsx delete mode 100644 src/pages/settings/signer-account.tsx diff --git a/src/components/common/ConnectWallet/PasswordRecovery.tsx b/src/components/common/ConnectWallet/PasswordRecovery.tsx index 053a533a27..d5c47fff6c 100644 --- a/src/components/common/ConnectWallet/PasswordRecovery.tsx +++ b/src/components/common/ConnectWallet/PasswordRecovery.tsx @@ -13,7 +13,7 @@ import { import { useState } from 'react' import Track from '../Track' import { FormProvider, useForm } from 'react-hook-form' -import PasswordInput from '@/components/settings/SignerAccountMFA/PasswordInput' +import PasswordInput from '@/components/settings/SecurityLogin/SocialSignerMFA/PasswordInput' type PasswordFormData = { password: string diff --git a/src/components/settings/ExportMPCAccount/ExportMPCAccountModal.tsx b/src/components/settings/SecurityLogin/SocialSignerExport/ExportMPCAccountModal.tsx similarity index 98% rename from src/components/settings/ExportMPCAccount/ExportMPCAccountModal.tsx rename to src/components/settings/SecurityLogin/SocialSignerExport/ExportMPCAccountModal.tsx index efffab0b71..b51a9c7282 100644 --- a/src/components/settings/ExportMPCAccount/ExportMPCAccountModal.tsx +++ b/src/components/settings/SecurityLogin/SocialSignerExport/ExportMPCAccountModal.tsx @@ -5,7 +5,7 @@ import { Box, Button, DialogContent, DialogTitle, IconButton, TextField, Typogra import { useContext, useState } from 'react' import { useForm } from 'react-hook-form' import { Visibility, VisibilityOff, Close } from '@mui/icons-material' -import css from './styles.module.css' +import css from '@/components/settings/SecurityLogin/SocialSignerExport/styles.module.css' import ErrorCodes from '@/services/exceptions/ErrorCodes' import { logError } from '@/services/exceptions' import ErrorMessage from '@/components/tx/ErrorMessage' diff --git a/src/components/settings/ExportMPCAccount/index.tsx b/src/components/settings/SecurityLogin/SocialSignerExport/index.tsx similarity index 72% rename from src/components/settings/ExportMPCAccount/index.tsx rename to src/components/settings/SecurityLogin/SocialSignerExport/index.tsx index d8c2b43601..46900f325a 100644 --- a/src/components/settings/ExportMPCAccount/index.tsx +++ b/src/components/settings/SecurityLogin/SocialSignerExport/index.tsx @@ -1,19 +1,19 @@ import { Alert, Box, Button, Typography } from '@mui/material' import { useState } from 'react' -import ExportMPCAccountModal from './ExportMPCAccountModal' +import ExportMPCAccountModal from '@/components/settings/SecurityLogin/SocialSignerExport/ExportMPCAccountModal' -const ExportMPCAccount = () => { +const SocialSignerExport = () => { const [isModalOpen, setIsModalOpen] = useState(false) return ( <> - Accounts created via Google can be exported and imported to any non-custodial wallet outside of Safe. + Signers created via Google can be exported and imported to any non-custodial wallet outside of Safe. Never disclose your keys or seed phrase to anyone. If someone gains access to them, they have full access over - your signer account. + your social login signer.