-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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: NFT token transfer #27955
feat: NFT token transfer #27955
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. |
091a8c8
to
442b449
Compare
17c115e
to
cbc3616
Compare
Builds ready [cbc3616]
Page Load Metrics (1958 ± 94 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
@@ -33,7 +33,16 @@ const Header = () => { | |||
|
|||
const { currentConfirmation } = useConfirmContext<Confirmation>(); | |||
|
|||
if (currentConfirmation?.type === TransactionType.tokenMethodTransfer) { | |||
const CONFIRMATIONS_WITH_NEW_HEADER = [ |
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.
Minor, can this go at the top of the file?
And should we use a more explicit name, what does New
mean in this context?
if ( | ||
currentConfirmation?.type && | ||
CONFIRMATIONS_WITH_NEW_HEADER.includes(currentConfirmation.type) | ||
) { |
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.
Minor, would it make the logic clearer if we remove the nesting and have flat conditions for each alternate header?
We could even put the fallback into a local component such as DefaultHeader
?
ab2e5f0
to
7cc1b27
Compare
7cc1b27
to
67c59fb
Compare
67c59fb
to
af00d32
Compare
Builds ready [af00d32]
Page Load Metrics (1831 ± 86 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
} | ||
|
||
return ( | ||
const DefaultHeader = ( |
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.
Minor, we've defined this as a nested component within the Header
component but is it slightly more readable to define it at the top level and either re-use the same hooks or pass in the properties it needs?
(currentConfirmation as TransactionMeta)?.origin === 'metamask'; | ||
if (isConfirmationWithNewHeader && isWalletInitiated) { | ||
return <WalletInitiatedHeader />; | ||
} else if (isConfirmationWithNewHeader && !isWalletInitiated) { |
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.
Minor, we're using an else
here but no need since we're returning in each condition.
currentConfirmation?.type && | ||
CONFIRMATIONS_WITH_NEW_HEADER.includes(currentConfirmation.type); | ||
const isWalletInitiated = | ||
(currentConfirmation as TransactionMeta)?.origin === 'metamask'; |
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.
Minor, could we use ORIGIN_METAMASK
here?
Description
Implements token transfer confirmation for ERC721 and ERC1155 tokens, in the cases where they are wallet initiated and dApp initiated. Includes e2e tests.
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/3018 https://github.com/MetaMask/MetaMask-planning/issues/3019
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist