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

refactor(token-bottom-sheet): support bottom sheet screen and use in cico #5485

Merged
merged 8 commits into from
May 30, 2024

Conversation

satish-ravi
Copy link
Contributor

Description

Refactors the TokenBottomSheet component so that it can be used as a bottom sheet screen for CICO flow. This will allow enabling filters without needing to duplicate much of the code

Test plan

Confirmed token bottom sheet works correctly on all the flows

Related issues

Backwards compatibility

Yes

Network scalability

If a new NetworkId and/or Network are added in the future, the changes in this PR will:

  • Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)

return (
<>
{isScreen ? (
<View style={{ height: variables.height * 0.9 }}>{content}</View>
Copy link
Contributor Author

@satish-ravi satish-ravi May 29, 2024

Choose a reason for hiding this comment

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

one implication of this is that the bottom sheet will always be 90% high regardless of the number of tokens. If this is not set and the token list exceeds the screen height, the bottom sheet occupies the full screen. The BottomSheetScrollView (which we use for other bottom sheet screens) specifies a maxHeight to the scroll view, but wasn't able to use that here. Open to other ideas.

Example:

Copy link
Collaborator

Choose a reason for hiding this comment

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

what about using just maxHeight here? you can remove the flex:1 on the container style to make that work (might need to bring the container into the render method and use it only if not isScreen)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this worked. thanks!

Copy link

codecov bot commented May 29, 2024

Codecov Report

Attention: Patch coverage is 88.09524% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 86.40%. Comparing base (9810375) to head (df91681).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #5485   +/-   ##
=======================================
  Coverage   86.40%   86.40%           
=======================================
  Files         761      761           
  Lines       31365    31371    +6     
  Branches     5390     5397    +7     
=======================================
+ Hits        27101    27107    +6     
  Misses       4033     4033           
  Partials      231      231           
Files Coverage Δ
src/components/TokenBottomSheet.tsx 95.80% <96.87%> (+0.38%) ⬆️
.../fiatExchanges/FiatExchangeCurrencyBottomSheet.tsx 89.18% <60.00%> (+0.81%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9810375...df91681. Read the comment docs.

@satish-ravi satish-ravi added this pull request to the merge queue May 30, 2024
Merged via the queue into main with commit a7019b6 May 30, 2024
16 checks passed
@satish-ravi satish-ravi deleted the satish/act-1170 branch May 30, 2024 02:35
github-merge-queue bot pushed a commit that referenced this pull request Sep 10, 2024
### Description

Update `@th3rdwave/react-navigation-bottom-sheet` to the latest version
and simplify some usage.
It was updated to work with the latest version of
`gorhom/react-native-bottom-sheet` with dynamic sizing.
See
https://github.com/th3rdwave/react-navigation-bottom-sheet/releases/tag/v0.3.0

I looked at the previous changes where we added workarounds for screen
usage:
- #5062
- #5485

These aren't needed anymore, but there's a very small patch needed
again. I'll contribute it upstream.
However, bonus is we now get scroll down to dismiss for bottom sheet
screens!

### Test plan

- Tests pass
- Manually checked bottom sheets display with the correct size on both
iOS and Android. And behave as expected (scroll to dismiss, etc)
  - Hopefully I haven't missed any special case 👀 

### Related issues

N/A

### Backwards compatibility

Yes

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [x] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants