Skip to content

Commit

Permalink
Merge pull request #2586 from GetStream/develop
Browse files Browse the repository at this point in the history
Next Release
  • Loading branch information
khushal87 authored Jul 8, 2024
2 parents 5327cde + ea688c3 commit e94350c
Show file tree
Hide file tree
Showing 24 changed files with 1,376 additions and 1,388 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Boolean to enable/disable parent message press.

| Type | Default |
| ------- | ------- |
| Boolean | `true` |
7 changes: 6 additions & 1 deletion docusaurus/docs/reactnative/contexts/thread-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Thread from '../common-content/ui-components/channel/props/thread.mdx';
import CloseThread from '../common-content/contexts/thread-context/close_thread.mdx';
import LoadMoreThread from '../common-content/contexts/thread-context/load_more_thread.mdx';
import OpenThread from '../common-content/contexts/thread-context/open_thread.mdx';
import ParentMessagePreventPress from '../common-content/contexts/thread-context/parent_message_prevent_press.mdx';
import ReloadThread from '../common-content/contexts/thread-context/reload_thread.mdx';
import SetThreadLoadingMore from '../common-content/contexts/thread-context/set_thread_loading_more.mdx';
import ThreadHasMore from '../common-content/contexts/thread-context/thread_has_more.mdx';
Expand Down Expand Up @@ -38,7 +39,7 @@ const value = useThreadContext();

## Value

### <div class="label description">_forwarded from [Channel](../../core-components/channel#allowthreadmessagesinchannel)_ props</div> allowThreadMessagesInChannel {#allowthreadmessagesinchannel}
### <div class="label description">_forwarded from [Channel](../../core-components/channel#allowthreadmessagesinchannel)_ props</div> allowThreadMessagesInChannel `{#allowthreadmessagesinchannel}`

<AllowThreadMessagesInChannel />

Expand All @@ -54,6 +55,10 @@ const value = useThreadContext();

<OpenThread />

### `parentMessagePreventPress`

<ParentMessagePreventPress />

### `reloadThread`

<ReloadThread />
Expand Down
11 changes: 8 additions & 3 deletions docusaurus/docs/reactnative/ui-components/thread.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Thread from '../common-content/ui-components/channel/props/thread.mdx';

import CloseThread from '../common-content/contexts/thread-context/close_thread.mdx';
import LoadMoreThread from '../common-content/contexts/thread-context/load_more_thread.mdx';
import ParentMessagePreventPress from '../common-content/contexts/thread-context/parent_message_prevent_press.mdx';
import ReloadThread from '../common-content/contexts/thread-context/reload_thread.mdx';

Component to render thread replies for a message, along with and input box for adding new thread replies. This component internally uses `MessageList` and `MessageInput` components.
Expand Down Expand Up @@ -70,7 +71,7 @@ Closes thread on dismount, defaults to `true`.

<Client />

### <div class="label description">overrides the value from [ThreadContext](../../contexts/thread-context#closeThread)</div> `closeThread` {#closeThread}
### <div class="label description">overrides the value from [ThreadContext](../../contexts/thread-context#closethread)</div> `closeThread` {#closeThread}

<CloseThread />

Expand All @@ -82,7 +83,7 @@ When true, the underlying input box will be disabled.
| ------- | ------- |
| Boolean | `false` |

### <div class="label description">overrides the value from [ThreadContext](../../contexts/thread-context#loadMoreThread)</div> `loadMoreThread` {#loadMoreThread}
### <div class="label description">overrides the value from [ThreadContext](../../contexts/thread-context#loadmorethread)</div> `loadMoreThread` {#loadMoreThread}

<LoadMoreThread />

Expand All @@ -94,7 +95,11 @@ Function which gets called when Thread component un-mounts.
| -------- |
| Function |

### <div class="label description">overrides the value from [ThreadContext](../../contexts/thread-context#reloadThread)</div> `reloadThread` {#reloadThread}
### <div class="label description">overrides the value from [ThreadContext](../../contexts/thread-context#parentmessagepreventpress)</div> `parentMessagePreventPress` {#parentMessagePreventPress}

<ParentMessagePreventPress />

### <div class="label description">overrides the value from [ThreadContext](../../contexts/thread-context#reloadthread)</div> `reloadthread` {#reloadThread}

<ReloadThread />

Expand Down
4 changes: 2 additions & 2 deletions examples/ExpoMessaging/components/AuthProgressLoader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import {ActivityIndicator, StyleSheet} from 'react-native';
import {SafeAreaView} from 'react-native-safe-area-context';
import { ActivityIndicator, StyleSheet } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';

