-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add max tooltip for staking with gas fee consideration (#12025)
## **Description** This PR renders the max input modal component when the user clicks on the max button on the stake input screen. This is also responsible for subtracting the gas fees from the available balance before letting the user continue to the deposit flow. This PR also makes some minor changes and refactors as described below: - Fixes the misaligned staking navbar on Android devices. - The claim stake button will now be disabled until the transaction-controllers has closed. This prevents users from initiating multiple claims simultaneously. ## **Related issues** Fixes: [STAKE-847](https://consensyssoftware.atlassian.net/jira/software/projects/STAKE/boards/550/backlog?selectedIssue=STAKE-847) ## **Manual testing steps** 1. Add export MM_POOLED_STAKING_UI_ENABLED=true to .js.env file. 2. Click on Earn CTA 3. Click on Max button 4. Max input bottom sheet should appear and clicking on use max will calculate the maximum amount that can be staked by subtracting gas fees. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **New : Max Input Modal** https://github.com/user-attachments/assets/a48ed3f2-f165-4fe7-9dba-133c63cf9d44 ### **Navbar alignment Fix** ### **Before** <!-- [screenshots/recordings] --> <img width="408" alt="image" src="https://github.com/user-attachments/assets/d8e5da18-d2f1-450b-9eac-a581af8ec24c"> ### **After** <!-- [screenshots/recordings] --> <img width="408" alt="image" src="https://github.com/user-attachments/assets/cdd16bc7-2249-4bd4-b1f4-deb210e50bce"> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. [STAKE-847]: https://consensyssoftware.atlassian.net/browse/STAKE-847?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: Matthew Grainger <matthewgrainger33@gmail.com> Co-authored-by: Matthew Grainger <46547583+Matt561@users.noreply.github.com>
- Loading branch information
1 parent
627ed0c
commit 82aec27
Showing
30 changed files
with
1,777 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
app/components/UI/Stake/components/MaxInputModal/MaxInputModal.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { StyleSheet } from 'react-native'; | ||
|
||
const createMaxInputModalStyles = () => | ||
StyleSheet.create({ | ||
container: { | ||
paddingHorizontal: 16, | ||
}, | ||
textContainer: { | ||
paddingBottom: 16, | ||
paddingRight: 16, | ||
}, | ||
buttonContainer: { | ||
flexDirection: 'row', | ||
gap: 16, | ||
paddingHorizontal: 16, | ||
paddingBottom: 16, | ||
}, | ||
button: { | ||
flex: 1, | ||
}, | ||
}); | ||
|
||
export default createMaxInputModalStyles; |
Oops, something went wrong.