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: expose none & largest values for sheetLargestUndimmedDetent prop #2359

Merged
merged 6 commits into from
Sep 30, 2024

Conversation

kkafar
Copy link
Member

@kkafar kkafar commented Sep 30, 2024

Description

I'm exposing two new options for sheetLargestUndimmedDetent prop:

  • none - denoting that dimming view will be always present,
  • largest - denoting that dimming view will never be present.

Previously to achieve the effect of none you had to either rely on default or pass -1 raw value.

Similarly achieving the effect of largest required user to set a numeric value and update it everytime new detent was added / removed.

Note

As I wrote this description, new idea popped out - instead of exposing numeric constant just add some string options, as with sheetAllowedDetents (it is an array or some predefined string constants).
What would be the API though? sheetLargestUndimmedDetent: 'none'? What's the wording here?

Done! ^^^

react-navigation PR:

Changes

Replaced raw -1 with constants none and largest.

Test code and steps to reproduce

Test1649

Checklist

@kkafar kkafar self-assigned this Sep 30, 2024
@kkafar kkafar changed the title feat: expose SHEET_DIMMED_ALWAYS constant feat: expose none & largest values for sheetLargestUndimmedDetent prop Sep 30, 2024
@kkafar kkafar merged commit 261b7dd into main Sep 30, 2024
3 checks passed
@kkafar kkafar deleted the @kkafar/constant-on-js-side-for-lud branch September 30, 2024 09:41
ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this pull request Oct 9, 2024
…t` prop (software-mansion#2359)

## Description

I'm exposing two new options for `sheetLargestUndimmedDetent` prop:

* `none` - denoting that dimming view will be always present,
* `largest` - denoting that dimming view will never be present.

Previously to achieve the effect of `none` you had to either rely on
default or pass `-1` raw value.

Similarly achieving the effect of `largest` required user to set a
numeric value and update it everytime new detent was added / removed.

> [!note]
~~As I wrote this description, new idea popped out - instead of exposing
numeric constant just add some string options, as with
`sheetAllowedDetents` (it is an array or some predefined string
constants).
> What would be the API though? `sheetLargestUndimmedDetent: 'none'`?
What's the wording here?~~
>
> *Done! ^^^*

`react-navigation` PR:

* react-navigation/react-navigation#12032


## Changes

Replaced raw `-1` with constants `none` and `largest`.


## Test code and steps to reproduce

`Test1649`

## Checklist

- [x] Included code example that can be used to test this change
- [x] Updated TS types
- [x] Updated documentation: <!-- For adding new props to native-stack
-->
- [x]
https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md
- [x]
https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md
- [x]
https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx
- [x]
https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx
- [x] Ensured that CI passes
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.

1 participant