Skip to content

Commit 393ab97

Browse files
committed
fix: remove navigation
1 parent aa3ce98 commit 393ab97

33 files changed

+50
-598
lines changed

examples/SampleApp/App.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import React, { useEffect } from 'react';
22
import { DevSettings, LogBox, Platform, Text, useColorScheme, View } from 'react-native';
3-
import { DarkTheme, DefaultTheme, NavigationContainer } from '@react-navigation/native';
4-
import { createStackNavigator } from '@react-navigation/stack';
5-
import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context';
63
import { AppContext } from './src/context/AppContext';
74
import { AppOverlayProvider } from './src/context/AppOverlayProvider';
85
import { UserSearchProvider } from './src/context/UserSearchContext';
@@ -39,22 +36,21 @@ console.assert = () => null;
3936

4037
// when a channel id is set here, the intial route is the channel screen
4138
const initialChannelIdGlobalRef = { current: '' };
42-
43-
const Stack = createStackNavigator<StackNavigatorParamList>();
44-
const UserSelectorStack = createStackNavigator<UserSelectorParamList>();
4539
const App = () => {
4640
const { chatClient, isConnecting, loginUser, logout, switchUser } = useChatClient();
4741
const colorScheme = useColorScheme();
4842
const streamChatTheme = useStreamChatTheme();
4943

5044
return (
51-
<SafeAreaProvider
45+
<View
5246
style={{
53-
backgroundColor: '#FCFCFC',
47+
flex: 1,
48+
alignItems: 'center',
49+
justifyContent: 'center',
5450
}}
5551
>
5652
<View><Text>This is a test build, please disregard it.</Text></View>
57-
</SafeAreaProvider>
53+
</View>
5854
);
5955
};
6056

