Skip to content

Commit be25781

Browse files
committed
chore: rename ChannelListMessenger
1 parent 850a35b commit be25781

File tree

8 files changed

+29
-29
lines changed

8 files changed

+29
-29
lines changed

examples/SampleApp/src/screens/SharedGroupsScreen.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
33
import { NavigationProp, RouteProp, useNavigation } from '@react-navigation/native';
44
import {
55
ChannelList,
6-
ChannelListMessenger,
7-
ChannelListMessengerProps,
6+
ChannelListView,
7+
ChannelListViewProps,
88
ChannelPreviewMessengerProps,
99
getChannelPreviewDisplayAvatar,
1010
GroupAvatar,
@@ -150,7 +150,7 @@ const EmptyListComponent = () => {
150150
);
151151
};
152152

153-
type ListComponentProps = ChannelListMessengerProps;
153+
type ListComponentProps = ChannelListViewProps;
154154

155155
// If the length of channels is 1, which means we only got 1:1-distinct channel,
156156
// And we don't want to show 1:1-distinct channel in this list.
@@ -161,7 +161,7 @@ const ListComponent: React.FC<ListComponentProps> = (props) => {
161161
return <EmptyListComponent />;
162162
}
163163

164-
return <ChannelListMessenger {...props} />;
164+
return <ChannelListView {...props} />;
165165
};
166166

167167
type SharedGroupsScreenRouteProp = RouteProp<StackNavigatorParamList, 'SharedGroupsScreen'>;

