-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LW-10194] unify codebase of the onboarding and multi-wallet flows #1140
[LW-10194] unify codebase of the onboarding and multi-wallet flows #1140
Conversation
Allure Report
smokeTests: ✅ test report for bc54849e
|
@@ -69,7 +69,7 @@ export const postHogMultiWalletActions: PostHogMultiWalletActionsType = { | |||
WALLET_ADDED: PostHogAction.MultiWalletRestoreAdded, | |||
HD_WALLET: PostHogAction.MultiWalletRestoreHdWallet | |||
}, | |||
hw: { | |||
hardware: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
@@ -39,7 +39,7 @@ export enum TxCreationType { | |||
} | |||
|
|||
export type OnboardingFlows = 'create' | 'restore' | 'hw' | 'forgot_password' | 'onboarding'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do the same here with the naming?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to avoid unnecessary changes in this PR. Once the old onboarding implementation is removed this can be renamed - next PR
export const CreateWallet = (): JSX.Element => ( | ||
<CreateWalletProvider> | ||
{({ step }) => ( | ||
<> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a reason we removed routing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two reasons:
- I don't see a value in it, but it can lead to problems: if the user refreshes the page while on the second step then he will lack a state from the previous step
- Simpler codebase unification I guess...
<MemoryRouter initialEntries={[walletRoutePaths.newWallet.hardware.connect]}> | ||
<HardwareWallet providers={providers as Providers} /> | ||
</MemoryRouter> | ||
<> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if we remove the fragment here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look on the test files again 🙏
|
||
const wordList = wordlists.english; | ||
const DEFAULT_MNEMONIC_LENGTH = 24; | ||
const COPY_PASTE_TOOLTIP_URL = `${process.env.FAQ_URL}?question=best-practices-for-using-the-copy-to-clipboard-paste-from-clipboard-recovery-phrase-features`; | ||
|
||
export const RestoreRecoveryPhrase = (): JSX.Element => { | ||
const { t } = useTranslation(); | ||
const { forgotPasswordFlowActive, postHogActions } = useWalletOnboarding(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why get the analytics from hook if you can access them directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They differ depending on the flow: onboarding vs multi-wallet so they has to be passed from the above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot do import { postHogMultiWalletActions, postHogOnboardingActions }
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
// delete "forgot_password" related data if user leaves the flow before completing | ||
const clearWallet = () => { | ||
deleteFromLocalStorage('wallet'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have keys for the magic strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me check and improve that in a subsequent cleanup PR 😉
...tension-wallet/src/views/browser-view/features/wallet-setup/components/WalletSetupWizard.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is some amazing refactoring. Well-done @szymonmaslowski 🚀
Looks generally good to me, but I don't have enough context on the multi-wallet code, would be a good idea to add @lucas-barros or @renanvalentin as a reviewer.
...-wallet/src/views/browser-view/features/multi-wallet/hardware-wallet/ErrorDialog.module.scss
Outdated
Show resolved
Hide resolved
...er-extension-wallet/src/views/browser-view/features/multi-wallet/hardware-wallet/context.tsx
Show resolved
Hide resolved
...ension-wallet/src/views/browser-view/features/multi-wallet/hardware-wallet/steps/Connect.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a reply. I think I also have an outstanding https://github.com/input-output-hk/lace/pull/1140/files#r1594016659 comment which wasn't addressed.
a9fca6a
to
786b901
Compare
d2009df
to
bc54849
Compare
Quality Gate passedIssues Measures |
Checklist
Proposed solution
Adjust the multi-wallet code to be generic and able to be used for both multi-wallet and onboarding flows.
This PR creates some amount of dead code which will be removed in the subsequent cleanup PR.
Testing
All onboarding, multi-wallet and forgot password should work as exected without any change in a behavior.
Screenshots
Attach screenshots here if implementation involves some UI changes