Skip to content
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]: Replace <Tooltip> instances with useTooltipModal and BottomModal with BottomSheet #12656

Open
9 tasks
digiwand opened this issue Dec 12, 2024 · 2 comments
Open
9 tasks
Labels
team-confirmations Push issues to confirmations team

Comments

@digiwand
Copy link
Contributor

What is this about?

BottomModal uses react-native-modal modal. This prevents us from making use of BottomSheet.
useTooltipModal renders a BottomSheet.

We want to replace instances with the useTooltipModal hook and with

Per the design request, we want to use useTooltipModal to render BottomSheets instead of new custom tooltips. See:

  • app/components/Views/confirmations/components/UI/InfoRow/InfoRow.tsx
  • BottomModal instances

Scenario

No response

Design

No response

Technical Details

No response

Threat Modeling Framework

No response

Acceptance Criteria

No response

Stakeholder review needed before the work gets merged

  • Engineering (needed in most cases)
  • Design
  • Product
  • QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
  • Security
  • Legal
  • Marketing
  • Management (please specify)
  • Other (please specify)

References

No response

@digiwand digiwand added the team-confirmations Push issues to confirmations team label Dec 12, 2024
@jpuri
Copy link
Contributor

jpuri commented Jan 15, 2025

I tried to use BottomSheet im place of BottomModal, but BottomSheet is giving issue when nested - which is a valid use case in confirmations.

@digiwand
Copy link
Contributor Author

digiwand commented Jan 30, 2025

Created a separate ticket to handle Confirm page BottomModal → BottomSheet separately

#13267

@digiwand digiwand removed their assignment Jan 31, 2025
github-merge-queue bot pushed a commit that referenced this issue Feb 28, 2025
…13268)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->


## **Description**

Updates:
- Replaces BottomModal with BottomSheet in redesign Confirm page
- Remove min height to prevent redesign Confirm page from showing excess
space
- Allow BottomSheet styles (rounded corners, footer bottom styles, and
device padding detection padding) rather than custom BottomModal styles
- Update BlockaidBanner to remove surrounding margin to allow for better
reusability
- Replace BlockaidBanner instances margin overrides with surrounding
container margins
- Update BottomSheet to pass style to BottomSheetDialog sheet cc:
@brianacnguyen
- Note: I think we don't need the additional background colors for
header and footer since the parent, BottomSheet animated view sets the
background color. Once I removed them, it triggered many snapshot tests
and code owner reviews from 5 additional teams. Instead of making this
change, we will continue to update the bottomsheet, footer, and header
when applicable

Fixes:
- Fix TransactionReview BlockaidBanner negative padding → turn to
positive padding to allow space between next element
 - Fix Confirm.test console.errors
 
## **Related issues**

Fixes: #13267
Todo follow-up - Related Issue:
#12656

## **Manual testing steps**

Test BottomSheets and BlockaidBanner alerts work as expected. Test
redesign confirmation page works as expected

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### Before using BottomModal and no scroll behavior


https://github.com/user-attachments/assets/0d4c5453-5824-47fd-8aa5-7405cf19de53

### After using BottomSheet with scroll behavior 

<img width="320"
src="https://github.com/user-attachments/assets/a908f81f-1a28-4e8c-966a-a390430dc7d9">


https://github.com/user-attachments/assets/8f8e2344-7706-49a4-b773-a5226b7826d4

### Before 70% min height

<img width="320"
src="https://github.com/user-attachments/assets/94509d26-5e20-414d-942f-56938620f90a">

### After remove  70% min height 

<img width="320"
src="https://github.com/user-attachments/assets/641022c5-6f23-47a5-9f00-4e9358a96d3b">

### **Before Transaction Review BlockaidBanner negative padding**

<img width="320"
src="https://github.com/user-attachments/assets/c057c4e7-c7a7-42f2-8251-b4f2c075a802">

### **After Transaction Review BlockaidBanner positive padding **

<img width="320"
src="https://github.com/user-attachments/assets/de1ecadb-c7ef-49e1-8ae2-6ce1b5d16997">

### Before Confirm.test console errors

![CleanShot 2025-02-09 at 01 35
46@2x](https://github.com/user-attachments/assets/2653a073-b0de-4c2d-bcea-dfbc11d38246)
![CleanShot 2025-02-09 at 01 35
54@2x](https://github.com/user-attachments/assets/f9ce410c-42c5-4738-b99f-f871456eb82f)

### After Confirm.test no console.errors

![CleanShot 2025-02-09 at 01 49
47@2x](https://github.com/user-attachments/assets/d3bf6580-553d-4b14-96ab-3f529d17db67)


## **Pre-merge author checklist**

- [ ] 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).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] 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**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] 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.

---------

Co-authored-by: Brian Nguyen <brianacnguyen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-confirmations Push issues to confirmations team
Projects
None yet
Development

No branches or pull requests

2 participants