package/src/components/ChannelList/ChannelList.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { ChannelListFooterLoadingIndicator } from './ChannelListFooterLoadingInd
1515
import { ChannelListHeaderErrorIndicator } from './ChannelListHeaderErrorIndicator';
1616
import { ChannelListHeaderNetworkDownIndicator } from './ChannelListHeaderNetworkDownIndicator';
1717
import { ChannelListLoadingIndicator } from './ChannelListLoadingIndicator';
18-
import { ChannelListMessenger, ChannelListMessengerProps } from './ChannelListMessenger';
18+
import { ChannelListView, ChannelListViewProps } from './ChannelListView';
1919
import { useChannelUpdated } from './hooks/listeners/useChannelUpdated';
2020
import { useCreateChannelsContext } from './hooks/useCreateChannelsContext';
2121
import { usePaginatedChannels } from './hooks/usePaginatedChannels';
@@ -78,9 +78,9 @@ export type ChannelListProps = Partial<
7878
/**
7979
* Custom UI component to display the list of channels
8080
*
81-
* Default: [ChannelListMessenger](https://getstream.io/chat/docs/sdk/reactnative/ui-components/channel-list-messenger/)
81+
* Default: [ChannelListView](https://getstream.io/chat/docs/sdk/reactnative/ui-components/channel-list-view/)
8282
*/
83-
List?: React.ComponentType<ChannelListMessengerProps>;
83+
List?: React.ComponentType<ChannelListViewProps>;
8484
/**
8585
* If set to true, channels won't dynamically sort by most recent message, defaults to false
8686
*/
@@ -248,7 +248,7 @@ const DEFAULT_SORT = {};
248248
/**
249249
* This component fetches a list of channels, allowing you to select the channel you want to open.
250250
* The ChannelList doesn't provide any UI for the underlying React Native FlatList. UI is determined by the `List` component which is
251-
* provided to the ChannelList component as a prop. By default, the ChannelListMessenger component is used as the list UI.
251+
* provided to the ChannelList component as a prop. By default, the ChannelListView component is used as the list UI.
252252
*
253253
* @example ./ChannelList.md
254254
*/
@@ -261,7 +261,7 @@ export const ChannelList = (props: ChannelListProps) => {
261261
FooterLoadingIndicator = ChannelListFooterLoadingIndicator,
262262
HeaderErrorIndicator = ChannelListHeaderErrorIndicator,
263263
HeaderNetworkDownIndicator = ChannelListHeaderNetworkDownIndicator,
264-
List = ChannelListMessenger,
264+
List = ChannelListView,
265265
ListHeaderComponent,
266266
LoadingErrorIndicator = LoadingErrorIndicatorDefault,
267267
LoadingIndicator = ChannelListLoadingIndicator,

package/src/components/ChannelList/ChannelListMessenger.tsx renamed to package/src/components/ChannelList/ChannelListView.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { useTheme } from '../../contexts/themeContext/ThemeContext';
1616
import { useStableCallback } from '../../hooks';
1717
import { ChannelPreview } from '../ChannelPreview/ChannelPreview';
1818

19-
export type ChannelListMessengerPropsWithContext = Omit<
19+
export type ChannelListViewPropsWithContext = Omit<
2020
ChannelsContextValue,
2121
| 'HeaderErrorIndicator'
2222
| 'HeaderNetworkDownIndicator'
@@ -61,7 +61,7 @@ const renderItem = ({ item }: { item: Channel }) => <ChannelPreview channel={ite
6161

6262
const keyExtractor = (item: Channel) => item.cid;
6363

64-
const ChannelListMessengerWithContext = (props: ChannelListMessengerPropsWithContext) => {
64+
const ChannelListViewWithContext = (props: ChannelListViewPropsWithContext) => {
6565
const onEndReachedCalledDuringCurrentScrollRef = useRef<boolean>(false);
6666
const {
6767
additionalFlatListProps,
@@ -159,23 +159,23 @@ const ChannelListMessengerWithContext = (props: ChannelListMessengerPropsWithCon
159159
refreshing={refreshing}
160160
renderItem={renderItem}
161161
style={styles.flatList}
162-
testID='channel-list-messenger'
162+
testID='channel-list-view'
163163
{...additionalFlatListProps}
164164
/>
165165
<StatusIndicator />
166166
</>
167167
);
168168
};
169169

170-
export type ChannelListMessengerProps = Partial<ChannelListMessengerPropsWithContext>;
170+
export type ChannelListViewProps = Partial<ChannelListViewPropsWithContext>;
171171

172172
/**
173173
* This UI component displays the preview list of channels and handles Channel navigation. It
174174
* receives all props from the ChannelList component.
175175
*
176-
* @example ./ChannelListMessenger.md
176+
* @example ./ChannelListView.md
177177
*/
178-
export const ChannelListMessenger = (props: ChannelListMessengerProps) => {
178+
export const ChannelListView = (props: ChannelListViewProps) => {
179179
const {
180180
additionalFlatListProps,
181181
channelListInitialized,
@@ -199,7 +199,7 @@ export const ChannelListMessenger = (props: ChannelListMessengerProps) => {
199199
} = useChannelsContext();
200200

201201
return (
202-
<ChannelListMessengerWithContext
202+
<ChannelListViewWithContext
203203
{...{
204204
additionalFlatListProps,
205205
channelListInitialized,
@@ -226,12 +226,12 @@ export const ChannelListMessenger = (props: ChannelListMessengerProps) => {
226226
);
227227
};
228228

229-
ChannelListMessenger.displayName = 'ChannelListMessenger{channelListMessenger}';
229+
ChannelListView.displayName = 'ChannelListView{channelListView}';
230230

231231
const useStyles = () => {
232232
const {
233233
theme: {
234-
channelListMessenger: { flatList, flatListContent },
234+
channelListView: { flatList, flatListContent },
235235
},
236236
} = useTheme();
237237
return useMemo(() => {

package/src/components/ChannelList/__tests__/ChannelList.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ describe('ChannelList', () => {
427427
);
428428

429429
await waitFor(() => {
430-
expect(screen.getByTestId('channel-list-messenger')).toBeTruthy();
430+
expect(screen.getByTestId('channel-list-view')).toBeTruthy();
431431
});
432432

433433
const newMessage = sendNewMessageOnChannel3();

package/src/components/ChannelList/__tests__/ChannelListMessenger.test.js renamed to package/src/components/ChannelList/__tests__/ChannelListView.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { generateChannelResponse } from '../../../mock-builders/generator/channe
1414
import { getTestClientWithUser } from '../../../mock-builders/mock';
1515
import { Chat } from '../../Chat/Chat';
1616
import { ChannelList } from '../ChannelList';
17-
import { ChannelListMessenger } from '../ChannelListMessenger';
17+
import { ChannelListView } from '../ChannelListView';
1818

1919
let mockChannels;
2020
let chatClient;
@@ -24,7 +24,7 @@ const ListMessenger = ({ error, loadingChannels, ...props }) => {
2424

2525
return (
2626
<ChannelsProvider value={{ ...channelsContext, error, loadingChannels }}>
27-
<ChannelListMessenger {...props} />
27+
<ChannelListView {...props} />
2828
</ChannelsProvider>
2929
);
3030
};
@@ -54,7 +54,7 @@ const Component = ({ error = false, loadingChannels = false }) => {
5454
);
5555
};
5656

57-
describe('ChannelListMessenger', () => {
57+
describe('ChannelListView', () => {
5858
beforeAll(async () => {
5959
chatClient = await getTestClientWithUser({ id: 'vishal' });
6060
const c1 = generateChannelResponse();
@@ -71,7 +71,7 @@ describe('ChannelListMessenger', () => {
7171
it('renders without crashing', async () => {
7272
const { getByTestId } = render(<Component />);
7373
await waitFor(() => {
74-
expect(getByTestId('channel-list-messenger')).toBeTruthy();
74+
expect(getByTestId('channel-list-view')).toBeTruthy();
7575
});
7676
});
7777

package/src/components/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export * from './ChannelList/ChannelListFooterLoadingIndicator';
3838
export * from './ChannelList/ChannelListHeaderErrorIndicator';
3939
export * from './ChannelList/ChannelListHeaderNetworkDownIndicator';
4040
export * from './ChannelList/ChannelListLoadingIndicator';
41-
export * from './ChannelList/ChannelListMessenger';
41+
export * from './ChannelList/ChannelListView';
4242
export * from './ChannelList/Skeleton';
4343
export * from './ChannelList/hooks';
4444

package/src/contexts/channelsContext/ChannelsContext.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ import { isTestEnvironment } from '../utils/isTestEnvironment';
2828

2929
export type ChannelsContextValue = {
3030
/**
31-
* Besides the existing default behavior of the ChannelListMessenger component, you can attach
31+
* Besides the existing default behavior of the ChannelListView component, you can attach
3232
* additional props to the underlying React Native FlatList.
3333
*
3434
* You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props
3535
*
3636
* **EXAMPLE:**
3737
*
3838
* ```
39-
* <ChannelListMessenger
39+
* <ChannelListView
4040
* channels={channels}
4141
* additionalFlatListProps={{ bounces: true }}
4242
* />
@@ -152,7 +152,7 @@ export type ChannelsContextValue = {
152152
* **Example:**
153153
*
154154
* ```
155-
* <ChannelListMessenger
155+
* <ChannelListView
156156
* setFlatListRef={(ref) => {
157157
* // Use ref for your own good
158158
* }}

package/src/contexts/themeContext/utils/theme.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export type Theme = {
164164
channelListLoadingIndicator: {
165165
container: ViewStyle;
166166
};
167-
channelListMessenger: {
167+
channelListView: {
168168
flatList: ViewStyle;
169169
flatListContent: ViewStyle;
170170
};
@@ -1095,7 +1095,7 @@ export const defaultTheme: Theme = {
10951095
channelListLoadingIndicator: {
10961096
container: {},
10971097
},
1098-
channelListMessenger: {
1098+
channelListView: {
10991099
flatList: {},
11001100
flatListContent: {},
11011101
},

0 commit comments

Comments
 (0)