stream-chat-react-native-core 9.0.0-beta.32 → 9.0.0-beta.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Attachment/Giphy/Giphy.js +5 -3
- package/lib/commonjs/components/Attachment/Giphy/Giphy.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +0 -3
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +0 -2
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListView.js +6 -6
- package/lib/commonjs/components/ChannelList/ChannelListView.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +3 -3
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +9 -9
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewView.js +13 -13
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewView.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageItemView.js +5 -2
- package/lib/commonjs/components/Message/MessageItemView/MessageItemView.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js +2 -35
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/commonjs/contexts/componentsContext/PLAN.md +15 -15
- package/lib/commonjs/contexts/componentsContext/defaultComponents.js +14 -13
- package/lib/commonjs/contexts/componentsContext/defaultComponents.js.map +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/MessageOverlayHostLayer.js +30 -22
- package/lib/commonjs/contexts/overlayContext/MessageOverlayHostLayer.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Giphy/Giphy.js +5 -3
- package/lib/module/components/Attachment/Giphy/Giphy.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +0 -3
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +0 -2
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListView.js +6 -6
- package/lib/module/components/ChannelList/ChannelListView.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js +3 -3
- package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +9 -9
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewView.js +13 -13
- package/lib/module/components/ChannelPreview/ChannelPreviewView.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageItemView.js +5 -2
- package/lib/module/components/Message/MessageItemView/MessageItemView.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useMessageList.js +2 -35
- package/lib/module/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/module/contexts/componentsContext/PLAN.md +15 -15
- package/lib/module/contexts/componentsContext/defaultComponents.js +14 -13
- package/lib/module/contexts/componentsContext/defaultComponents.js.map +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/MessageOverlayHostLayer.js +30 -22
- package/lib/module/contexts/overlayContext/MessageOverlayHostLayer.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts.map +1 -1
- package/lib/typescript/components/ChannelList/ChannelListView.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMessage.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreviewView.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageItemView.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/hooks/useMessageList.d.ts +0 -5
- package/lib/typescript/components/MessageList/hooks/useMessageList.d.ts.map +1 -1
- package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +2 -1
- package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts.map +1 -1
- package/lib/typescript/contexts/componentsContext/ComponentsContext.d.ts +14 -13
- package/lib/typescript/contexts/componentsContext/ComponentsContext.d.ts.map +1 -1
- package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts +15 -13
- package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts.map +1 -1
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +0 -8
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts.map +1 -1
- package/lib/typescript/contexts/overlayContext/MessageOverlayHostLayer.d.ts +7 -0
- package/lib/typescript/contexts/overlayContext/MessageOverlayHostLayer.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/offline-support/offline-feature.js +12 -4
- package/src/components/Attachment/Giphy/Giphy.tsx +11 -6
- package/src/components/Attachment/__tests__/Giphy.test.js +25 -0
- package/src/components/Channel/Channel.tsx +0 -3
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +0 -2
- package/src/components/ChannelList/ChannelListView.tsx +6 -5
- package/src/components/ChannelList/__tests__/ChannelList.test.js +35 -35
- package/src/components/ChannelPreview/ChannelPreview.tsx +3 -3
- package/src/components/ChannelPreview/ChannelPreviewMessage.tsx +11 -8
- package/src/components/ChannelPreview/ChannelPreviewView.tsx +17 -13
- package/src/components/ChannelPreview/__tests__/ChannelPreview.test.tsx +2 -2
- package/src/components/Message/MessageItemView/MessageItemView.tsx +2 -0
- package/src/components/MessageList/__tests__/MessageList.test.js +1 -130
- package/src/components/MessageList/hooks/useMessageList.ts +1 -41
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +24 -4
- package/src/contexts/channelsContext/ChannelsContext.tsx +2 -1
- package/src/contexts/componentsContext/PLAN.md +15 -15
- package/src/contexts/componentsContext/__tests__/defaultComponents.test.ts +1 -0
- package/src/contexts/componentsContext/defaultComponents.ts +15 -13
- package/src/contexts/messagesContext/MessagesContext.tsx +0 -9
- package/src/contexts/overlayContext/MessageOverlayHostLayer.tsx +36 -16
- package/src/contexts/overlayContext/__tests__/MessageOverlayHostLayer.test.tsx +59 -1
- package/src/version.json +1 -1
|
@@ -147,6 +147,31 @@ describe('Giphy', () => {
|
|
|
147
147
|
});
|
|
148
148
|
});
|
|
149
149
|
|
|
150
|
+
it('uses the outgoing bubble background for ephemeral giphy previews', async () => {
|
|
151
|
+
render(
|
|
152
|
+
getAttachmentComponent(
|
|
153
|
+
{
|
|
154
|
+
attachment: {
|
|
155
|
+
...attachment,
|
|
156
|
+
actions,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{ isMyMessage: false },
|
|
160
|
+
),
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
await waitFor(() => {
|
|
164
|
+
const style = screen.getByTestId('giphy-action-attachment').props.style;
|
|
165
|
+
expect(style).toEqual(
|
|
166
|
+
expect.arrayContaining([
|
|
167
|
+
expect.objectContaining({
|
|
168
|
+
backgroundColor: lightTheme.semantics.chatBgOutgoing,
|
|
169
|
+
}),
|
|
170
|
+
]),
|
|
171
|
+
);
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
|
|
150
175
|
it('"giphy" attachment size should be customisable', async () => {
|
|
151
176
|
attachment.giphy = giphy;
|
|
152
177
|
render(getAttachmentComponent({ attachment, giphyVersion: 'fixed_height' }));
|
|
@@ -235,7 +235,6 @@ export type ChannelPropsWithContext = Pick<ChannelContextValue, 'channel'> &
|
|
|
235
235
|
MessagesContextValue,
|
|
236
236
|
| 'additionalPressableProps'
|
|
237
237
|
| 'customMessageSwipeAction'
|
|
238
|
-
| 'deletedMessagesVisibilityType'
|
|
239
238
|
| 'disableTypingIndicator'
|
|
240
239
|
| 'dismissKeyboardOnMessageTouch'
|
|
241
240
|
| 'enableSwipeToReply'
|
|
@@ -405,7 +404,6 @@ const ChannelWithContext = (props: PropsWithChildren<ChannelPropsWithContext>) =
|
|
|
405
404
|
compressImageQuality,
|
|
406
405
|
createPollOptionGap,
|
|
407
406
|
customMessageSwipeAction,
|
|
408
|
-
deletedMessagesVisibilityType = 'always',
|
|
409
407
|
disableKeyboardCompatibleView = false,
|
|
410
408
|
disableTypingIndicator,
|
|
411
409
|
dismissKeyboardOnMessageTouch = true,
|
|
@@ -1635,7 +1633,6 @@ const ChannelWithContext = (props: PropsWithChildren<ChannelPropsWithContext>) =
|
|
|
1635
1633
|
additionalPressableProps,
|
|
1636
1634
|
channelId,
|
|
1637
1635
|
customMessageSwipeAction,
|
|
1638
|
-
deletedMessagesVisibilityType,
|
|
1639
1636
|
deleteMessage,
|
|
1640
1637
|
deleteReaction,
|
|
1641
1638
|
disableTypingIndicator,
|
|
@@ -6,7 +6,6 @@ export const useCreateMessagesContext = ({
|
|
|
6
6
|
additionalPressableProps,
|
|
7
7
|
channelId,
|
|
8
8
|
customMessageSwipeAction,
|
|
9
|
-
deletedMessagesVisibilityType,
|
|
10
9
|
deleteMessage,
|
|
11
10
|
deleteReaction,
|
|
12
11
|
disableTypingIndicator,
|
|
@@ -70,7 +69,6 @@ export const useCreateMessagesContext = ({
|
|
|
70
69
|
() => ({
|
|
71
70
|
additionalPressableProps,
|
|
72
71
|
customMessageSwipeAction,
|
|
73
|
-
deletedMessagesVisibilityType,
|
|
74
72
|
deleteMessage,
|
|
75
73
|
deleteReaction,
|
|
76
74
|
disableTypingIndicator,
|
|
@@ -26,7 +26,8 @@ const StatusIndicator = () => {
|
|
|
26
26
|
const { isOnline } = useChatContext();
|
|
27
27
|
const styles = useStyles();
|
|
28
28
|
const { error, loadingChannels, refreshList } = useChannelsContext();
|
|
29
|
-
const {
|
|
29
|
+
const { ChannelListHeaderErrorIndicator, ChannelListHeaderNetworkDownIndicator } =
|
|
30
|
+
useComponentsContext();
|
|
30
31
|
|
|
31
32
|
if (loadingChannels) {
|
|
32
33
|
return null;
|
|
@@ -35,13 +36,13 @@ const StatusIndicator = () => {
|
|
|
35
36
|
if (!isOnline) {
|
|
36
37
|
return (
|
|
37
38
|
<View style={styles.statusIndicator}>
|
|
38
|
-
<
|
|
39
|
+
<ChannelListHeaderNetworkDownIndicator />
|
|
39
40
|
</View>
|
|
40
41
|
);
|
|
41
42
|
} else if (error) {
|
|
42
43
|
return (
|
|
43
44
|
<View style={styles.statusIndicator}>
|
|
44
|
-
<
|
|
45
|
+
<ChannelListHeaderErrorIndicator onPress={refreshList} />
|
|
45
46
|
</View>
|
|
46
47
|
);
|
|
47
48
|
}
|
|
@@ -72,7 +73,7 @@ const ChannelListViewWithContext = (props: ChannelListViewPropsWithContext) => {
|
|
|
72
73
|
} = props;
|
|
73
74
|
const {
|
|
74
75
|
EmptyStateIndicator,
|
|
75
|
-
|
|
76
|
+
ChannelListFooterLoadingIndicator,
|
|
76
77
|
ListHeaderComponent,
|
|
77
78
|
LoadingErrorIndicator,
|
|
78
79
|
ChannelListLoadingIndicator: LoadingIndicator,
|
|
@@ -138,7 +139,7 @@ const ChannelListViewWithContext = (props: ChannelListViewPropsWithContext) => {
|
|
|
138
139
|
ListEmptyComponent={
|
|
139
140
|
loading ? <LoadingIndicator /> : <EmptyStateIndicator listType='channel' />
|
|
140
141
|
}
|
|
141
|
-
ListFooterComponent={loadingNextPage ? <
|
|
142
|
+
ListFooterComponent={loadingNextPage ? <ChannelListFooterLoadingIndicator /> : undefined}
|
|
142
143
|
ListHeaderComponent={ListHeaderComponent}
|
|
143
144
|
onEndReached={onEndReached}
|
|
144
145
|
onEndReachedThreshold={loadMoreThreshold}
|
|
@@ -46,7 +46,7 @@ jest.mock('../../ChannelPreview/ChannelSwipableWrapper', () => ({
|
|
|
46
46
|
}));
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
* Custom
|
|
49
|
+
* Custom ChannelPreview component used via WithComponents to verify channel rendering.
|
|
50
50
|
* Receives { channel, muted, unread, lastMessage } from ChannelPreview.
|
|
51
51
|
*/
|
|
52
52
|
const ChannelPreviewComponent = ({ channel }) => (
|
|
@@ -58,7 +58,7 @@ const ChannelPreviewComponent = ({ channel }) => (
|
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* Probe that reads swipeActionsEnabled from ChannelsContext.
|
|
61
|
-
* Used as a
|
|
61
|
+
* Used as a ChannelPreview override to inspect context values.
|
|
62
62
|
*/
|
|
63
63
|
const SwipeActionsProbe = () => {
|
|
64
64
|
const { swipeActionsEnabled } = useChannelsContext();
|
|
@@ -119,7 +119,7 @@ describe('ChannelList', () => {
|
|
|
119
119
|
|
|
120
120
|
const { getByTestId } = render(
|
|
121
121
|
<Chat client={chatClient}>
|
|
122
|
-
<WithComponents overrides={{
|
|
122
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
123
123
|
<ChannelList {...props} />
|
|
124
124
|
</WithComponents>
|
|
125
125
|
</Chat>,
|
|
@@ -133,7 +133,7 @@ describe('ChannelList', () => {
|
|
|
133
133
|
|
|
134
134
|
const { getByTestId } = render(
|
|
135
135
|
<Chat client={chatClient}>
|
|
136
|
-
<WithComponents overrides={{
|
|
136
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
137
137
|
<ChannelList {...props} />
|
|
138
138
|
</WithComponents>
|
|
139
139
|
</Chat>,
|
|
@@ -147,7 +147,7 @@ describe('ChannelList', () => {
|
|
|
147
147
|
|
|
148
148
|
render(
|
|
149
149
|
<Chat client={chatClient}>
|
|
150
|
-
<WithComponents overrides={{
|
|
150
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
151
151
|
<ChannelList {...props} />
|
|
152
152
|
</WithComponents>
|
|
153
153
|
</Chat>,
|
|
@@ -162,7 +162,7 @@ describe('ChannelList', () => {
|
|
|
162
162
|
|
|
163
163
|
screen.rerender(
|
|
164
164
|
<Chat client={chatClient}>
|
|
165
|
-
<WithComponents overrides={{
|
|
165
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
166
166
|
<ChannelList {...props} filters={{ dummyFilter: true }} />
|
|
167
167
|
</WithComponents>
|
|
168
168
|
</Chat>,
|
|
@@ -204,7 +204,7 @@ describe('ChannelList', () => {
|
|
|
204
204
|
|
|
205
205
|
const { rerender, queryByTestId } = render(
|
|
206
206
|
<Chat client={chatClient}>
|
|
207
|
-
<WithComponents overrides={{
|
|
207
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
208
208
|
<ChannelList {...props} filters={staleFilter} />
|
|
209
209
|
</WithComponents>
|
|
210
210
|
</Chat>,
|
|
@@ -224,7 +224,7 @@ describe('ChannelList', () => {
|
|
|
224
224
|
|
|
225
225
|
rerender(
|
|
226
226
|
<Chat client={chatClient}>
|
|
227
|
-
<WithComponents overrides={{
|
|
227
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
228
228
|
<ChannelList {...props} filters={freshFilter} />
|
|
229
229
|
</WithComponents>
|
|
230
230
|
</Chat>,
|
|
@@ -254,7 +254,7 @@ describe('ChannelList', () => {
|
|
|
254
254
|
|
|
255
255
|
render(
|
|
256
256
|
<Chat client={chatClient}>
|
|
257
|
-
<WithComponents overrides={{
|
|
257
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
258
258
|
<ChannelList {...props} onSelect={setActiveChannel} />
|
|
259
259
|
</WithComponents>
|
|
260
260
|
</Chat>,
|
|
@@ -276,7 +276,7 @@ describe('ChannelList', () => {
|
|
|
276
276
|
|
|
277
277
|
const { getByTestId } = render(
|
|
278
278
|
<Chat client={chatClient}>
|
|
279
|
-
<WithComponents overrides={{
|
|
279
|
+
<WithComponents overrides={{ ChannelPreview: SwipeActionsProbe }}>
|
|
280
280
|
<ChannelList {...props} swipeActionsEnabled={false} />
|
|
281
281
|
</WithComponents>
|
|
282
282
|
</Chat>,
|
|
@@ -291,7 +291,7 @@ describe('ChannelList', () => {
|
|
|
291
291
|
|
|
292
292
|
const { getByTestId } = render(
|
|
293
293
|
<Chat client={chatClient}>
|
|
294
|
-
<WithComponents overrides={{
|
|
294
|
+
<WithComponents overrides={{ ChannelPreview: SwipeActionsProbe }}>
|
|
295
295
|
<ChannelList {...props} />
|
|
296
296
|
</WithComponents>
|
|
297
297
|
</Chat>,
|
|
@@ -306,7 +306,7 @@ describe('ChannelList', () => {
|
|
|
306
306
|
|
|
307
307
|
const { getByTestId, queryByTestId } = render(
|
|
308
308
|
<Chat client={chatClient}>
|
|
309
|
-
<WithComponents overrides={{
|
|
309
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewContent }}>
|
|
310
310
|
<ChannelList {...props} swipeActionsEnabled={false} />
|
|
311
311
|
</WithComponents>
|
|
312
312
|
</Chat>,
|
|
@@ -323,7 +323,7 @@ describe('ChannelList', () => {
|
|
|
323
323
|
|
|
324
324
|
const { getByTestId } = render(
|
|
325
325
|
<Chat client={chatClient}>
|
|
326
|
-
<WithComponents overrides={{
|
|
326
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewContent }}>
|
|
327
327
|
<ChannelList {...props} swipeActionsEnabled={true} />
|
|
328
328
|
</WithComponents>
|
|
329
329
|
</Chat>,
|
|
@@ -344,7 +344,7 @@ describe('ChannelList', () => {
|
|
|
344
344
|
<WithComponents
|
|
345
345
|
overrides={{
|
|
346
346
|
ChannelDetailsBottomSheet: ChannelDetailsBottomSheetOverride,
|
|
347
|
-
|
|
347
|
+
ChannelPreview: ChannelDetailsBottomSheetProbe,
|
|
348
348
|
}}
|
|
349
349
|
>
|
|
350
350
|
<ChannelList {...props} />
|
|
@@ -366,7 +366,7 @@ describe('ChannelList', () => {
|
|
|
366
366
|
<WithComponents
|
|
367
367
|
overrides={{
|
|
368
368
|
ChannelDetailsBottomSheet: ChannelDetailsBottomSheetOverride,
|
|
369
|
-
|
|
369
|
+
ChannelPreview: ChannelDetailsBottomSheetProbe,
|
|
370
370
|
}}
|
|
371
371
|
>
|
|
372
372
|
<ChannelList {...props} />
|
|
@@ -395,7 +395,7 @@ describe('ChannelList', () => {
|
|
|
395
395
|
it('should move channel to top of the list by default', async () => {
|
|
396
396
|
render(
|
|
397
397
|
<Chat client={chatClient}>
|
|
398
|
-
<WithComponents overrides={{
|
|
398
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
399
399
|
<ChannelList {...props} />
|
|
400
400
|
</WithComponents>
|
|
401
401
|
</Chat>,
|
|
@@ -419,7 +419,7 @@ describe('ChannelList', () => {
|
|
|
419
419
|
it('should add channel to top if channel is hidden from the list', async () => {
|
|
420
420
|
render(
|
|
421
421
|
<Chat client={chatClient}>
|
|
422
|
-
<WithComponents overrides={{
|
|
422
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
423
423
|
<ChannelList {...props} />
|
|
424
424
|
</WithComponents>
|
|
425
425
|
</Chat>,
|
|
@@ -449,7 +449,7 @@ describe('ChannelList', () => {
|
|
|
449
449
|
it('should not alter order if `lockChannelOrder` prop is true', async () => {
|
|
450
450
|
render(
|
|
451
451
|
<Chat client={chatClient}>
|
|
452
|
-
<WithComponents overrides={{
|
|
452
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
453
453
|
<ChannelList lockChannelOrder={true} />
|
|
454
454
|
</WithComponents>
|
|
455
455
|
</Chat>,
|
|
@@ -475,7 +475,7 @@ describe('ChannelList', () => {
|
|
|
475
475
|
const onNewMessage = jest.fn();
|
|
476
476
|
render(
|
|
477
477
|
<Chat client={chatClient}>
|
|
478
|
-
<WithComponents overrides={{
|
|
478
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
479
479
|
<ChannelList {...props} onNewMessage={onNewMessage} />
|
|
480
480
|
</WithComponents>
|
|
481
481
|
</Chat>,
|
|
@@ -504,7 +504,7 @@ describe('ChannelList', () => {
|
|
|
504
504
|
it('should move a channel to top of the list by default', async () => {
|
|
505
505
|
render(
|
|
506
506
|
<Chat client={chatClient}>
|
|
507
|
-
<WithComponents overrides={{
|
|
507
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
508
508
|
<ChannelList {...props} />
|
|
509
509
|
</WithComponents>
|
|
510
510
|
</Chat>,
|
|
@@ -528,7 +528,7 @@ describe('ChannelList', () => {
|
|
|
528
528
|
const onNewMessage = jest.fn();
|
|
529
529
|
render(
|
|
530
530
|
<Chat client={chatClient}>
|
|
531
|
-
<WithComponents overrides={{
|
|
531
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
532
532
|
<ChannelList {...props} onNewMessage={onNewMessage} />
|
|
533
533
|
</WithComponents>
|
|
534
534
|
</Chat>,
|
|
@@ -549,7 +549,7 @@ describe('ChannelList', () => {
|
|
|
549
549
|
const onNewMessageNotification = jest.fn();
|
|
550
550
|
render(
|
|
551
551
|
<Chat client={chatClient}>
|
|
552
|
-
<WithComponents overrides={{
|
|
552
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
553
553
|
<ChannelList {...props} onNewMessageNotification={onNewMessageNotification} />
|
|
554
554
|
</WithComponents>
|
|
555
555
|
</Chat>,
|
|
@@ -578,7 +578,7 @@ describe('ChannelList', () => {
|
|
|
578
578
|
it('should move a channel to top of the list by default', async () => {
|
|
579
579
|
render(
|
|
580
580
|
<Chat client={chatClient}>
|
|
581
|
-
<WithComponents overrides={{
|
|
581
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
582
582
|
<ChannelList {...props} />
|
|
583
583
|
</WithComponents>
|
|
584
584
|
</Chat>,
|
|
@@ -605,7 +605,7 @@ describe('ChannelList', () => {
|
|
|
605
605
|
const onAddedToChannel = jest.fn();
|
|
606
606
|
render(
|
|
607
607
|
<Chat client={chatClient}>
|
|
608
|
-
<WithComponents overrides={{
|
|
608
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
609
609
|
<ChannelList {...props} onAddedToChannel={onAddedToChannel} />
|
|
610
610
|
</WithComponents>
|
|
611
611
|
</Chat>,
|
|
@@ -631,7 +631,7 @@ describe('ChannelList', () => {
|
|
|
631
631
|
it('should remove the channel from list by default', async () => {
|
|
632
632
|
render(
|
|
633
633
|
<Chat client={chatClient}>
|
|
634
|
-
<WithComponents overrides={{
|
|
634
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
635
635
|
<ChannelList {...props} />
|
|
636
636
|
</WithComponents>
|
|
637
637
|
</Chat>,
|
|
@@ -658,7 +658,7 @@ describe('ChannelList', () => {
|
|
|
658
658
|
const onRemovedFromChannel = jest.fn();
|
|
659
659
|
render(
|
|
660
660
|
<Chat client={chatClient}>
|
|
661
|
-
<WithComponents overrides={{
|
|
661
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
662
662
|
<ChannelList {...props} onRemovedFromChannel={onRemovedFromChannel} />
|
|
663
663
|
</WithComponents>
|
|
664
664
|
</Chat>,
|
|
@@ -684,7 +684,7 @@ describe('ChannelList', () => {
|
|
|
684
684
|
it('should update a channel in the list by default', async () => {
|
|
685
685
|
render(
|
|
686
686
|
<Chat client={chatClient}>
|
|
687
|
-
<WithComponents overrides={{
|
|
687
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
688
688
|
<ChannelList {...props} />
|
|
689
689
|
</WithComponents>
|
|
690
690
|
</Chat>,
|
|
@@ -710,7 +710,7 @@ describe('ChannelList', () => {
|
|
|
710
710
|
const onChannelUpdated = jest.fn();
|
|
711
711
|
render(
|
|
712
712
|
<Chat client={chatClient}>
|
|
713
|
-
<WithComponents overrides={{
|
|
713
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
714
714
|
<ChannelList {...props} onChannelUpdated={onChannelUpdated} />
|
|
715
715
|
</WithComponents>
|
|
716
716
|
</Chat>,
|
|
@@ -741,7 +741,7 @@ describe('ChannelList', () => {
|
|
|
741
741
|
it('should remove a channel from the list by default', async () => {
|
|
742
742
|
render(
|
|
743
743
|
<Chat client={chatClient}>
|
|
744
|
-
<WithComponents overrides={{
|
|
744
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
745
745
|
<ChannelList {...props} />
|
|
746
746
|
</WithComponents>
|
|
747
747
|
</Chat>,
|
|
@@ -768,7 +768,7 @@ describe('ChannelList', () => {
|
|
|
768
768
|
const onChannelDeleted = jest.fn();
|
|
769
769
|
render(
|
|
770
770
|
<Chat client={chatClient}>
|
|
771
|
-
<WithComponents overrides={{
|
|
771
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
772
772
|
<ChannelList {...props} onChannelDeleted={onChannelDeleted} />
|
|
773
773
|
</WithComponents>
|
|
774
774
|
</Chat>,
|
|
@@ -794,7 +794,7 @@ describe('ChannelList', () => {
|
|
|
794
794
|
it('should hide a channel from the list by default', async () => {
|
|
795
795
|
render(
|
|
796
796
|
<Chat client={chatClient}>
|
|
797
|
-
<WithComponents overrides={{
|
|
797
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
798
798
|
<ChannelList {...props} />
|
|
799
799
|
</WithComponents>
|
|
800
800
|
</Chat>,
|
|
@@ -821,7 +821,7 @@ describe('ChannelList', () => {
|
|
|
821
821
|
const onChannelHidden = jest.fn();
|
|
822
822
|
render(
|
|
823
823
|
<Chat client={chatClient}>
|
|
824
|
-
<WithComponents overrides={{
|
|
824
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
825
825
|
<ChannelList {...props} onChannelHidden={onChannelHidden} />
|
|
826
826
|
</WithComponents>
|
|
827
827
|
</Chat>,
|
|
@@ -846,7 +846,7 @@ describe('ChannelList', () => {
|
|
|
846
846
|
|
|
847
847
|
render(
|
|
848
848
|
<Chat client={chatClient}>
|
|
849
|
-
<WithComponents overrides={{
|
|
849
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
850
850
|
<ChannelList {...props} />
|
|
851
851
|
</WithComponents>
|
|
852
852
|
</Chat>,
|
|
@@ -874,7 +874,7 @@ describe('ChannelList', () => {
|
|
|
874
874
|
|
|
875
875
|
render(
|
|
876
876
|
<Chat client={chatClient}>
|
|
877
|
-
<WithComponents overrides={{
|
|
877
|
+
<WithComponents overrides={{ ChannelPreview: RefreshingProbe }}>
|
|
878
878
|
<ChannelList {...props} />
|
|
879
879
|
</WithComponents>
|
|
880
880
|
</Chat>,
|
|
@@ -909,7 +909,7 @@ describe('ChannelList', () => {
|
|
|
909
909
|
const onChannelTruncated = jest.fn();
|
|
910
910
|
render(
|
|
911
911
|
<Chat client={chatClient}>
|
|
912
|
-
<WithComponents overrides={{
|
|
912
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewComponent }}>
|
|
913
913
|
<ChannelList {...props} onChannelTruncated={onChannelTruncated} />
|
|
914
914
|
</WithComponents>
|
|
915
915
|
</Chat>,
|
|
@@ -26,7 +26,7 @@ export const ChannelPreview = (props: ChannelPreviewProps) => {
|
|
|
26
26
|
|
|
27
27
|
const { client: contextClient } = useChatContext();
|
|
28
28
|
const { getChannelActionItems, swipeActionsEnabled } = useChannelsContext();
|
|
29
|
-
const {
|
|
29
|
+
const { ChannelPreview } = useComponentsContext();
|
|
30
30
|
|
|
31
31
|
const client = propClient || contextClient;
|
|
32
32
|
|
|
@@ -37,12 +37,12 @@ export const ChannelPreview = (props: ChannelPreviewProps) => {
|
|
|
37
37
|
const message = translatedLastMessage ? translatedLastMessage : lastMessage;
|
|
38
38
|
|
|
39
39
|
if (!swipeActionsEnabled) {
|
|
40
|
-
return <
|
|
40
|
+
return <ChannelPreview channel={channel} muted={muted} unread={unread} lastMessage={message} />;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
return (
|
|
44
44
|
<ChannelSwipableWrapper channel={channel} getChannelActionItems={getChannelActionItems}>
|
|
45
|
-
<
|
|
45
|
+
<ChannelPreview channel={channel} muted={muted} unread={unread} lastMessage={message} />
|
|
46
46
|
</ChannelSwipableWrapper>
|
|
47
47
|
);
|
|
48
48
|
};
|
|
@@ -26,8 +26,11 @@ export type ChannelPreviewMessageProps = Pick<ChannelPreviewProps, 'channel'> &
|
|
|
26
26
|
|
|
27
27
|
export const ChannelPreviewMessage = (props: ChannelPreviewMessageProps) => {
|
|
28
28
|
const { channel, lastMessage } = props;
|
|
29
|
-
const {
|
|
30
|
-
|
|
29
|
+
const {
|
|
30
|
+
ChannelPreviewTypingIndicator,
|
|
31
|
+
ChannelPreviewMessageDeliveryStatus,
|
|
32
|
+
ChannelPreviewLastMessage,
|
|
33
|
+
} = useComponentsContext();
|
|
31
34
|
const {
|
|
32
35
|
theme: { semantics },
|
|
33
36
|
} = useTheme();
|
|
@@ -53,14 +56,14 @@ export const ChannelPreviewMessage = (props: ChannelPreviewMessageProps) => {
|
|
|
53
56
|
const showMessageDeliveryStatus = !isMessageDeleted;
|
|
54
57
|
|
|
55
58
|
if (usersTyping.length > 0) {
|
|
56
|
-
return <
|
|
59
|
+
return <ChannelPreviewTypingIndicator channel={channel} usersTyping={usersTyping} />;
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
if (draftMessage) {
|
|
60
63
|
return (
|
|
61
64
|
<View style={styles.container}>
|
|
62
65
|
<Text style={styles.draftText}>{t('Draft')}:</Text>
|
|
63
|
-
<
|
|
66
|
+
<ChannelPreviewLastMessage message={draftMessage} />
|
|
64
67
|
</View>
|
|
65
68
|
);
|
|
66
69
|
}
|
|
@@ -98,18 +101,18 @@ export const ChannelPreviewMessage = (props: ChannelPreviewMessageProps) => {
|
|
|
98
101
|
return (
|
|
99
102
|
<View style={styles.container}>
|
|
100
103
|
{showMessageDeliveryStatus ? (
|
|
101
|
-
<
|
|
104
|
+
<ChannelPreviewMessageDeliveryStatus channel={channel} message={lastMessage} />
|
|
102
105
|
) : null}
|
|
103
|
-
<
|
|
106
|
+
<ChannelPreviewLastMessage message={lastMessage} />
|
|
104
107
|
</View>
|
|
105
108
|
);
|
|
106
109
|
} else {
|
|
107
110
|
return (
|
|
108
111
|
<View style={styles.container}>
|
|
109
112
|
{showMessageDeliveryStatus ? (
|
|
110
|
-
<
|
|
113
|
+
<ChannelPreviewMessageDeliveryStatus channel={channel} message={lastMessage} />
|
|
111
114
|
) : null}
|
|
112
|
-
<
|
|
115
|
+
<ChannelPreviewLastMessage message={lastMessage} />
|
|
113
116
|
</View>
|
|
114
117
|
);
|
|
115
118
|
}
|
|
@@ -46,12 +46,12 @@ const ChannelPreviewViewWithContext = (props: ChannelPreviewViewPropsWithContext
|
|
|
46
46
|
lastMessage,
|
|
47
47
|
} = props;
|
|
48
48
|
const {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
ChannelPreviewAvatar,
|
|
50
|
+
ChannelPreviewMessage,
|
|
51
|
+
ChannelPreviewMutedStatus,
|
|
52
|
+
ChannelPreviewStatus,
|
|
53
|
+
ChannelPreviewTitle,
|
|
54
|
+
ChannelPreviewUnreadCount,
|
|
55
55
|
} = useComponentsContext();
|
|
56
56
|
|
|
57
57
|
const {
|
|
@@ -97,24 +97,26 @@ const ChannelPreviewViewWithContext = (props: ChannelPreviewViewPropsWithContext
|
|
|
97
97
|
]}
|
|
98
98
|
testID='channel-preview-button'
|
|
99
99
|
>
|
|
100
|
-
<
|
|
100
|
+
<ChannelPreviewAvatar channel={channel} size='xl' />
|
|
101
101
|
<View
|
|
102
102
|
style={[styles.contentContainer, contentContainer]}
|
|
103
103
|
testID={`channel-preview-content-${channel.id}`}
|
|
104
104
|
>
|
|
105
105
|
<View style={[styles.upperRow, upperRow]}>
|
|
106
106
|
<View style={[styles.titleContainer, titleContainer]}>
|
|
107
|
-
<
|
|
108
|
-
{muted && mutedStatusPosition === 'inlineTitle' ?
|
|
107
|
+
<ChannelPreviewTitle channel={channel} />
|
|
108
|
+
{muted && mutedStatusPosition === 'inlineTitle' ? (
|
|
109
|
+
<ChannelPreviewMutedStatus />
|
|
110
|
+
) : null}
|
|
109
111
|
</View>
|
|
110
112
|
|
|
111
113
|
<View style={[styles.statusContainer, statusContainer]}>
|
|
112
|
-
<
|
|
114
|
+
<ChannelPreviewStatus
|
|
113
115
|
channel={channel}
|
|
114
116
|
formatLatestMessageDate={formatLatestMessageDate}
|
|
115
117
|
lastMessage={lastMessage}
|
|
116
118
|
/>
|
|
117
|
-
<
|
|
119
|
+
<ChannelPreviewUnreadCount
|
|
118
120
|
channel={channel}
|
|
119
121
|
maxUnreadCount={maxUnreadCount}
|
|
120
122
|
unread={unread}
|
|
@@ -123,8 +125,10 @@ const ChannelPreviewViewWithContext = (props: ChannelPreviewViewPropsWithContext
|
|
|
123
125
|
</View>
|
|
124
126
|
|
|
125
127
|
<View style={[styles.lowerRow, lowerRow]}>
|
|
126
|
-
<
|
|
127
|
-
{muted && mutedStatusPosition === 'trailingBottom' ?
|
|
128
|
+
<ChannelPreviewMessage channel={channel} lastMessage={lastMessage} />
|
|
129
|
+
{muted && mutedStatusPosition === 'trailingBottom' ? (
|
|
130
|
+
<ChannelPreviewMutedStatus />
|
|
131
|
+
) : null}
|
|
128
132
|
</View>
|
|
129
133
|
</View>
|
|
130
134
|
</Pressable>
|
|
@@ -84,7 +84,7 @@ describe('ChannelPreview', () => {
|
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
86
|
<Chat client={chatClient}>
|
|
87
|
-
<WithComponents overrides={{
|
|
87
|
+
<WithComponents overrides={{ ChannelPreview: ChannelPreviewUIComponent }}>
|
|
88
88
|
<ChannelPreview {...props} channel={channel} client={chatClient} />
|
|
89
89
|
</WithComponents>
|
|
90
90
|
</Chat>
|
|
@@ -437,7 +437,7 @@ describe('ChannelPreview', () => {
|
|
|
437
437
|
<WithComponents
|
|
438
438
|
overrides={{
|
|
439
439
|
ChannelDetailsBottomSheet: channelDetailsBottomSheet,
|
|
440
|
-
|
|
440
|
+
ChannelPreview: SwipePreview,
|
|
441
441
|
}}
|
|
442
442
|
>
|
|
443
443
|
<ChannelsProvider
|
|
@@ -99,10 +99,12 @@ const useStyles = ({
|
|
|
99
99
|
...bubbleReactionListTopContainer,
|
|
100
100
|
},
|
|
101
101
|
bubbleWrapper: {
|
|
102
|
+
zIndex: 1,
|
|
102
103
|
...bubbleWrapper,
|
|
103
104
|
},
|
|
104
105
|
repliesContainer: {
|
|
105
106
|
marginTop: -primitives.spacingXxs, // Reducing the margin to account the gap added in the content container
|
|
107
|
+
zIndex: 0,
|
|
106
108
|
...repliesContainer,
|
|
107
109
|
},
|
|
108
110
|
leftAlignItems: {
|