Skip to content

Commit b7ca7b1

Browse files
committed
support for tabs nested in screen-stack
1 parent 783b635 commit b7ca7b1

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

@@ -72,6 +78,7 @@ const TAB_CONFIGS: TabConfiguration[] = [
7278
tabBarItemIconColor: Colors.RedDark120,
7379
iconResourceName: 'sym_call_outgoing', // Android specific
7480
title: 'Tab3',
81+
orientation: 'portrait',
7582
},
7683
contentViewRenderFn: Tab3,
7784
},
@@ -108,3 +115,52 @@ function App() {
108115
}
109116

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

ios/RNSScreen.mm

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

19991999
- (RNSOrientation)evaluateOrientation
20002000
{
2001+
if ([self.childViewControllers.lastObject respondsToSelector:@selector(evaluateOrientation)]) {
2002+
id<RNSOrientationProviding> child = static_cast<id<RNSOrientationProviding>>(self.childViewControllers.lastObject);
2003+
RNSOrientation childOrientation = [child evaluateOrientation];
2004+
2005+
if (childOrientation != RNSOrientationInherit) {
2006+
return childOrientation;
2007+
}
2008+
}
2009+
20012010
return rnscreens::conversion::RNSOrientationFromUIInterfaceOrientationMask([self supportedInterfaceOrientations]);
20022011
}
20032012

0 commit comments

Comments
 (0)