From 1a0085c12fcab9f4b7a97132aa64019a00eb2459 Mon Sep 17 00:00:00 2001 From: Michael Chappell <7581002+mchappell@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:25:15 +0000 Subject: [PATCH] feat: add faq to migration flow (#963) * feat: update initial migration state from settings when selecting 'upgrade wallet' beta link from settings, begin the migration from it's initial state instead of in progress * feat: add FAQ link to every migration screen * fix: end all slide descriptions with punctuation * feat: remove previously dismissed migration on settings click --- .../nami-migration-client.extension.ts | 8 ++++++-- src/ui/app/pages/settings.jsx | 4 ++-- .../components/all-done/all-done.component.jsx | 2 +- .../almost-there/almost-there.component.jsx | 17 ++++++++++++++--- .../carousel/slides/Slide1.component.jsx | 2 +- .../carousel/slides/Slide2.component.jsx | 2 +- .../no-wallet/no-wallet.component.jsx | 2 +- .../components/slide.component.jsx | 10 ++++++++++ 8 files changed, 36 insertions(+), 11 deletions(-) diff --git a/src/api/migration-tool/cross-extension-messaging/nami-migration-client.extension.ts b/src/api/migration-tool/cross-extension-messaging/nami-migration-client.extension.ts index c7bdd1db..de8ef4a9 100644 --- a/src/api/migration-tool/cross-extension-messaging/nami-migration-client.extension.ts +++ b/src/api/migration-tool/cross-extension-messaging/nami-migration-client.extension.ts @@ -30,10 +30,14 @@ export const dismissMigration = ({ }); }; -export const disableMigration = () => - storage.local.set({ +export const disableMigration = async () => { + const date = new Date(); + const timeInPast = date.setTime(date.getTime() - 1000); + await storage.local.set({ + [DISMISS_MIGRATION_UNTIL]: timeInPast, [MIGRATION_KEY]: MigrationState.None, }); +}; export const handleLaceMigrationRequests = () => runtime.onMessageExternal.addListener( diff --git a/src/ui/app/pages/settings.jsx b/src/ui/app/pages/settings.jsx index 7fb913e9..bfc4f58a 100644 --- a/src/ui/app/pages/settings.jsx +++ b/src/ui/app/pages/settings.jsx @@ -52,11 +52,11 @@ import { Events } from '../../../features/analytics/events'; import { LegalSettings } from '../../../features/settings/legal/LegalSettings'; import { usePostHog } from 'posthog-js/react'; import { useFeatureFlagsContext } from '../../../features/feature-flags/provider'; -import { enableMigration } from '../../../api/migration-tool/cross-extension-messaging/nami-migration-client.extension'; import { MigrationState, MIGRATION_KEY, } from '../../../api/migration-tool/migrator/migration-state.data'; +import { disableMigration } from '../../../api/migration-tool/cross-extension-messaging/nami-migration-client.extension'; import { storage } from 'webextension-polyfill'; const Settings = () => { @@ -129,7 +129,7 @@ const Overview = () => { width="65%" rightIcon={} onClick={async () => { - await enableMigration(); + await disableMigration(); }} > { )} } - description="Your Nami wallet is now part of the Lace family" + description="Your Nami wallet is now part of the Lace family." buttonText={isLaceInstalled ? 'Open Lace' : 'Download Lace'} buttonIcon={Arrow} onButtonClick={onAction} diff --git a/src/ui/lace-migration/components/almost-there/almost-there.component.jsx b/src/ui/lace-migration/components/almost-there/almost-there.component.jsx index efe964c6..56a5554f 100644 --- a/src/ui/lace-migration/components/almost-there/almost-there.component.jsx +++ b/src/ui/lace-migration/components/almost-there/almost-there.component.jsx @@ -6,12 +6,19 @@ import { ReactComponent as Arrow } from '../../assets/arrow.svg'; import { ReactComponent as PendingDark } from '../../assets/pending-dark-mode.svg'; import { ReactComponent as PendingWhite } from '../../assets/pending-white-mode.svg'; -export const AlmostThere = ({ isLaceInstalled, onAction, isDismissable, dismissibleSeconds }) => { +export const AlmostThere = ({ + isLaceInstalled, + onAction, + isDismissable, + dismissibleSeconds, +}) => { const { colorMode } = useColorMode(); return ( {colorMode === 'light' ? ( @@ -21,7 +28,11 @@ export const AlmostThere = ({ isLaceInstalled, onAction, isDismissable, dismissi )} } - description={isLaceInstalled ? 'Your Nami wallet is now part of the Lace family' : 'Download the Lace extension to begin'} + description={ + isLaceInstalled + ? 'Your Nami wallet is now part of the Lace family.' + : 'Download the Lace extension to begin.' + } buttonText={isLaceInstalled ? 'Open Lace' : 'Download Lace'} buttonIcon={isLaceInstalled ? Arrow : Download} onButtonClick={onAction} diff --git a/src/ui/lace-migration/components/carousel/slides/Slide1.component.jsx b/src/ui/lace-migration/components/carousel/slides/Slide1.component.jsx index bfc9f87d..2d2c0fc9 100644 --- a/src/ui/lace-migration/components/carousel/slides/Slide1.component.jsx +++ b/src/ui/lace-migration/components/carousel/slides/Slide1.component.jsx @@ -14,7 +14,7 @@ export const Slide1 = ({ onAction, isDismissable, dismissibleSeconds }) => { } - description="The Nami Wallet is now integrated into Lace. Click 'Upgrade your wallet' to begin the process" + description="The Nami Wallet is now integrated into Lace. Click 'Upgrade your wallet' to begin the process." buttonText="Upgrade your wallet" buttonIcon={Arrow} onButtonClick={onAction} diff --git a/src/ui/lace-migration/components/carousel/slides/Slide2.component.jsx b/src/ui/lace-migration/components/carousel/slides/Slide2.component.jsx index d3fe808e..b3e56c2a 100644 --- a/src/ui/lace-migration/components/carousel/slides/Slide2.component.jsx +++ b/src/ui/lace-migration/components/carousel/slides/Slide2.component.jsx @@ -20,7 +20,7 @@ export const Slide2 = ({ onAction, isDismissable, dismissibleSeconds }) => { )} } - description="On the surface, Nami is the same. But now, with Lace's advanced technology supporting it" + description="On the surface, Nami is the same. But now, with Lace's advanced technology supporting it." buttonText="Upgrade your wallet" buttonIcon={Arrow} onButtonClick={onAction} diff --git a/src/ui/lace-migration/components/no-wallet/no-wallet.component.jsx b/src/ui/lace-migration/components/no-wallet/no-wallet.component.jsx index 0f09ba16..2b9bb7b6 100644 --- a/src/ui/lace-migration/components/no-wallet/no-wallet.component.jsx +++ b/src/ui/lace-migration/components/no-wallet/no-wallet.component.jsx @@ -12,7 +12,7 @@ export const NoWallet = ({ onAction, isDismissable, dismissibleSeconds }) => ( } - description="To create or import a wallet, proceed using the Lace extension" + description="To create or import a wallet, proceed using the Lace extension." buttonText="Get started with Lace" buttonIcon={LaceIcon} onButtonClick={onAction} diff --git a/src/ui/lace-migration/components/slide.component.jsx b/src/ui/lace-migration/components/slide.component.jsx index f1b8629a..616a9067 100644 --- a/src/ui/lace-migration/components/slide.component.jsx +++ b/src/ui/lace-migration/components/slide.component.jsx @@ -153,6 +153,16 @@ export const Slide = ({ {image} {description} + + FAQ +