Skip to content

Commit ae5783a

Browse files
committed
refactor: simplify platform version checks for navigation bar visibility
1 parent 3793de6 commit ae5783a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

apps/example/src/Examples/FourTabs.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ export default function FourTabs({
6262
role: 'search',
6363
searchable: true,
6464
navigationBarToolbarStyle:
65-
Platform.Version === 26 || Platform.Version === '26.0'
66-
? 'hidden'
67-
: 'visible',
65+
Platform.Version === '26.0' ? 'hidden' : 'visible',
6866
},
6967
]);
7068

apps/example/src/Examples/NativeBottomTabsEmbeddedStacks.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Contacts } from '../Screens/Contacts';
44
import { Chat } from '../Screens/Chat';
55
import { createNativeBottomTabNavigator } from '@bottom-tabs/react-navigation';
66
import { createNativeStackNavigator } from '@react-navigation/native-stack';
7-
import { Platform } from 'react-native';
7+
import { Dimensions, Platform } from 'react-native';
88

99
const headerOptions = {
1010
headerShown: true,
@@ -67,6 +67,7 @@ function ChatStackScreen() {
6767
}
6868

6969
function NativeBottomTabsEmbeddedStacks() {
70+
console.log(Platform.Version, 'Platform.Version');
7071
return (
7172
<Tab.Navigator
7273
onSearchTextChange={(text) => console.log(text)}
@@ -104,7 +105,9 @@ function NativeBottomTabsEmbeddedStacks() {
104105
tabBarIcon: () => require('../../assets/icons/person_dark.png'),
105106
searchable: true,
106107
navigationBarToolbarStyle:
107-
Platform.Version === 26 || Platform.Version === '26.0'
108+
Platform.Version === '26.0' &&
109+
Platform.OS === 'ios' &&
110+
Dimensions.get('window').width < 400
108111
? 'hidden'
109112
: 'visible',
110113
}}

0 commit comments

Comments
 (0)