Skip to content

Commit 683d780

Browse files
committed
fix: add app refactor
1 parent 6cb45ca commit 683d780

File tree

2 files changed

+4
-25
lines changed

2 files changed

+4
-25
lines changed

examples/SampleApp/src/components/ScreenHeader.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React, { useEffect } from 'react';
1+
import React from 'react';
22
import { StyleProp, StyleSheet, Text, TouchableOpacity, View, ViewStyle } from 'react-native';
33
import { CompositeNavigationProp, useNavigation } from '@react-navigation/native';
44
import { useSafeAreaInsets } from 'react-native-safe-area-context';
5-
import { useAttachmentPickerContext, useTheme } from 'stream-chat-react-native';
5+
import { useTheme } from 'stream-chat-react-native';
66

77
import { ChannelsUnreadCountBadge } from './UnreadCountBadge';
88

@@ -122,13 +122,6 @@ export const ScreenHeader: React.FC<ScreenHeaderProps> = (props) => {
122122
},
123123
} = useTheme();
124124
const insets = useSafeAreaInsets();
125-
const { setTopInset } = useAttachmentPickerContext();
126-
127-
useEffect(() => {
128-
if (setTopInset) {
129-
setTopInset(HEADER_CONTENT_HEIGHT + insets.top);
130-
}
131-
}, [insets.top, setTopInset]);
132125

133126
return (
134127
<View

examples/SampleApp/src/screens/ThreadScreen.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
import React, { useEffect } from 'react';
1+
import React from 'react';
22
import { StyleSheet, View } from 'react-native';
33
import { SafeAreaView } from 'react-native-safe-area-context';
4-
import {
5-
Channel,
6-
Thread,
7-
ThreadType,
8-
useAttachmentPickerContext,
9-
useTheme,
10-
useTypingString,
11-
} from 'stream-chat-react-native';
4+
import { Channel, Thread, ThreadType, useTheme, useTypingString } from 'stream-chat-react-native';
125
import { useStateStore } from 'stream-chat-react-native';
136

147
import { ScreenHeader } from '../components/ScreenHeader';
@@ -65,13 +58,6 @@ export const ThreadScreen: React.FC<ThreadScreenProps> = ({
6558
colors: { white },
6659
},
6760
} = useTheme();
68-
const { setSelectedImages } = useAttachmentPickerContext();
69-
70-
useEffect(() => {
71-
setSelectedImages([]);
72-
return () => setSelectedImages([]);
73-
// eslint-disable-next-line react-hooks/exhaustive-deps
74-
}, []);
7561

7662
return (
7763
<SafeAreaView style={[styles.container, { backgroundColor: white }]}>

0 commit comments

Comments
 (0)