feat: add qr code on account activation dialog#82
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| "jest-transform-stub": "2.0.0", | ||
| "lodash": "^4.18.1", | ||
| "prettier": "^3.5.3", | ||
| "qrcode-generator": "^2.0.4", |
There was a problem hiding this comment.
same package as extension, but not sure if mobile is working or not
There was a problem hiding this comment.
Pull request overview
Replaces the textual "method 1 / method 2" funding instructions on the account activation prompt with a QR code of the user's Stellar address, and switches that dialog to the alert type. Also pulls in a qrcode-generator dependency and adds many new translation keys that appear unrelated to QR support.
Changes:
- Add
qrcode-generatordependency and a newgenerateAddressQrCodehelper that returns an SVG string. - Redesign
AccountActivationPromptto show the QR code, address, and two description lines; remove the per-method icons/copy and their assets/translation keys. - Extend
showDialogwith an optional dialogtypeparameter and use'alert'for the account activation prompt; add a large batch of unrelated locale strings toen.json/es.json.
Reviewed changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/snap/package.json | Adds qrcode-generator@^2.0.4 dependency. |
| yarn.lock | Lockfile entry for qrcode-generator. |
| packages/snap/src/ui/confirmation/qrcode.ts | New helper generating an SVG QR code for a Stellar address. |
| packages/snap/src/ui/confirmation/views/AccountActivationPrompt/AccountActivationPrompt.tsx | Replaces method icons/sections with a QR code + address + two description lines. |
| packages/snap/src/ui/confirmation/views/AccountActivationPrompt/render.tsx | Passes 'alert' to showDialog. |
| packages/snap/src/utils/snap.ts | Adds optional type parameter to showDialog. |
| packages/snap/src/ui/images/index.ts | Removes exports for the now-unused method icons. |
| packages/snap/src/ui/images/account-active-method-1.svg, account-active-method-2.svg | Deletes the unused method icon assets. |
| packages/snap/messages.json | Updates activation copy, adds description2, removes method1/method2 keys. |
| packages/snap/locales/en.json | Mirrors messages.json changes for account activation copy. |
| packages/snap/locales/es.json | Adds a large block of locale keys (most unrelated to QR support) plus activation copy updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </Box> | ||
| </Section> | ||
| </Box> | ||
| <Footer> |
There was a problem hiding this comment.
the custom dialog has bug, sometime it show 2 buttons (default cancel + close button)
so we going back to use alert dialog with no self button customization
Explanation
qrcode-generatordependency and a newgenerateAddressQrCodehelper that returns an SVG string.AccountActivationPromptto show the QR code, address, and two description lines; remove the per-method icons/copy and their assets/translation keys.showDialogwith an optional dialogtypeparameter and use'alert'for the account activation prompt; add a large batch of unrelated locale strings toen.json/es.json.FIgma: link
References
Checklist