Skip to content

Commit 0f855c0

Browse files
committed
fix: openFilePicker removal and fix show more options
1 parent d958b47 commit 0f855c0

File tree

6 files changed

+6
-20
lines changed

6 files changed

+6
-20
lines changed

examples/ExpoMessaging/app/channel/[cid]/index.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React, { useContext, useEffect } from 'react';
1+
import React, { useContext } from 'react';
22
import { SafeAreaView, View } from 'react-native';
3-
import { Channel, MessageInput, MessageList, useAttachmentPickerContext } from 'stream-chat-expo';
3+
import { Channel, MessageInput, MessageList } from 'stream-chat-expo';
44
import { Stack, useRouter } from 'expo-router';
55
import { AuthProgressLoader } from '../../../components/AuthProgressLoader';
66
import { AppContext } from '../../../context/AppContext';
@@ -9,13 +9,8 @@ import { useHeaderHeight } from '@react-navigation/elements';
99
export default function ChannelScreen() {
1010
const router = useRouter();
1111
const { setThread, channel } = useContext(AppContext);
12-
const { setTopInset } = useAttachmentPickerContext();
1312
const headerHeight = useHeaderHeight();
1413

15-
useEffect(() => {
16-
setTopInset(headerHeight);
17-
}, [headerHeight, setTopInset]);
18-
1914
if (!channel) {
2015
return <AuthProgressLoader />;
2116
}

examples/ExpoMessaging/components/ChatWrapper.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { PropsWithChildren, useRef } from 'react';
1+
import React, { PropsWithChildren } from 'react';
22
import {
33
Chat,
44
OverlayProvider,
@@ -8,7 +8,6 @@ import {
88
} from 'stream-chat-expo';
99
import { AuthProgressLoader } from './AuthProgressLoader';
1010
import { STREAM_API_KEY, user, userToken } from '../constants';
11-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
1211
import { useStreamChatTheme } from '../useStreamChatTheme';
1312

1413
const streami18n = new Streami18n({
@@ -20,7 +19,6 @@ SqliteClient.logger = (level, message, extraData) => {
2019
};
2120

2221
export const ChatWrapper = ({ children }: PropsWithChildren<{}>) => {
23-
const { bottom } = useSafeAreaInsets();
2422
const chatClient = useCreateChatClient({
2523
apiKey: STREAM_API_KEY,
2624
userData: user,
@@ -33,11 +31,7 @@ export const ChatWrapper = ({ children }: PropsWithChildren<{}>) => {
3331
}
3432

3533
return (
36-
<OverlayProvider
37-
bottomInset={bottom}
38-
i18nInstance={streami18n}
39-
value={{ style: theme }}
40-
>
34+
<OverlayProvider i18nInstance={streami18n} value={{ style: theme }}>
4135
<Chat client={chatClient} i18nInstance={streami18n}>
4236
{children}
4337
</Chat>

package/src/components/MessageInput/InputButtons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const InputButtonsWithContext = (props: InputButtonsWithContextProps) =>
5858
const [showMoreOptions, setShowMoreOptions] = useState(true);
5959
const { attachments } = useAttachmentManagerState();
6060

61-
const shouldShowMoreOptions = hasText || !!attachments.length;
61+
const shouldShowMoreOptions = hasText || attachments.length;
6262

6363
useEffect(() => {
6464
setShowMoreOptions(!shouldShowMoreOptions);

package/src/contexts/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export * from './messageInputContext/hooks/useCreateMessageInputContext';
1111
export * from './messageInputContext/MessageInputContext';
1212
export * from './messageInputContext/hooks/useMessageComposer';
1313
export * from './messageInputContext/hooks/useAttachmentManagerState';
14+
export * from './messageInputContext/hooks/useMessageComposerHasSendableData';
1415
export * from './messagesContext/MessagesContext';
1516
export * from './paginatedMessageListContext/PaginatedMessageListContext';
1617
export * from './overlayContext/OverlayContext';

package/src/contexts/messageInputContext/MessageInputContext.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ export type LocalMessageInputContext = {
8686

8787
inputBoxRef: React.RefObject<TextInput | null>;
8888
openAttachmentPicker: () => void;
89-
openFilePicker: () => void;
9089
/**
9190
* Function for picking a photo from native image picker and uploading it.
9291
*/
@@ -699,7 +698,6 @@ export const MessageInputProvider = ({
699698
cooldownEndsAt,
700699
inputBoxRef,
701700
openAttachmentPicker,
702-
openFilePicker: pickFile,
703701
pickAndUploadImageFromNativePicker,
704702
pickFile,
705703
setInputBoxRef,

package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export const useCreateMessageInputContext = ({
5656
InputReplyStateHeader,
5757
MoreOptionsButton,
5858
openAttachmentPicker,
59-
openFilePicker,
6059
openPollCreationDialog,
6160
pickAndUploadImageFromNativePicker,
6261
pickFile,
@@ -133,7 +132,6 @@ export const useCreateMessageInputContext = ({
133132
isCommandUIEnabled,
134133
MoreOptionsButton,
135134
openAttachmentPicker,
136-
openFilePicker,
137135
openPollCreationDialog,
138136
pickAndUploadImageFromNativePicker,
139137
pickFile,

0 commit comments

Comments
 (0)