From 41de07cc7fb165d5d7f92391d38a4bd2509a999f Mon Sep 17 00:00:00 2001 From: ieow Date: Fri, 9 May 2025 18:47:48 +0800 Subject: [PATCH 1/9] feat: new srp flow Co-authored-by: smgv --- .../ButtonSecondary/ButtonSecondary.styles.ts | 8 +- .../ButtonSecondary/ButtonSecondary.tsx | 11 +- .../ButtonSecondary/ButtonSecondary.types.ts | 5 +- .../ModalMandatory/ModalMandatory.styles.ts | 34 +- .../Modals/ModalMandatory/ModalMandatory.tsx | 39 +- .../components/Texts/Text/Text.types.ts | 1 + app/components/Nav/App/App.tsx | 20 + app/components/Nav/Main/MainNavigator.js | 6 + app/components/Nav/Main/index.js | 23 +- app/components/UI/ActionView/index.js | 136 ++- app/components/UI/BackupAlert/BackupAlert.tsx | 5 +- .../UI/BiometryButton/BiometryButton.tsx | 51 +- app/components/UI/Carousel/constants.ts | 1 + app/components/UI/Carousel/types.ts | 3 +- app/components/UI/DeleteWalletModal/index.tsx | 206 ++-- app/components/UI/DeleteWalletModal/styles.ts | 59 +- .../LoginOptionsSwitch/LoginOptionsSwitch.tsx | 55 +- app/components/UI/Navbar/index.js | 107 +- .../UI/OnboardingScreenWithBg/index.tsx | 20 +- app/components/UI/OptinMetrics/index.js | 196 ++-- .../SecurityOptionToggle.tsx | 2 +- .../UI/SecurityOptionToggle/styles.ts | 3 + app/components/UI/SeedphraseModal/index.js | 143 ++- .../UI/SkipAccountSecurityModal/index.js | 173 +-- .../UI/StyledButton/styledButtonStyles.ts | 14 +- .../Views/AccountBackupStep1/index.js | 247 ++-- .../Views/AccountBackupStep1B/index.js | 30 +- app/components/Views/ChoosePassword/index.js | 477 ++++---- .../ImportFromSecretRecoveryPhrase/index.js | 1041 +++++++++++------ .../ImportFromSecretRecoveryPhrase/styles.ts | 217 ++-- app/components/Views/Login/index.tsx | 124 +- app/components/Views/Login/styles.ts | 60 +- .../Views/ManualBackupStep1/index.js | 292 +++-- .../Views/ManualBackupStep1/styles.ts | 154 +-- .../Views/ManualBackupStep2/index.js | 506 ++++---- .../Views/ManualBackupStep2/styles.ts | 194 ++- app/components/Views/Onboarding/index.js | 360 ++++-- .../Views/OnboardingCarousel/index.tsx | 157 ++- .../Views/OnboardingSheet/index.tsx | 198 ++++ .../Views/OnboardingSuccess/index.styles.ts | 179 ++- .../Views/OnboardingSuccess/index.tsx | 353 ++++-- app/components/Views/PasswordHint/index.tsx | 182 +++ app/components/Views/ResetPassword/index.js | 329 ++++-- .../RevealPrivateCredential.tsx | 3 +- .../Views/RevealPrivateCredential/styles.ts | 1 + .../ChangePassword/ChangePassword.tsx | 15 +- .../Views/SuccessErrorSheet/index.styles.ts | 40 + .../Views/SuccessErrorSheet/index.tsx | 169 +++ app/constants/navigation/Routes.ts | 10 + app/constants/storage.ts | 2 +- app/styles/common.ts | 19 + app/util/termsOfUse/termsOfUse.ts | 10 +- .../SecurityPrivacyView.selectors.js | 1 + e2e/selectors/wallet/LoginView.selectors.js | 1 + 54 files changed, 4415 insertions(+), 2277 deletions(-) create mode 100644 app/components/Views/OnboardingSheet/index.tsx create mode 100644 app/components/Views/PasswordHint/index.tsx create mode 100644 app/components/Views/SuccessErrorSheet/index.styles.ts create mode 100644 app/components/Views/SuccessErrorSheet/index.tsx diff --git a/app/component-library/components/Buttons/Button/variants/ButtonSecondary/ButtonSecondary.styles.ts b/app/component-library/components/Buttons/Button/variants/ButtonSecondary/ButtonSecondary.styles.ts index be621e6e94bd..667127e9ed26 100644 --- a/app/component-library/components/Buttons/Button/variants/ButtonSecondary/ButtonSecondary.styles.ts +++ b/app/component-library/components/Buttons/Button/variants/ButtonSecondary/ButtonSecondary.styles.ts @@ -20,13 +20,17 @@ const styleSheet = (params: { }) => { const { vars, theme } = params; const { colors } = theme; - const { style, isDanger, pressed } = vars; + const { style, isDanger, pressed, overridePressedColor } = vars; const colorObj = isDanger ? colors.error : colors.primary; + const pressedColor = pressed + ? overridePressedColor || colorObj.alternative + : 'transparent'; + return StyleSheet.create({ base: Object.assign( { - backgroundColor: pressed ? colorObj.alternative : 'transparent', + backgroundColor: pressedColor, borderWidth: 1, borderColor: colorObj.default, } as ViewStyle, diff --git a/app/component-library/components/Buttons/Button/variants/ButtonSecondary/ButtonSecondary.tsx b/app/component-library/components/Buttons/Button/variants/ButtonSecondary/ButtonSecondary.tsx index df5e9e426bdd..43bbd57c9c3e 100644 --- a/app/component-library/components/Buttons/Button/variants/ButtonSecondary/ButtonSecondary.tsx +++ b/app/component-library/components/Buttons/Button/variants/ButtonSecondary/ButtonSecondary.tsx @@ -26,6 +26,7 @@ const ButtonSecondary = ({ onPressOut, isDanger = false, label, + overridePressedColor, ...props }: ButtonSecondaryProps) => { const [pressed, setPressed] = useState(false); @@ -33,6 +34,7 @@ const ButtonSecondary = ({ style, isDanger, pressed, + overridePressedColor, }); const triggerOnPressedIn = useCallback( @@ -72,9 +74,12 @@ const ButtonSecondary = ({ label ); - const renderLoading = () => ( - - ); + const renderLoading = () => ( + + ); return ( +