examples/SampleApp/ios/Podfile.lock

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,81 +1332,6 @@ PODS:
13321332
- React-jsiexecutor
13331333
- React-RCTFBReactNativeSpec
13341334
- ReactCommon/turbomodule/core
1335-
- react-native-safe-area-context (5.4.1):
1336-
- DoubleConversion
1337-
- glog
1338-
- hermes-engine
1339-
- RCT-Folly (= 2024.11.18.00)
1340-
- RCTRequired
1341-
- RCTTypeSafety
1342-
- React-Core
1343-
- React-debug
1344-
- React-Fabric
1345-
- React-featureflags
1346-
- React-graphics
1347-
- React-hermes
1348-
- React-ImageManager
1349-
- React-jsi
1350-
- react-native-safe-area-context/common (= 5.4.1)
1351-
- react-native-safe-area-context/fabric (= 5.4.1)
1352-
- React-NativeModulesApple
1353-
- React-RCTFabric
1354-
- React-renderercss
1355-
- React-rendererdebug
1356-
- React-utils
1357-
- ReactCodegen
1358-
- ReactCommon/turbomodule/bridging
1359-
- ReactCommon/turbomodule/core
1360-
- Yoga
1361-
- react-native-safe-area-context/common (5.4.1):
1362-
- DoubleConversion
1363-
- glog
1364-
- hermes-engine
1365-
- RCT-Folly (= 2024.11.18.00)
1366-
- RCTRequired
1367-
- RCTTypeSafety
1368-
- React-Core
1369-
- React-debug
1370-
- React-Fabric
1371-
- React-featureflags
1372-
- React-graphics
1373-
- React-hermes
1374-
- React-ImageManager
1375-
- React-jsi
1376-
- React-NativeModulesApple
1377-
- React-RCTFabric
1378-
- React-renderercss
1379-
- React-rendererdebug
1380-
- React-utils
1381-
- ReactCodegen
1382-
- ReactCommon/turbomodule/bridging
1383-
- ReactCommon/turbomodule/core
1384-
- Yoga
1385-
- react-native-safe-area-context/fabric (5.4.1):
1386-
- DoubleConversion
1387-
- glog
1388-
- hermes-engine
1389-
- RCT-Folly (= 2024.11.18.00)
1390-
- RCTRequired
1391-
- RCTTypeSafety
1392-
- React-Core
1393-
- React-debug
1394-
- React-Fabric
1395-
- React-featureflags
1396-
- React-graphics
1397-
- React-hermes
1398-
- React-ImageManager
1399-
- React-jsi
1400-
- react-native-safe-area-context/common
1401-
- React-NativeModulesApple
1402-
- React-RCTFabric
1403-
- React-renderercss
1404-
- React-rendererdebug
1405-
- React-utils
1406-
- ReactCodegen
1407-
- ReactCommon/turbomodule/bridging
1408-
- ReactCommon/turbomodule/core
1409-
- Yoga
14101335
- React-NativeModulesApple (0.79.3):
14111336
- glog
14121337
- hermes-engine
@@ -1798,7 +1723,6 @@ DEPENDENCIES:
17981723
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
17991724
- React-Mapbuffer (from `../node_modules/react-native/ReactCommon`)
18001725
- React-microtasksnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`)
1801-
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
18021726
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
18031727
- React-oscompat (from `../node_modules/react-native/ReactCommon/oscompat`)
18041728
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
@@ -1915,8 +1839,6 @@ EXTERNAL SOURCES:
19151839
:path: "../node_modules/react-native/ReactCommon"
19161840
React-microtasksnativemodule:
19171841
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/microtasks"
1918-
react-native-safe-area-context:
1919-
:path: "../node_modules/react-native-safe-area-context"
19201842
React-NativeModulesApple:
19211843
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios"
19221844
React-oscompat:
@@ -2023,7 +1945,6 @@ SPEC CHECKSUMS:
20231945
React-logger: 44e070aefe084568c02b544b9d7d436703be1a47
20241946
React-Mapbuffer: ed1f528261013e46790379cc6727b8005e169a67
20251947
React-microtasksnativemodule: da563fd4cb7ecc23f67b5f15b92dfe94a9791e2d
2026-
react-native-safe-area-context: f2e97b088ae5f3078f1ad03f51a44bd84f479053
20271948
React-NativeModulesApple: c761e39d8bb17a074530cb637ec6fe4460fac3af
20281949
React-oscompat: f26aa2a4adc84c34212ab12c07988fe19e9cf16a
20291950
React-perflogger: fb196ad3fa3263afc55f773a10c2741517a27f7c

examples/SampleApp/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,9 @@
2323
"clean-all": "yarn clean && rm -rf node_modules && rm -rf ios/Pods && rm -rf vendor && bundle install && yarn install && cd ios && bundle exec pod install && cd -"
2424
},
2525
"dependencies": {
26-
"@react-navigation/bottom-tabs": "7.3.14",
27-
"@react-navigation/native": "^7.1.10",
28-
"@react-navigation/stack": "^7.3.3",
2926
"react": "19.0.0",
3027
"react-native": "^0.79.3",
31-
"react-native-gesture-handler": "^2.26.0",
32-
"react-native-safe-area-context": "^5.4.1"
28+
"react-native-gesture-handler": "^2.26.0"
3329
},
3430
"devDependencies": {
3531
"@babel/core": "^7.27.4",

examples/SampleApp/src/components/AddMemberBottomSheet.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
TouchableOpacity,
88
View,
99
} from 'react-native';
10-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
1110

1211
import { UserSearchResultsGrid } from './UserSearch/UserSearchResultsGrid';
1312

@@ -65,7 +64,6 @@ export const AddMemberBottomSheet: React.FC = () => {
6564

6665
const channel = data && isAddMemberBottomSheetData(data) ? data.channel : undefined;
6766

68-
const insets = useSafeAreaInsets();
6967
const {
7068
clearText,
7169
loading: loadingResults,
@@ -88,7 +86,7 @@ export const AddMemberBottomSheet: React.FC = () => {
8886
style={[
8987
styles.container,
9088
{
91-
marginBottom: insets.bottom,
89+
marginBottom: 0,
9290
},
9391
]}
9492
/>

examples/SampleApp/src/components/BottomTabs.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
import React from 'react';
22
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
3-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
43

54
import { ChannelsUnreadCountBadge, ThreadsUnreadCountBadge } from './UnreadCountBadge';
65

76
import { ChatsTab } from '../icons/ChatsTab';
87
import { ThreadsTab } from '../icons/ThreadsTab';
98
import { MentionsTab } from '../icons/MentionsTab';
109

11-
import type { BottomTabBarProps } from '@react-navigation/bottom-tabs';
12-
import type { Route } from '@react-navigation/native';
13-
1410
const styles = StyleSheet.create({
1511
notification: {
1612
left: 25, // size of icon
@@ -61,12 +57,7 @@ const getTab = (key: string) => {
6157
}
6258
};
6359

64-
type TabProps = Pick<BottomTabBarProps, 'navigation' | 'state'> & {
65-
index: number;
66-
route: Route<string>;
67-
};
68-
69-
const Tab = (props: TabProps) => {
60+
const Tab = (props) => {
7061
const { navigation, state, route, index } = props;
7162
const tab = getTab(route.name);
7263

@@ -104,16 +95,15 @@ const Tab = (props: TabProps) => {
10495
);
10596
};
10697

107-
export const BottomTabs: React.FC<BottomTabBarProps> = (props) => {
98+
export const BottomTabs: React.FC = (props) => {
10899
const { navigation, state } = props;
109-
const { bottom } = useSafeAreaInsets();
110100

111101
return (
112102
<View
113103
style={[
114104
styles.tabListContainer,
115105
{
116-
paddingBottom: bottom,
106+
paddingBottom: 0,
117107
},
118108
]}
119109
>

examples/SampleApp/src/components/ChannelPreview.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import React from 'react';
22
import { StyleSheet, View } from 'react-native';
3-
import { useNavigation } from '@react-navigation/native';
43
import { RectButton } from 'react-native-gesture-handler';
54
import Swipeable from 'react-native-gesture-handler/Swipeable';
65

76
import { useAppOverlayContext } from '../context/AppOverlayContext';
87
import { useBottomSheetOverlayContext } from '../context/BottomSheetOverlayContext';
98
import { useChannelInfoOverlayContext } from '../context/ChannelInfoOverlayContext';
109

11-
import type { StackNavigationProp } from '@react-navigation/stack';
12-
1310
import type { StackNavigatorParamList } from '../types';
1411

1512
const styles = StyleSheet.create({
@@ -36,11 +33,6 @@ const styles = StyleSheet.create({
3633
},
3734
});
3835

39-
type ChannelListScreenNavigationProp = StackNavigationProp<
40-
StackNavigatorParamList,
41-
'ChannelListScreen'
42-
>;
43-
4436
export const ChannelPreview = (
4537
props,
4638
) => {
@@ -52,9 +44,6 @@ export const ChannelPreview = (
5244

5345
const { data, setData } = useChannelInfoOverlayContext();
5446

55-
56-
const navigation = useNavigation<ChannelListScreenNavigationProp>();
57-
5847
const otherMembers = channel
5948
? Object.values(channel.state.members).filter((member) => member.user?.id !== data?.clientId)
6049
: [];

examples/SampleApp/src/components/ChatScreenHeader.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import React from 'react';
22
import { Image, StyleSheet, TouchableOpacity } from 'react-native';
3-
import { CompositeNavigationProp, useNavigation } from '@react-navigation/native';
43

54
import { RoundButton } from './RoundButton';
65
import { ScreenHeader } from './ScreenHeader';
76

87
import { useAppContext } from '../context/AppContext';
98
import { NewDirectMessageIcon } from '../icons/NewDirectMessageIcon';
109

11-
import type { StackNavigationProp } from '@react-navigation/stack';
1210

1311
import type { DrawerNavigatorParamList, StackNavigatorParamList } from '../types';
1412
import { NetworkDownIndicator } from './NetworkDownIndicator';
@@ -21,21 +19,15 @@ const styles = StyleSheet.create({
2119
},
2220
});
2321

24-
type ChatScreenHeaderNavigationProp = CompositeNavigationProp<
25-
DrawerNavigationProp<DrawerNavigatorParamList>,
26-
StackNavigationProp<StackNavigatorParamList>
27-
>;
28-
2922
export const ChatScreenHeader: React.FC<{ title?: string }> = ({ title = 'Stream Chat' }) => {
3023

31-
const navigation = useNavigation<ChatScreenHeaderNavigationProp>();
3224
const { chatClient } = useAppContext();
3325

3426
return (
3527
<ScreenHeader
3628
// eslint-disable-next-line react/no-unstable-nested-components
3729
LeftContent={() => (
38-
<TouchableOpacity onPress={navigation.openDrawer}>
30+
<TouchableOpacity onPress={() => {}}>
3931
<Image
4032
source={{
4133
uri: chatClient?.user?.image,

examples/SampleApp/src/components/ConfirmationBottomSheet.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
3-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
43

54
import { useAppOverlayContext } from '../context/AppOverlayContext';
65
import {
@@ -49,7 +48,6 @@ export const ConfirmationBottomSheet: React.FC = () => {
4948
const { data: contextData, reset } = useBottomSheetOverlayContext();
5049
const data = contextData && !isAddMemberBottomSheetData(contextData) ? contextData : undefined;
5150

52-
const inset = useSafeAreaInsets();
5351

5452
if (!data) {
5553
return null;
@@ -62,7 +60,7 @@ export const ConfirmationBottomSheet: React.FC = () => {
6260
style={[
6361
styles.container,
6462
{
65-
marginBottom: inset.bottom,
63+
marginBottom: 0,
6664
},
6765
]}
6866
>

examples/SampleApp/src/components/MessageSearch/MessageSearchList.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import { FlatList, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
3-
import { NavigationProp, useNavigation } from '@react-navigation/native';
43
import dayjs from 'dayjs';
54
import calendar from 'dayjs/plugin/calendar';
65

@@ -64,8 +63,6 @@ export const MessageSearchList: React.FC<MessageSearchListProps> = React.forward
6463
refreshList,
6564
showResultCount = false,
6665
} = props;
67-
const navigation =
68-
useNavigation<NavigationProp<StackNavigatorParamList, 'ChannelListScreen'>>();
6966

7067
if (!messages && !refreshing) {
7168
return null;

examples/SampleApp/src/components/NewDirectMessagingSendButton.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import { Alert } from 'react-native';
33
import { TouchableOpacity } from 'react-native-gesture-handler';
4-
import { useNavigation } from '@react-navigation/core';
54

65
import { NewDirectMessagingScreenNavigationProp } from '../screens/NewDirectMessagingScreen';
76

@@ -67,7 +66,6 @@ const MemoizedNewDirectMessagingSendButton = React.memo(
6766
*/
6867
export const NewDirectMessagingSendButton = (props) => {
6968
const { chatClient } = useAppContext();
70-
const navigation = useNavigation<NewDirectMessagingScreenNavigationProp>();
7169
const { selectedUserIds, reset } = useUserSearchContext();
7270

7371
return null;

0 commit comments

Comments
 (0)