diff --git a/.storybook/preview.js b/.storybook/preview.js index fd33f157ad40..3f6a6ed63855 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -130,7 +130,10 @@ const metamaskDecorator = (story, context) => { return ( - + undefined, diff --git a/ui/components/ui/marketing-moment/marketing-moment.test.tsx b/ui/components/ui/marketing-moment/marketing-moment.test.tsx index 5d9b2f62783e..e2a60761cf65 100644 --- a/ui/components/ui/marketing-moment/marketing-moment.test.tsx +++ b/ui/components/ui/marketing-moment/marketing-moment.test.tsx @@ -96,6 +96,18 @@ describe('MarketingMoment', () => { expect(onSecondaryClick).toHaveBeenCalledTimes(1); }); + it('keeps the actions outside the scrolling content', () => { + renderMoment(); + + const root = screen.getByTestId('marketing-moment'); + const scroller = root.querySelector('.overflow-y-auto'); + const primary = screen.getAllByRole('button')[0]; + + expect(root).toHaveClass('overflow-hidden'); + expect(scroller).not.toBeNull(); + expect(scroller).not.toContainElement(primary); + }); + it('omits every slot that is not provided', () => { renderMoment({ title: undefined, diff --git a/ui/components/ui/marketing-moment/marketing-moment.tsx b/ui/components/ui/marketing-moment/marketing-moment.tsx index 8b0b393c21d5..55c59a714be1 100644 --- a/ui/components/ui/marketing-moment/marketing-moment.tsx +++ b/ui/components/ui/marketing-moment/marketing-moment.tsx @@ -106,25 +106,40 @@ export const MarketingMoment = ({ - - {renderTitle()} - {renderDescription()} - {children} - - - {artwork ? ( + - {artwork} + {renderTitle()} + {renderDescription()} + {children} - ) : null} + + {artwork ? ( + + {artwork} + + ) : null} + {primaryAction || secondaryAction ? ( { +const CreationSuccessfulStory = () => { return ( @@ -14,4 +14,13 @@ export const DefaultStory = () => { ); }; -DefaultStory.storyName = 'Default'; +export const DefaultStory = () => ; + +DefaultStory.storyName = 'Wallet ready'; + +export const SrpBackupReminderStory = () => ; + +SrpBackupReminderStory.storyName = 'SRP backup reminder'; +SrpBackupReminderStory.parameters = { + initialEntries: ['/?isFromReminder=true'], +}; diff --git a/ui/pages/onboarding-flow/creation-successful/creation-successful.tsx b/ui/pages/onboarding-flow/creation-successful/creation-successful.tsx index 8e0d30f48a61..c59685b866b9 100644 --- a/ui/pages/onboarding-flow/creation-successful/creation-successful.tsx +++ b/ui/pages/onboarding-flow/creation-successful/creation-successful.tsx @@ -14,6 +14,10 @@ import { BoxAlignItems, TextButton, } from '@metamask/design-system-react'; +import { + MarketingMoment, + type MarketingMomentAction, +} from '../../../components/ui/marketing-moment'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { ONBOARDING_PRIVACY_SETTINGS_ROUTE, @@ -169,78 +173,92 @@ export default function CreationSuccessful() { ); }; + const openWalletDisabled = isSidePanelEnabled && isSidePanelOpen; + const handleLearnMoreClick = () => { global.platform.openTab({ url: learnMoreLink, }); }; + if (!isFromSettingsSRPBackup) { + return ( + } + artworkWrapperProps={{ + className: 'pointer-events-none h-[400px] flex-none', + }} + primaryAction={ + { + label: doneButtonLabel, + onClick: onDone, + isDisabled: openWalletDisabled, + 'data-testid': 'onboarding-complete-done', + } as MarketingMomentAction + } + secondaryAction={ + { + label: t('manageDefaultSettings'), + onClick: () => navigate(ONBOARDING_PRIVACY_SETTINGS_ROUTE), + isDisabled: openWalletDisabled, + 'data-testid': 'manage-default-settings', + } as MarketingMomentAction + } + /> + ); + } + return ( - {isFromSettingsSRPBackup && ( - - + + - - {t('yourWalletIsReadyFromReminder')} - - - {renderFox} - - - {renderDetails1} - - - {t('walletReadyLearn', [ - - {t('learnHow')} - , - ])} - + {t('yourWalletIsReadyFromReminder')} + + + {renderFox} + + {renderDetails1} + + + {t('walletReadyLearn', [ + + {t('learnHow')} + , + ])} + - )} - {!isFromSettingsSRPBackup && } - {!isFromSettingsSRPBackup && ( - {t('yourWalletIsReady')} - )} + {renderDoneButton()} - {!isFromSettingsSRPBackup && ( - - )} ); } diff --git a/ui/pages/onboarding-flow/creation-successful/index.scss b/ui/pages/onboarding-flow/creation-successful/index.scss deleted file mode 100644 index d04d5f472fd9..000000000000 --- a/ui/pages/onboarding-flow/creation-successful/index.scss +++ /dev/null @@ -1,35 +0,0 @@ -@use "design-system"; - -.creation-successful { - img { - align-self: center; - } - - .title { - text-align: center; - font-family: var(--font-family-accent); - font-size: 40px; - font-style: normal; - font-weight: 400; - line-height: 40px; /* 100% */ - letter-spacing: -0.26px; - margin-bottom: 48px; - } -} - -.riv-animation { - &__wallet-ready-container { - height: 400px; - width: 100%; - display: flex; - justify-content: center; - align-items: flex-end; - pointer-events: none; - } - - - &__canvas { - height: 100%; - width: 100%; - } -} diff --git a/ui/pages/onboarding-flow/creation-successful/wallet-ready-animation.tsx b/ui/pages/onboarding-flow/creation-successful/wallet-ready-animation.tsx index c8c41b8b04e4..4591bafcc19a 100644 --- a/ui/pages/onboarding-flow/creation-successful/wallet-ready-animation.tsx +++ b/ui/pages/onboarding-flow/creation-successful/wallet-ready-animation.tsx @@ -6,7 +6,6 @@ import { Alignment, useRiveFile, } from '@rive-app/react-canvas'; -import { Box } from '@metamask/design-system-react'; import { useTheme } from '../../../hooks/useTheme'; import { ThemeType } from '../../../../shared/constants/preferences'; import { @@ -83,12 +82,8 @@ export default function WalletReadyAnimation() { status === 'loading' || status === 'failed' ) { - return ; + return null; } - return ( - - - - ); + return ; } diff --git a/ui/pages/onboarding-flow/index.scss b/ui/pages/onboarding-flow/index.scss index 47f70a9a42cf..3dba46a4a43d 100644 --- a/ui/pages/onboarding-flow/index.scss +++ b/ui/pages/onboarding-flow/index.scss @@ -4,7 +4,6 @@ @import 'onboarding-app-header/index'; @import 'privacy-settings/index'; @import 'create-password/index'; -@import 'creation-successful/index'; @import 'welcome/index'; @import 'metametrics/index';