-
Notifications
You must be signed in to change notification settings - Fork 5.2k
feat(solana): update add account from opt in solana #31387
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
feat(solana): update add account from opt in solana #31387
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
✨ Files requiring CODEOWNER review ✨🖥️ @MetaMask/wallet-ux
|
579925b
to
dd50ee7
Compare
Builds ready [dd50ee7]
UI Startup Metrics (1209 ± 62 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
handleModalClose(); | ||
}} | ||
/> | ||
)} |
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 is this in parallel with the normal notifications Modal?
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.
Well it technically is a part of the flow from the notification modal, but I didn't want to use the notification modal itself, as it's a bit limited in terms of the structure (header, content and footer) and it was easier to add it next to it and just hide notification when user decides to add new account.
const SNAP_CLIENT_CONFIG_MAP: Record< | ||
string, | ||
{ clientType: WalletClientType | null; chainId: CaipChainId | null } | ||
> = { | ||
[MultichainNetworks.BITCOIN]: { | ||
clientType: WalletClientType.Bitcoin, | ||
chainId: MultichainNetworks.BITCOIN, | ||
}, | ||
[MultichainNetworks.BITCOIN_TESTNET]: { | ||
clientType: WalletClientType.Bitcoin, | ||
chainId: MultichainNetworks.BITCOIN_TESTNET, | ||
}, | ||
[MultichainNetworks.SOLANA]: { | ||
clientType: WalletClientType.Solana, | ||
chainId: MultichainNetworks.SOLANA, | ||
}, | ||
}; |
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've seen this before somewhere
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.
It's a similar map, but is using network instead of action (used in account menu) as a key
@@ -0,0 +1,107 @@ | |||
import React from 'react'; |
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.
Doesnt this already exist as create-snap-account
?
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.
Actually this one is using create-snap-account
, it's just a modal that uses it, it was needed as we don't have modal open, as we had in case of network or account modal flow.
41f898d
to
0e253f6
Compare
Builds ready [0e253f6]
UI Startup Metrics (1220 ± 51 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
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.
LGTM!
What's new modal shows up ✅
User able to add Solana account from Modal ✅
0e253f6
to
b668f1b
Compare
Builds ready [b668f1b]
UI Startup Metrics (1220 ± 53 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
</Modal> | ||
<> | ||
<Modal | ||
onClose={() => null} |
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 is this null
? Do we not want to allow the user to close this via the x
?
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 do, but it's done with:
<modal.header.component onClose={onClose} image={image} />
I changed it to null, because it was also triggered by some other flow, where we didn't want to close it yet.
b668f1b
to
7c104c0
Compare
7c104c0
to
b9a1540
Compare
Builds ready [b9a1540]
UI Startup Metrics (1289 ± 62 ms)
|
Description
This PR updates the flow of adding new Solana account from the Whats new modal to be consistent with the flow from accounts picker. It also allows user to pick which SRP to use if there are more than one SRP added.
Related issues
Depends on: #31358
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist