-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: Implement unstaking confirmation #13921
base: main
Are you sure you want to change the base?
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. |
|
b9938cc
to
657a0c7
Compare
657a0c7
to
bc92294
Compare
|
||
|
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.
} | ||
}), | ||
}); | ||
expect(getByText('Withdrawal time')).toBeDefined(); |
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.
To confirm, is this is the confirmed copy? Figma is using "Unstaking time"
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 confirmed with Saya that we want to keep withdrawal time, the designs will be updated
AccountsController: { | ||
internalAccounts: { | ||
accounts: { | ||
'0x0000000000000000000000000000000000000000': { | ||
address: '0x0000000000000000000000000000000000000000', | ||
}, | ||
}, | ||
selectedAccount: '0x0000000000000000000000000000000000000000', | ||
}, | ||
}, |
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.
Does it make sense to put this AccountsController
state into stakingWithdrawalConfirmationState
? It looks a needed state almost all tests.
// eslint-disable-next-line import/no-namespace | ||
import * as ConfirmationRedesignEnabled from '../hooks/useConfirmationRedesignEnabled'; | ||
|
||
import { merge } from 'lodash'; |
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 we make package imports on top of file
// eslint-disable-next-line import/no-namespace | ||
import * as ConfirmationRedesignEnabled from '../hooks/useConfirmationRedesignEnabled'; | ||
|
||
import { merge } from 'lodash'; |
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 we make package imports on top of file
import styleSheet from './AdvancedDetails.styles'; | ||
|
||
const AdvancedDetails = () => { | ||
const { styles } = useStyles(styleSheet, {}); | ||
const transactionMeta = useTransactionMetadataRequest(); | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<InfoSectionAccordion header={strings('stake.advanced_details')}> |
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.
If we think of this component as a generic one - does it make sense to change stake.advanced_details
to confirmations.advanced_details
or something similar?
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 am not sure if we will use this component as generic to more confirmation types. InfoSectionAccordion can be leveraged for other advanced details, but the internals will need to be changed significantly if we wanted to reuse this specific component.
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.
If we don't think this as generic component then this is just an extra file hop in the StakingDeposit
file. If nothing on this component will be re-used - then would it make sense do
<InfoSectionAccordion header={strings('stake.advanced_details')}>
<ContractInteractionDetails variant={ContractInteractionDetailsVariant.StakingDeposit} />
</InfoSectionAccordion>
instead of
<AdvancedDetails />
in StakingDeposit
?
Because similar thing has done in StakingWithdrawal
already
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.
fair enough, I'll remove the advanced details file 👍
<Text>{strings('stake.ethereum_mainnet')}</Text> | ||
</View> | ||
</InfoRow> | ||
<ContractInteractionDetails variant={ContractInteractionDetailsVariant.StakingDeposit} /> |
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.
As similar note above, what do we think of deriving variant
in ContractInteractionDetails
? Because if this is a generic AdvancedDetails
component then it shouldn't rely on any variant passed by this component.
We could also fix these similar queries by introducing ConfirmationContext
as we do in extension. I will probably introduce ConfirmationContext
in #13919
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 good thought, I will change to using the transaction type internally in the contract interaction details instead of the variant.
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, on related note if ContractInteractionDetails
is just purpose of serving those details only for staking operations - maybe we could rename this into StakingContractInteractionDetails
. Since we are planning to give code ownership to them it would be more clear if we rename like that. We could do this change later - it's not urgent, just flagging here.
|
9482b67
to
16d6d56
Compare
|
Description
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/4379
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist