react-native-navigators
Advanced tools
Comparing version 0.3.0-33 to 0.3.0-34
@@ -24,3 +24,3 @@ import React, { memo, createContext, useContext } from 'react'; | ||
if (mode === NativeNavigatorModes.Stack) { | ||
headerMode = headerMode !== null && headerMode !== void 0 ? headerMode : NativeNavigatorHeaderModes.Auto; | ||
headerMode = (headerMode !== null && headerMode !== void 0 ? headerMode : NativeNavigatorHeaderModes.Auto); | ||
} | ||
@@ -31,5 +31,5 @@ else if (mode === NativeNavigatorModes.Split) { | ||
else { | ||
headerMode = headerMode !== null && headerMode !== void 0 ? headerMode : NativeNavigatorHeaderModes.None; | ||
headerMode = (headerMode !== null && headerMode !== void 0 ? headerMode : NativeNavigatorHeaderModes.None); | ||
} | ||
return (<NativeStackScene key={key} transition={((_b = (_a = navigation.dangerouslyGetParent()) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.isTransitioning) ? (_c = options.transition) !== null && _c !== void 0 ? _c : NativeNavigatorTransitions.Default : NativeNavigatorTransitions.None} isSplitPrimary={isSplitPrimary} gestureEnabled={options.gestureEnabled !== false} translucent={options.translucent === true} transparent={options.transparent === true} style={options.cardStyle} statusBarStyle={options.statusBarStyle} statusBarHidden={options.statusBarHidden} closing={closing} onDidFocus={onDidFocus} onDidBlur={onDidBlur} route={route}> | ||
return (<NativeStackScene key={key} transition={((_b = (_a = navigation.dangerouslyGetParent()) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.isTransitioning) ? (_c = options.transition, (_c !== null && _c !== void 0 ? _c : NativeNavigatorTransitions.Default)) : NativeNavigatorTransitions.None} isSplitPrimary={isSplitPrimary} gestureEnabled={options.gestureEnabled !== false} translucent={options.translucent === true} transparent={options.transparent === true} style={options.cardStyle} statusBarStyle={options.statusBarStyle} statusBarHidden={options.statusBarHidden} closing={closing} onDidFocus={onDidFocus} onDidBlur={onDidBlur} route={route}> | ||
<NativeStackSceneContainer> | ||
@@ -36,0 +36,0 @@ <NativeNavigationClosingStateContext.Provider value={closing || closingContextState}> |
@@ -11,5 +11,6 @@ import React from 'react'; | ||
export default function NativeStackNavigator(props) { | ||
var _a, _b, _c, _d, _e; | ||
const { options } = props; | ||
return (<RNNativeSplitNavigator style={styles.navigator} splitRules={options === null || options === void 0 ? void 0 : options.splitRules} isSplitFullScreen={(options === null || options === void 0 ? void 0 : options.isSplitFullScreen) === true}> | ||
{(options === null || options === void 0 ? void 0 : options.splitPlaceholder) ? (<NativeSplitPlaceholder component={options === null || options === void 0 ? void 0 : options.splitPlaceholder}/>) : null} | ||
return (<RNNativeSplitNavigator style={styles.navigator} splitRules={(_a = options) === null || _a === void 0 ? void 0 : _a.splitRules} splitLineColor={(_b = options) === null || _b === void 0 ? void 0 : _b.splitLineColor} isSplitFullScreen={((_c = options) === null || _c === void 0 ? void 0 : _c.isSplitFullScreen) === true}> | ||
{((_d = options) === null || _d === void 0 ? void 0 : _d.splitPlaceholder) ? (<NativeSplitPlaceholder component={(_e = options) === null || _e === void 0 ? void 0 : _e.splitPlaceholder}/>) : null} | ||
{props.children} | ||
@@ -16,0 +17,0 @@ </RNNativeSplitNavigator>); |
@@ -5,6 +5,7 @@ import React, { useState, createContext, useMemo, useCallback } from 'react'; | ||
const { children, options } = props; | ||
const [isSplitFullScreen, setIsSplitFullScreen] = useState(() => options === null || options === void 0 ? void 0 : options.isSplitFullScreen); | ||
const [splitRules, setSplitRules] = useState(() => options === null || options === void 0 ? void 0 : options.splitRules); | ||
const [splitPlaceholder, setSplitPlaceholder] = useState(() => options === null || options === void 0 ? void 0 : options.splitPlaceholder); | ||
const [splitPrimaryRouteNames, setSplitPrimaryRouteNames] = useState(() => options === null || options === void 0 ? void 0 : options.splitPrimaryRouteNames); | ||
const [isSplitFullScreen, setIsSplitFullScreen] = useState(() => { var _a; return (_a = options) === null || _a === void 0 ? void 0 : _a.isSplitFullScreen; }); | ||
const [splitRules, setSplitRules] = useState(() => { var _a; return (_a = options) === null || _a === void 0 ? void 0 : _a.splitRules; }); | ||
const [splitPlaceholder, setSplitPlaceholder] = useState(() => { var _a; return (_a = options) === null || _a === void 0 ? void 0 : _a.splitPlaceholder; }); | ||
const [splitPrimaryRouteNames, setSplitPrimaryRouteNames] = useState(() => { var _a; return (_a = options) === null || _a === void 0 ? void 0 : _a.splitPrimaryRouteNames; }); | ||
const [splitLineColor, setSplitLineColor] = useState(() => { var _a; return (_a = options) === null || _a === void 0 ? void 0 : _a.splitLineColor; }); | ||
const setOptions = useCallback((options) => { | ||
@@ -23,2 +24,5 @@ if (options.hasOwnProperty('isSplitFullScreen')) { | ||
} | ||
if (options.hasOwnProperty('splitLineColor')) { | ||
setSplitLineColor(options.splitLineColor); | ||
} | ||
}, []); | ||
@@ -31,7 +35,14 @@ const value = useMemo(() => { | ||
splitPlaceholder, | ||
splitPrimaryRouteNames | ||
splitPrimaryRouteNames, | ||
splitLineColor | ||
}, | ||
setOptions | ||
}; | ||
}, [isSplitFullScreen, splitRules, splitPlaceholder, splitPrimaryRouteNames]); | ||
}, [ | ||
isSplitFullScreen, | ||
splitRules, | ||
splitPlaceholder, | ||
splitPrimaryRouteNames, | ||
splitLineColor | ||
]); | ||
return (<NativeSplitNavigatorOptionsContext.Provider value={value}> | ||
@@ -38,0 +49,0 @@ {children(value.options)} |
@@ -41,2 +41,3 @@ import { ReactNode, ElementType } from 'react'; | ||
splitRules?: NativeNavigatorSplitRules; | ||
splitLineColor?: string; | ||
splitPrimaryRouteNames?: string[]; | ||
@@ -43,0 +44,0 @@ splitPlaceholder?: ElementType<{}>; |
{ | ||
"version": "0.3.0-33", | ||
"version": "0.3.0-34", | ||
"name": "react-native-navigators", | ||
@@ -4,0 +4,0 @@ "repository": { |
export * from './createNavigators'; | ||
export { default as SplitRouter } from './SplitRouter'; | ||
export { NativeNavigationClosingStateContext } from './NativeScene'; | ||
export { NativeSplitNavigatorOptionsContext } from './NativeSplitNavigatorOptionsWrapper'; | ||
export { | ||
NativeSplitNavigatorOptionsContext | ||
} from './NativeSplitNavigatorOptionsWrapper'; | ||
export * from './splitNavigatorRules'; | ||
export * from './types'; |
@@ -62,2 +62,3 @@ import { ReactNode, ElementType } from 'react'; | ||
splitRules?: NativeNavigatorSplitRules; | ||
splitLineColor?: string; | ||
splitPrimaryRouteNames?: string[]; | ||
@@ -64,0 +65,0 @@ splitPlaceholder?: ElementType<{}>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2271333
422
4360