Skip to content

Commit 300884d

Browse files
committed
support for tabs nested in screen-stack
1 parent 13c12a2 commit 300884d

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

apps/src/tests/TestBottomTabs/index.tsx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ import {
1111
} from '../../shared/gamma/containers/bottom-tabs/BottomTabsContainer';
1212
import { Tab1, Tab2, Tab3, Tab4 } from './tabs';
1313
import Colors from '../../shared/styling/Colors';
14+
// import { NavigationContainer, ParamListBase } from '@react-navigation/native';
15+
// import {
16+
// NativeStackNavigationProp,
17+
// createNativeStackNavigator,
18+
// } from '@react-navigation/native-stack';
19+
// import { Button, View } from 'react-native';
1420

1521
enableFreeze(true);
1622

@@ -71,6 +77,7 @@ const TAB_CONFIGS: TabConfiguration[] = [
7177
},
7278
iconResourceName: 'sym_action_email', // Android specific
7379
title: 'Tab3',
80+
orientation: 'portrait',
7481
},
7582
contentViewRenderFn: Tab3,
7683
},
@@ -109,3 +116,52 @@ function App() {
109116
}
110117

111118
export default App;
119+
120+
// type RouteParamList = {
121+
// Auth: undefined;
122+
// Tabs: undefined;
123+
// };
124+
125+
// type NavigationProp<ParamList extends ParamListBase> = {
126+
// navigation: NativeStackNavigationProp<ParamList>;
127+
// };
128+
129+
// type StackNavigationProp = NavigationProp<RouteParamList>;
130+
131+
// const Stack = createNativeStackNavigator<RouteParamList>();
132+
133+
// function AuthScreen({ navigation }: StackNavigationProp) {
134+
// return (
135+
// <View
136+
// style={{
137+
// flex: 1,
138+
// alignItems: 'center',
139+
// justifyContent: 'center',
140+
// }}>
141+
// <Button title="Log in" onPress={() => navigation.push('Tabs')} />
142+
// </View>
143+
// );
144+
// }
145+
146+
// function WrappedApp() {
147+
// return (
148+
// <NavigationContainer>
149+
// <Stack.Navigator>
150+
// <Stack.Screen
151+
// name="Auth"
152+
// component={AuthScreen}
153+
// // options={{
154+
// // orientation: 'landscape',
155+
// // }}
156+
// />
157+
// <Stack.Screen
158+
// name="Tabs"
159+
// component={App}
160+
// options={{ orientation: 'landscape' }}
161+
// />
162+
// </Stack.Navigator>
163+
// </NavigationContainer>
164+
// );
165+
// }
166+
167+
// export default WrappedApp;

ios/RNSScreen.mm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,6 +1986,15 @@ - (void)presentViewController:(UIViewController *)viewControllerToPresent
19861986

19871987
- (RNSOrientation)evaluateOrientation
19881988
{
1989+
if ([self.childViewControllers.lastObject respondsToSelector:@selector(evaluateOrientation)]) {
1990+
id<RNSOrientationProviding> child = static_cast<id<RNSOrientationProviding>>(self.childViewControllers.lastObject);
1991+
RNSOrientation childOrientation = [child evaluateOrientation];
1992+
1993+
if (childOrientation != RNSOrientationInherit) {
1994+
return childOrientation;
1995+
}
1996+
}
1997+
19891998
return rnscreens::conversion::RNSOrientationFromUIInterfaceOrientationMask([self supportedInterfaceOrientations]);
19901999
}
19912000

0 commit comments

Comments
 (0)