export const AuthProgressLoader = () => {
return (
Expand Down
1 change: 1 addition & 0 deletions examples/ExpoMessaging/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const STREAM_API_KEY = 'q95x9hkbyd6p';
export const userToken =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoicm9uIn0.eRVjxLvd4aqCEHY_JRa97g6k7WpHEhxL7Z4K4yTot1c';

export const user = {
id: 'ron',
};
52 changes: 23 additions & 29 deletions examples/ExpoMessaging/context/AppContext.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,33 @@
import { PropsWithChildren, createContext, useContext, useState } from "react";
import { StreamChatGenerics } from "../types";
import { Channel as ChannelType } from "stream-chat";
import { ThreadContextValue } from "stream-chat-expo";
import { PropsWithChildren, createContext, useContext, useState } from 'react';
import { StreamChatGenerics } from '../types';
import { Channel as ChannelType } from 'stream-chat';
import { ThreadContextValue } from 'stream-chat-expo';

export type AppContextType = {
channel: ChannelType<StreamChatGenerics> | undefined;
setChannel: React.Dispatch<
React.SetStateAction<ChannelType<StreamChatGenerics> | undefined>
>;
setThread: React.Dispatch<
React.SetStateAction<
ThreadContextValue<StreamChatGenerics>["thread"] | undefined
>
>;
thread: ThreadContextValue<StreamChatGenerics>["thread"] | undefined;
channel: ChannelType<StreamChatGenerics> | undefined;
setChannel: React.Dispatch<React.SetStateAction<ChannelType<StreamChatGenerics> | undefined>>;
setThread: React.Dispatch<
React.SetStateAction<ThreadContextValue<StreamChatGenerics>['thread'] | undefined>
>;
thread: ThreadContextValue<StreamChatGenerics>['thread'] | undefined;
};

export const AppContext = createContext<AppContextType>({
channel: undefined,
setChannel: undefined,
setThread: undefined,
thread: undefined,
channel: undefined,
setChannel: undefined,
setThread: undefined,
thread: undefined,
});

export const AppProvider = ({ children }: PropsWithChildren) => {
const [channel, setChannel] = useState<
ChannelType<StreamChatGenerics> | undefined
>(undefined);
const [thread, setThread] = useState<
ThreadContextValue<StreamChatGenerics>["thread"] | undefined
>(undefined);
const [channel, setChannel] = useState<ChannelType<StreamChatGenerics> | undefined>(undefined);
const [thread, setThread] = useState<
ThreadContextValue<StreamChatGenerics>['thread'] | undefined
>(undefined);

return (
<AppContext.Provider value={{ channel, setChannel, thread, setThread }}>
{children}
</AppContext.Provider>
);
return (
<AppContext.Provider value={{ channel, setChannel, thread, setThread }}>
{children}
</AppContext.Provider>
);
};
50 changes: 25 additions & 25 deletions examples/ExpoMessaging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,39 @@
"eject": "expo eject"
},
"dependencies": {
"@react-native-community/netinfo": "11.1.0",
"@react-native-community/netinfo": "11.3.1",
"@react-navigation/elements": "^1.3.30",
"expo": "~50.0.19",
"expo-av": "~13.10.6",
"expo-clipboard": "~5.0.1",
"expo-constants": "~15.4.6",
"expo-document-picker": "~11.10.1",
"expo-file-system": "~16.0.9",
"expo-haptics": "~12.8.1",
"expo-image-manipulator": "~11.8.0",
"expo-image-picker": "~14.7.1",
"expo-linking": "~6.2.2",
"expo-media-library": "~15.9.2",
"expo-router": "~3.4.10",
"expo-sharing": "~11.10.0",
"expo-splash-screen": "~0.26.5",
"expo-status-bar": "~1.11.1",
"expo": "~51.0.14",
"expo-av": "~14.0.5",
"expo-clipboard": "~6.0.3",
"expo-constants": "~16.0.2",
"expo-document-picker": "~12.0.2",
"expo-file-system": "~17.0.1",
"expo-haptics": "~13.0.1",
"expo-image-manipulator": "~12.0.5",
"expo-image-picker": "~15.0.5",
"expo-linking": "~6.3.1",
"expo-media-library": "~16.0.4",
"expo-router": "~3.5.16",
"expo-sharing": "~12.0.1",
"expo-splash-screen": "~0.27.5",
"expo-status-bar": "~1.12.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.73.6",
"react-native-gesture-handler": "~2.14.0",
"react-native-quick-sqlite": "^8.0.6",
"react-native-reanimated": "~3.6.2",
"react-native-safe-area-context": "4.8.2",
"react-native-screens": "~3.29.0",
"react-native-svg": "14.1.0",
"react-native": "0.74.2",
"react-native-gesture-handler": "~2.16.1",
"react-native-quick-sqlite": "^8.1.0",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.1",
"react-native-screens": "3.31.1",
"react-native-svg": "15.2.0",
"react-native-web": "~0.19.6",
"stream-chat-expo": "link:../../package/expo-package",
"stream-chat-react-native-core": "link:../../package",
"typescript": "^5.3.0"
"typescript": "~5.3.3"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/core": "^7.24.0",
"@rnx-kit/metro-config": "^1.3.15",
"@rnx-kit/metro-resolver-symlinks": "^0.1.35"
},
Expand Down
Loading

0 comments on commit e94350c

Please sign in to comment.