Skip to content

Improve stack and material top tabs #51

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 2 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/MaterialTopTabs.res
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ module Make = (
~tabBarTestID: string=?,
~_lazy: bool=?,
~lazyPlaceholder: React.component<{"route": route}>=?,
~swipeEnabled: bool=?,
~tabBarActiveTintColor: string=?,
~tabBarInactiveTintColor: string=?,
~tabBarPressColor: string=?,
Expand Down Expand Up @@ -224,6 +225,8 @@ module Make = (
| @as("on-drag") #onDrag
| #none
]=?,
// Setting `swipeEnabled` through props is deprecated.
// Set it through screen options instead!
~swipeEnabled: bool=?,
~swipeVelocityImpact: float=?,
~sceneContainerStyle: ReactNative.Style.t=?,
Expand Down
7 changes: 7 additions & 0 deletions src/Stack.res
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ module Make = (
~headerBackAllowFontScaling: bool=?,
~headerBackground: headerBackgroundOptions => React.element=?,
~headerBackImage: backImage=?,
~headerBackTestID: string=?,
~headerBackTitle: string=?,
~headerBackTitleStyle: ReactNative.Style.t=?,
~headerBackTitleVisible: bool=?,
Expand Down Expand Up @@ -260,6 +261,9 @@ module Make = (
}
type optionsCallback = optionsProps => options

type getIdProps = {params: M.params}
type getIdCallback = getIdProps => option<string>

type groupProps = {screenOptions: option<optionsCallback>}

type navigatorProps = {
Expand All @@ -273,6 +277,7 @@ module Make = (
type screenProps<'params> = {
name: string,
options: option<optionsCallback>,
getId: option<getIdCallback>,
initialParams: option<'params>,
component: option<React.component<{"navigation": navigation, "route": route}>>,
children: option<renderCallbackProp => React.element>,
Expand All @@ -291,6 +296,7 @@ module Make = (
external makeProps: (
~name: string,
~options: optionsCallback=?,
~getId: getIdCallback=?,
~initialParams: M.params=?,
~children: renderCallbackProp => React.element,
~key: string=?,
Expand All @@ -304,6 +310,7 @@ module Make = (
external makeProps: (
~name: string,
~options: optionsCallback=?,
~getId: getIdCallback=?,
~initialParams: M.params=?,
~component: React.component<{"navigation": navigation, "route": route}>,
~key: string=?,
Expand Down