-
Notifications
You must be signed in to change notification settings - Fork 463
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
[Seedless-Onboarding] export account #2610
Conversation
Branch preview✅ Deploy successful! https://seedless_export_pk--walletweb.review-wallet-web.5afe.dev |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
0752271
to
09a1626
Compare
src/components/settings/ExportMPCAccount/ExportMPCAccountModal.tsx
Outdated
Show resolved
Hide resolved
src/components/settings/ExportMPCAccount/ExportMPCAccountModal.tsx
Outdated
Show resolved
Hide resolved
src/components/settings/ExportMPCAccount/ExportMPCAccountModal.tsx
Outdated
Show resolved
Hide resolved
ESLint Summary View Full Report
Report generated by eslint-plus-action |
Coverage report
Show files with reduced coverage 🔻
Test suite run success991 tests passing in 140 suites. Report generated by 🧪jest coverage report action from ad3e34f |
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.
Looks good 👍 We might want to hide the form if the user is not connected via Google but we can also do it in a separate PR and maybe even for the whole settings page instead of each section.
|
||
const ExportMPCAccountModal = ({ onClose, open }: { onClose: () => void; open: boolean }) => { | ||
const { exportPk } = useContext(MpcWalletContext) | ||
const [error, setError] = useState<string>() |
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.
nit: Just found out we can even use RHF to display an error separate from its input https://react-hook-form.com/docs/useformstate/errormessage
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.
Although on second thought if we set the error via RHF it will not be persisted afair so this is probably better.
setValue(ExportFieldNames.pk, pk) | ||
} catch (err) { | ||
logError(ErrorCodes._305, err) | ||
setError('Error exporting account. Your entered password might be invalid.') |
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.
Is it possible to reuse the same string that we throw from exportPk
? I would slightly reword it to sound more active e.g. Error exporting account. Make sure the password is correct.
/> | ||
</> | ||
)} | ||
{error && <ErrorMessage className={css.modalError}>{error}</ErrorMessage>} |
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 think the ErrorMessage
component adds vertical margin by default which makes the UI jump a bit more. I would suggest removing it via the css class.
What it solves
Button to export private key of a signer account.
How to test it
Navigate to
Settings->Signer account
Click export
Screenshots
Checklist