From dc8f6b286f7fea3b66662f5d0d82642824cd7b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= <100827540+reneaaron@users.noreply.github.com> Date: Fri, 19 Jul 2024 18:34:53 +0200 Subject: [PATCH] feat: onboarding checklist (#294) * feat: sequential checklist * fix: add numbers, change order --- frontend/src/screens/channels/Channels.tsx | 4 +- .../screens/wallet/OnboardingChecklist.tsx | 53 +++++++++++-------- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/frontend/src/screens/channels/Channels.tsx b/frontend/src/screens/channels/Channels.tsx index a8ccc8c5..e46640da 100644 --- a/frontend/src/screens/channels/Channels.tsx +++ b/frontend/src/screens/channels/Channels.tsx @@ -617,7 +617,7 @@ export default function Channels() { {!channels || (channels.length > 0 && ( - +
Status @@ -642,7 +642,7 @@ export default function Channels() { -
+
Spending
Receiving
diff --git a/frontend/src/screens/wallet/OnboardingChecklist.tsx b/frontend/src/screens/wallet/OnboardingChecklist.tsx index 8464f733..59bd9073 100644 --- a/frontend/src/screens/wallet/OnboardingChecklist.tsx +++ b/frontend/src/screens/wallet/OnboardingChecklist.tsx @@ -72,7 +72,7 @@ function OnboardingChecklist() { const checklistItems = [ { - title: "Open your first channel", + title: "1. Open your first channel", description: "Establish a new Lightning channel to enable fast and low-fee Bitcoin transactions.", checked: hasChannel, @@ -81,18 +81,18 @@ function OnboardingChecklist() { : "/channels/outgoing", }, { - title: "Send or receive your first payment", + title: "2. Link to your Alby Account", + description: "Link your lightning address & other apps to this Hub.", + checked: isLinked, + to: "/apps", + }, + { + title: "3. Send or receive your first payment", description: "Use your newly opened channel to make a transaction on the Lightning Network.", checked: hasTransaction, to: "/wallet", }, - { - title: "Link to your Alby Account", - description: "Link your lightning address & other apps to this Hub.", - checked: isLinked, - to: "/apps", - }, // TODO: enable when we can always migrate funds /*{ title: "Migrate your balance to your Hub", @@ -101,7 +101,7 @@ function OnboardingChecklist() { to: "/onboarding/lightning/migrate-alby", },*/ { - title: "Connect your first app", + title: "4. Connect your first app", description: "Seamlessly connect apps and integrate your wallet with other apps from your Hub.", checked: hasCustomApp, @@ -110,7 +110,7 @@ function OnboardingChecklist() { ...(hasMnemonic ? [ { - title: "Backup your keys", + title: "5. Backup your keys", description: "Secure your keys by creating a backup to ensure you don't lose access.", checked: hasBackedUp, @@ -124,6 +124,8 @@ function OnboardingChecklist() { (a, b) => (b && b.checked ? 1 : 0) - (a && a.checked ? 1 : 0) ); + const nextStep = checklistItems.find((x) => !x.checked); + return ( @@ -134,15 +136,20 @@ function OnboardingChecklist() { - {sortedChecklistItems.map((item) => ( - - ))} + {sortedChecklistItems.map((item) => { + const disabled = nextStep === item; + + return ( + + ); + })} ); @@ -153,6 +160,7 @@ type ChecklistItemProps = { checked: boolean; description: string; to: string; + disabled: boolean; }; function ChecklistItem({ @@ -160,15 +168,16 @@ function ChecklistItem({ checked = false, description, to, + disabled = false, }: ChecklistItemProps) { const content = (
- {!checked && ( + {!checked && !disabled && (
@@ -194,7 +203,7 @@ function ChecklistItem({
); - return checked ? content : {content}; + return checked || disabled ? content : {content}; } export default OnboardingChecklist;