Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/SampleApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"react-native-teleport": "^1.1.7",
"react-native-video": "^6.19.2",
"react-native-worklets": "^0.8.3",
"stream-chat": "^9.45.6",
"stream-chat": "^9.46.0",
"stream-chat-react-native": "workspace:^",
"stream-chat-react-native-core": "workspace:^"
},
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type { ComponentOverrides } from 'stream-chat-react-native';
import { useTheme } from 'stream-chat-react-native';

import { CustomAttachmentPickerContent } from './AttachmentPickerContent';
import { ChannelDetailsNavigationSection } from './ChannelDetailsNavigationSection';
import { FastImageAdapter } from './FastImageAdapter';
import { MessageLocation } from './LocationSharing/MessageLocation';
import type { MessageOverlayBackdropConfigItem } from './SecretMenu';
Expand Down Expand Up @@ -45,7 +44,6 @@ export const useSampleAppComponentOverrides = (
useMemo<ComponentOverrides>(
() => ({
AttachmentPickerContent: CustomAttachmentPickerContent,
ChannelDetailsNavigationSection,
ChannelListHeaderNetworkDownIndicator: RenderNull,
ImageComponent: FastImageAdapter,
MessageLocation,
Expand Down
80 changes: 0 additions & 80 deletions examples/SampleApp/src/hooks/usePaginatedAttachments.ts

This file was deleted.

24 changes: 24 additions & 0 deletions examples/SampleApp/src/screens/ChannelDetailsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import type { NativeStackNavigationProp } from '@react-navigation/native-stack';

import {
ChannelDetails,
GetChannelDetailsNavigationItems,
GetChannelMemberActionItems,
ChannelAddMembersModal,
ChannelAllMembersModal,
ChannelDetailsContextProvider,
ChannelDetailsNavigationSectionType,
} from 'stream-chat-react-native';

import { SendDirectMessage } from '../icons/SendDirectMessage';
Expand All @@ -27,13 +29,34 @@ type Props = {
route: ChannelDetailsScreenRouteProp;
};

const navigationItems: {
[key in ChannelDetailsNavigationSectionType]:
| 'ChannelPinnedMessagesScreen'
| 'ChannelImagesScreen'
| 'ChannelFilesScreen';
} = {
'pinned-messages': 'ChannelPinnedMessagesScreen',
'photos-and-videos': 'ChannelImagesScreen',
files: 'ChannelFilesScreen',
};

export const ChannelDetailsScreen: React.FC<Props> = ({
navigation,
route: {
params: { channel },
},
}) => {
const onBack = useCallback(() => navigation.goBack(), [navigation]);
const getNavigationItems = useCallback<GetChannelDetailsNavigationItems>(
({ defaultItems }) =>
defaultItems.map((item) => ({
...item,
...(navigationItems[item.section]
? { onPress: () => navigation.navigate(navigationItems[item.section], { channel }) }
: {}),
})),
[navigation, channel],
);
const popToRoot = useCallback(
() =>
navigation.reset({
Expand Down Expand Up @@ -82,6 +105,7 @@ export const ChannelDetailsScreen: React.FC<Props> = ({
<ChannelDetails
channel={channel}
getChannelMemberActionItems={getChannelMemberActionItems}
getNavigationItems={getNavigationItems}
onBack={onBack}
onChannelDismiss={popToRoot}
// Handler view all members modal so we can close it after navigation is triggered by our custom action
Expand Down
Loading
Loading