Skip to content

Bottom sheets #1335

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

Merged
merged 35 commits into from
May 27, 2025
Merged

Bottom sheets #1335

merged 35 commits into from
May 27, 2025

Conversation

nop33
Copy link
Member

@nop33 nop33 commented May 14, 2025

✅ Migrated 39/40 modals

Further work:

  • Sticky headers (see code comments)
  • Stacking (see docs for stackBehavior)
  • RegionsModal.tsx (tricky to migrate)
  • Consider adding stackingBehavior to openModal Redux action
  • Search codebase for dispatch(closeModal and replace with dismiss where appropriate
  • Android Backdrop
  • Investigate activateAppLoading/deactivateAppLoading
  • Flickering input field text in modals

Copy link

changeset-bot bot commented May 14, 2025

⚠️ No Changeset found

Latest commit: f3e6ff7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -108,7 +108,6 @@ const ScrollScreen = ({
alwaysBounceVertical={true}
onScroll={handleScroll}
onScrollEndDrag={scrollEndHandler}
style={{ overflow: SCREEN_OVERFLOW }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comes from a cherry picked commit from one of the expo 52 PRs. This branch is not properly rebased on top of the other 6 branches. I wanted to fix something that I had already fixed.

Comment on lines +48 to +51
const handleDismiss = useCallback(() => {
dispatch(closeModal({ id: props.modalId }))
dispatch(removeModal({ id: props.modalId }))
}, [dispatch, props.modalId])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the sheet gets dismissed (either by clicking the backdrop, or pulling down, or programmatically) we can completely remove the modal from our Redux state directly since we do not handle the animations ourselves anymore.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's so good! But it means we could probably simplify our Redux actions by only keeping closeModal, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but we still have 1 modal that is complicated to migrate, so I'd keep it for now and focus on other more pressing matters

@@ -103,7 +103,7 @@ export type OpenModalParams = {
}[ModalName]

export type ModalInstance = {
id: number
id: string
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to string so that I can use it with the sheets lib

@nop33 nop33 requested a review from mvaivre May 16, 2025 15:10
@nop33 nop33 marked this pull request as ready for review May 16, 2025 15:10
@nop33 nop33 added the 📱 MW Mobile wallet label May 19, 2025
Base automatically changed from replace-async-storage-w-mmkv to mw-tanstack-migration May 22, 2025 17:11
@mvaivre
Copy link
Member

mvaivre commented May 26, 2025

IMG_5339

Need to re-add gaps between sections in some modals

@mvaivre
Copy link
Member

mvaivre commented May 26, 2025

IMG_5340

Horizontal padding is too large

@nop33
Copy link
Member Author

nop33 commented May 26, 2025

Horizontal padding is too large

@mvaivre fixed

@@ -28,13 +28,14 @@ const AddressSettingsModal = withModal<AddressSettingsModalProps>(({ id, address
const persistAddressSettings = usePersistAddressSettings()
const { t } = useTranslation()
const canDeleteAddress = useCanDeleteAddress(addressHash)
const { dismiss } = useBottomSheetModal()
Copy link
Member

@mvaivre mvaivre May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'm tempted to rename those dismissModal for clarity. But because we are in a Modal component, I'm also ok with keeping this name.

Comment on lines +48 to +51
const handleDismiss = useCallback(() => {
dispatch(closeModal({ id: props.modalId }))
dispatch(removeModal({ id: props.modalId }))
}, [dispatch, props.modalId])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's so good! But it means we could probably simplify our Redux actions by only keeping closeModal, no?

@nop33 nop33 merged commit 746b3b4 into mw-tanstack-migration May 27, 2025
4 of 5 checks passed
@nop33 nop33 deleted the bottom-sheets branch May 27, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📱 MW Mobile wallet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants