chore: Fix toast overlay in modals #103
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
When we swap over to using
react-native-actions-sheet
for our models, we encountered an issue where the toasts would appear underneath the modal.react-native-actions-sheet
suggests using theExtraOverlayComponent
prop and put the toast element there. The problem is that the notification provider we're using,react-native-toast-notifications
doesn't support this pattern as it exposes a provider instead of a component.@backpackapp-io/react-native-toast
does export a component so we swapped to using this.This also gives us the opportunity to add in the translated messages into the toasts.
How
There were somethings in the
@backpackapp-io/react-native-toast
package that we had to patch as it didn't expose ways to configure those specific behaviors:pointerEvents="box-none"
as we want to be able to interact with the content in the "transparent" area next to the toast to be clickable.One downside is that there's no way to set a global default (ie: we'll have to provide the "global" options to every
toast()
calls we do).Note
We noticed some performance issues when repetitively opening/closing the filter list modal with some entries in it. I'm not sure if its related to this change or just something else.
Test Plan
The main goal is to have the toast messages display over the modal when called and for them to be translated if we're using a different language.
Checklist
CHANGELOG.md
&README.md
).THIRD_PARTY.md
.pnpm android:prod
.