-
-
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
refactor: Replace redesign confirmation BottomModal with BottomSheet #13268
base: main
Are you sure you want to change the base?
Conversation
no need because BottomSheetDialog provides background color
- affects only old confirmations - fix marginBottom on TransactionReview
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. |
|
|
@@ -595,7 +595,7 @@ exports[`Approval render matches snapshot 1`] = ` | |||
<View | |||
style={ | |||
{ | |||
"marginBottom": -8, | |||
"marginBottom": 8, |
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.
fixes missing padding between blockaid banner alert and account header
securityAlertResponse={securityAlertResponse} | ||
onContactUsClicked={this.onContactUsClicked} | ||
/> | ||
</View> |
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 would suggest avoiding changing old pages
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.
needed to make the change so that the reusable component does not apply it's own padding/margin. I think it's better to do this now than to continue this pattern of overriding the margin/padding through props
paddingHorizontal: 16, | ||
paddingVertical: 24, | ||
minHeight: '70%', |
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 if removing minHeight is good idea, let's check once with @SayaGT
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.
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.
marginHorizontal: 16, | ||
marginBottom: -8, | ||
marginBottom: 8, | ||
}, | ||
}); | ||
|
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.
Same, I would suggest avoiding any change to old pages.
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.
<BottomModal canCloseOnBackdropClick={false}> | ||
<View style={styles.container} testID={approvalRequest?.type}> | ||
<View> | ||
<Title /> |
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 now have a mix of use of BottomSheet
and BottomModal
in confirmation pages. Should we replace all occurence of BottomModal
like these.
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.
That's correct.
That was the original ticket found in the description
Todo follow-up - Related Issue: https://github.com/MetaMask/metamask-mobile/issues/12656
I created a separate issue ticket after working on this initial transition. Note: It is not possible to put a BottomSheet over a BottomModal too which is why this one needs to be done first
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.
Changes look good, I added some feedback that need to be addressed.
<View> | ||
<Title /> | ||
<BottomSheet | ||
isInteractable={false} |
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.
re: grey rounded, rectangular UI at top of sheet
#13268 (comment)
If isInteractable is here true, then we show the gray rectangle. Dragging the UI down would close the UI. However, it doesn't seem we want the user to close the confirmation on drag down.
![](https://private-user-images.githubusercontent.com/20778143/408587233-df51bac0-becc-47f6-84dd-2da76188a213.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NzYzODMsIm5iZiI6MTczOTQ3NjA4MywicGF0aCI6Ii8yMDc3ODE0My80MDg1ODcyMzMtZGY1MWJhYzAtYmVjYy00N2Y2LTg0ZGQtMmRhNzYxODhhMjEzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDE5NDgwM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE0MDFmYTliYjZmNjQzYzZlYjQxNDA1YTlmNzFjZDc3NzI4NzY3ZTMwZTU4YzAyMzBmY2E3MWY3MWFjOTYzYWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Pkulb9t-GVCXHGl56rajIp8U-VXaUpHHb5B2MK2qYro)
Interestingly, the BottomModal supports this behavior where it is draggable, but not closable:
CleanShot.2025-01-31.at.16.35.02.mp4
This is not a behavior with our DS BotttomSheet though. What is the expected behavior for the Confirm page here? Should we use BottomSheet isInteractable false as provided by DS? cc: @SayaGT @MetaMask/design-system @jpuri
@@ -36,6 +36,7 @@ const BottomSheet = forwardRef<BottomSheetRef, BottomSheetProps>( | |||
children, | |||
onClose, | |||
onOpen, | |||
isBackgroundAlternative = false, |
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.
@digiwand can you update this to bottomSheetDialogProps
instead? lmk if you need to sync on this
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.
hey @brianacnguyen, thank you for the review and reminder to push my updates! Apologies I didn't get to add this proposal before you reviewed. What do you think if we used stylesDialogSheet instead? This is because the style isn't for the general bottom sheet styles, but it's a specific style in BottomSheetDialog → sheet
updated 8cd072e
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.
Request changes RE BottomSheet
Description
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
Before using BottomModal and no scroll behavior
CleanShot.2025-01-30.at.01.11.16.mp4
After using BottomSheet with scroll behavior
CleanShot.2025-01-30.at.02.18.53.mp4
Before 70% min height
After remove 70% min height
Before Transaction Review BlockaidBanner negative padding
**After Transaction Review BlockaidBanner positive padding **
Before Confirm.test console errors
After Confirm.test no console.errors
Pre-merge author checklist
Pre-merge reviewer checklist