stream-chat-react-native-core 5.28.0-beta.1 → 5.28.0-beta.3

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.
Files changed (108) hide show
  1. package/lib/commonjs/components/Chat/hooks/handleEventToSyncDB.js.map +1 -1
  2. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +4 -1
  3. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
  4. package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +8 -2
  5. package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js.map +1 -1
  6. package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js +1 -4
  7. package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js.map +1 -1
  8. package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +22 -12
  9. package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
  10. package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
  11. package/lib/commonjs/contexts/themeContext/utils/theme.js +4 -4
  12. package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
  13. package/lib/commonjs/i18n/es.json +23 -23
  14. package/lib/commonjs/i18n/fr.json +23 -23
  15. package/lib/commonjs/i18n/he.json +23 -23
  16. package/lib/commonjs/i18n/hi.json +23 -23
  17. package/lib/commonjs/i18n/it.json +23 -23
  18. package/lib/commonjs/i18n/ja.json +23 -23
  19. package/lib/commonjs/i18n/ko.json +23 -23
  20. package/lib/commonjs/i18n/nl.json +23 -23
  21. package/lib/commonjs/i18n/pt-BR.json +20 -20
  22. package/lib/commonjs/i18n/ru.json +23 -23
  23. package/lib/commonjs/i18n/tr.json +20 -20
  24. package/lib/commonjs/store/apis/getChannelsForFilterSort.js.map +1 -1
  25. package/lib/commonjs/store/apis/queries/selectMembersForChannels.js +1 -1
  26. package/lib/commonjs/store/apis/queries/selectMembersForChannels.js.map +1 -1
  27. package/lib/commonjs/version.json +1 -1
  28. package/lib/module/components/Chat/hooks/handleEventToSyncDB.js.map +1 -1
  29. package/lib/module/components/Message/MessageSimple/MessageContent.js +4 -1
  30. package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
  31. package/lib/module/components/Message/MessageSimple/MessageFooter.js +8 -2
  32. package/lib/module/components/Message/MessageSimple/MessageFooter.js.map +1 -1
  33. package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js +1 -4
  34. package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js.map +1 -1
  35. package/lib/module/components/Message/MessageSimple/MessageSimple.js +22 -12
  36. package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
  37. package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
  38. package/lib/module/contexts/themeContext/utils/theme.js +4 -4
  39. package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
  40. package/lib/module/i18n/es.json +23 -23
  41. package/lib/module/i18n/fr.json +23 -23
  42. package/lib/module/i18n/he.json +23 -23
  43. package/lib/module/i18n/hi.json +23 -23
  44. package/lib/module/i18n/it.json +23 -23
  45. package/lib/module/i18n/ja.json +23 -23
  46. package/lib/module/i18n/ko.json +23 -23
  47. package/lib/module/i18n/nl.json +23 -23
  48. package/lib/module/i18n/pt-BR.json +20 -20
  49. package/lib/module/i18n/ru.json +23 -23
  50. package/lib/module/i18n/tr.json +20 -20
  51. package/lib/module/store/apis/getChannelsForFilterSort.js.map +1 -1
  52. package/lib/module/store/apis/queries/selectMembersForChannels.js +1 -1
  53. package/lib/module/store/apis/queries/selectMembersForChannels.js.map +1 -1
  54. package/lib/module/version.json +1 -1
  55. package/lib/typescript/components/Chat/hooks/handleEventToSyncDB.d.ts +1 -1
  56. package/lib/typescript/components/Chat/hooks/handleEventToSyncDB.d.ts.map +1 -1
  57. package/lib/typescript/components/Message/MessageSimple/MessageContent.d.ts +1 -1
  58. package/lib/typescript/components/Message/MessageSimple/MessageContent.d.ts.map +1 -1
  59. package/lib/typescript/components/Message/MessageSimple/MessagePinnedHeader.d.ts.map +1 -1
  60. package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts +1 -1
  61. package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts.map +1 -1
  62. package/lib/typescript/contexts/messageContext/MessageContext.d.ts +1 -1
  63. package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +3 -3
  64. package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts.map +1 -1
  65. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +3 -0
  66. package/lib/typescript/contexts/themeContext/utils/theme.d.ts.map +1 -1
  67. package/lib/typescript/i18n/es.json +23 -23
  68. package/lib/typescript/i18n/fr.json +23 -23
  69. package/lib/typescript/i18n/he.json +23 -23
  70. package/lib/typescript/i18n/hi.json +23 -23
  71. package/lib/typescript/i18n/it.json +23 -23
  72. package/lib/typescript/i18n/ja.json +23 -23
  73. package/lib/typescript/i18n/ko.json +23 -23
  74. package/lib/typescript/i18n/nl.json +23 -23
  75. package/lib/typescript/i18n/pt-BR.json +20 -20
  76. package/lib/typescript/i18n/ru.json +23 -23
  77. package/lib/typescript/i18n/tr.json +20 -20
  78. package/lib/typescript/store/apis/getChannelsForFilterSort.d.ts +1 -1
  79. package/lib/typescript/store/apis/getChannelsForFilterSort.d.ts.map +1 -1
  80. package/lib/typescript/store/apis/queries/selectMembersForChannels.d.ts +1 -1
  81. package/lib/typescript/store/apis/queries/selectMembersForChannels.d.ts.map +1 -1
  82. package/lib/typescript/store/apis/upsertChannelDataFromChannel.d.ts +1 -1
  83. package/lib/typescript/store/apis/upsertChannelDataFromChannel.d.ts.map +1 -1
  84. package/package.json +1 -1
  85. package/src/components/Chat/hooks/handleEventToSyncDB.ts +1 -1
  86. package/src/components/Message/MessageSimple/MessageContent.tsx +5 -0
  87. package/src/components/Message/MessageSimple/MessageFooter.tsx +10 -3
  88. package/src/components/Message/MessageSimple/MessagePinnedHeader.tsx +0 -3
  89. package/src/components/Message/MessageSimple/MessageSimple.tsx +28 -14
  90. package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessagePinnedHeader.test.js.snap +0 -3
  91. package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +52 -20
  92. package/src/contexts/messagesContext/MessagesContext.tsx +3 -6
  93. package/src/contexts/themeContext/utils/theme.ts +7 -4
  94. package/src/i18n/es.json +23 -23
  95. package/src/i18n/fr.json +23 -23
  96. package/src/i18n/he.json +23 -23
  97. package/src/i18n/hi.json +23 -23
  98. package/src/i18n/it.json +23 -23
  99. package/src/i18n/ja.json +23 -23
  100. package/src/i18n/ko.json +23 -23
  101. package/src/i18n/nl.json +23 -23
  102. package/src/i18n/pt-BR.json +20 -20
  103. package/src/i18n/ru.json +23 -23
  104. package/src/i18n/tr.json +20 -20
  105. package/src/store/apis/getChannelsForFilterSort.ts +2 -1
  106. package/src/store/apis/queries/selectMembersForChannels.ts +2 -2
  107. package/src/store/apis/upsertChannelDataFromChannel.ts +1 -1
  108. package/src/version.json +1 -1
@@ -1,15 +1,15 @@
1
1
  {
2
- "1 Reply": "1 Cevap",
2
+ "1 Reply": "",
3
3
  "1 Thread Reply": "",
4
4
  "Allow access to your Gallery": "",
5
5
  "Allow camera access in device settings": "",
6
- "Also send to channel": "Kanala da gönder",
6
+ "Also send to channel": "",
7
7
  "Are you sure you want to permanently delete this message?": "",
8
- "Are you sure?": "Emin misiniz?",
8
+ "Are you sure?": "",
9
9
  "Block User": "",
10
10
  "Cancel": "",
11
11
  "Cannot Flag Message": "",
12
- "Consider how your comment might make others feel and be sure to follow our Community Guidelines": "Yorumunuzun diğerlerini nasıl hissettirebileceğini düşünün ve topluluk kurallarımızı takip ettiğinizden emin olun",
12
+ "Consider how your comment might make others feel and be sure to follow our Community Guidelines": "",
13
13
  "Copy Message": "",
14
14
  "Delete": "",
15
15
  "Delete Message": "",
@@ -18,33 +18,33 @@
18
18
  "Edit Message": "",
19
19
  "Editing Message": "",
20
20
  "Emoji matching": "",
21
- "Empty message...": "Boş mesaj...",
21
+ "Empty message...": "",
22
22
  "Error loading": "",
23
23
  "Error loading channel list...": "",
24
24
  "Error loading messages for this channel...": "",
25
- "Error while loading, please reload/refresh": "Yüklenirken hata oluştu, lütfen tekrar deneyiniz",
26
- "File type not supported": "",
25
+ "Error while loading, please reload/refresh": "",
26
+ "File type not supported": "Dosya türü desteklenmiyor",
27
27
  "Flag": "",
28
28
  "Flag Message": "",
29
29
  "Flag action failed either due to a network issue or the message is already flagged": "",
30
30
  "How about sending your first message to a friend?": "",
31
31
  "Instant Commands": "",
32
32
  "Let's start chatting!": "",
33
- "Links are disabled": "Bağlantılar devre dışı",
33
+ "Links are disabled": "",
34
34
  "Loading channels...": "",
35
35
  "Loading messages...": "",
36
36
  "Loading...": "",
37
- "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Maksimum dosya boyutu yükleme sınırına ulaşıldı. Lütfen {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB'ın altında bir dosya yükleyin.",
38
- "Message Reactions": "Mesaj Tepkileri",
37
+ "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
38
+ "Message Reactions": "",
39
39
  "Message deleted": "Mesaj silindi",
40
40
  "Message flagged": "",
41
41
  "Mute User": "",
42
42
  "Not supported": "Desteklenmiyor",
43
- "Nothing yet...": "Henüz değil...",
43
+ "Nothing yet...": "",
44
44
  "Ok": "",
45
45
  "Only visible to you": "",
46
46
  "Open Settings": "",
47
- "Photo": "",
47
+ "Photo": "Fotoğraf",
48
48
  "Photos and Videos": "",
49
49
  "Pin to Conversation": "",
50
50
  "Pinned by": "",
@@ -56,9 +56,9 @@
56
56
  "Resend": "",
57
57
  "Search GIFs": "",
58
58
  "Select More Photos": "",
59
- "Send Anyway": "Yine de Gönder",
59
+ "Send Anyway": "",
60
60
  "Send a message": "",
61
- "Sending links is not allowed in this conversation": "Bu konuşmada bağlantı göndermek desteklenmiyor",
61
+ "Sending links is not allowed in this conversation": "",
62
62
  "Slow mode ON": "",
63
63
  "The message has been reported to a moderator.": "",
64
64
  "Thread Reply": "",
@@ -67,13 +67,13 @@
67
67
  "Unmute User": "",
68
68
  "Unpin from Conversation": "",
69
69
  "Unread Messages": "",
70
- "Video": "",
70
+ "Video": "Video",
71
71
  "You": "Sen",
72
- "You can't send messages in this channel": "Bu konuşmaya mesaj gönderemezsiniz",
73
- "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} ve {{ nonSelfUserLength }} kişi daha yazıyor",
72
+ "You can't send messages in this channel": "",
73
+ "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
74
74
  "{{ index }} of {{ photoLength }}": "",
75
- "{{ replyCount }} Replies": "{{ replyCount }} Cevap",
75
+ "{{ replyCount }} Replies": "",
76
76
  "{{ replyCount }} Thread Replies": "",
77
- "{{ user }} is typing": "{{ user }} yazıyor",
78
- "🏙 Attachment...": "🏙 Ek..."
77
+ "{{ user }} is typing": "",
78
+ "🏙 Attachment...": ""
79
79
  }
@@ -1,5 +1,5 @@
1
- import type { DefaultStreamChatGenerics } from 'src/types/types';
2
1
  import type { ChannelAPIResponse, ChannelFilters, ChannelSort } from 'stream-chat';
2
+ import type { DefaultStreamChatGenerics } from '../../types/types';
3
3
  /**
4
4
  * Gets the channels from database for given filter and sort query.
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"getChannelsForFilterSort.d.ts","sourceRoot":"","sources":["../../../../src/store/apis/getChannelsForFilterSort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAOnF;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB;mBAOpB,MAAM;;;uEAuBtB,CAAC"}
1
+ {"version":3,"file":"getChannelsForFilterSort.d.ts","sourceRoot":"","sources":["../../../../src/store/apis/getChannelsForFilterSort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAKnF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAInE;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB;mBAOpB,MAAM;;;uEAuBtB,CAAC"}
@@ -1,3 +1,3 @@
1
- import type { TableRowJoinedUser } from 'src/store/types';
1
+ import type { TableRowJoinedUser } from '../../../store/types';
2
2
  export declare const selectMembersForChannels: (cids: string[]) => TableRowJoinedUser<'members'>[];
3
3
  //# sourceMappingURL=selectMembersForChannels.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectMembersForChannels.d.ts","sourceRoot":"","sources":["../../../../../src/store/apis/queries/selectMembersForChannels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAK1D,eAAO,MAAM,wBAAwB,SAAU,MAAM,EAAE,KAAG,mBAAmB,SAAS,CAAC,EA8BtF,CAAC"}
1
+ {"version":3,"file":"selectMembersForChannels.d.ts","sourceRoot":"","sources":["../../../../../src/store/apis/queries/selectMembersForChannels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAK/D,eAAO,MAAM,wBAAwB,SAAU,MAAM,EAAE,KAAG,mBAAmB,SAAS,CAAC,EA8BtF,CAAC"}
@@ -1,5 +1,5 @@
1
- import { DefaultStreamChatGenerics } from 'src/types/types';
2
1
  import type { Channel } from 'stream-chat';
2
+ import { DefaultStreamChatGenerics } from '../../types/types';
3
3
  export declare const upsertChannelDataFromChannel: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ channel, flush, }: {
4
4
  channel: Channel<StreamChatGenerics>;
5
5
  flush?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"upsertChannelDataFromChannel.d.ts","sourceRoot":"","sources":["../../../../src/store/apis/upsertChannelDataFromChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAM3C,eAAO,MAAM,4BAA4B;;;sDAiBxC,CAAC"}
1
+ {"version":3,"file":"upsertChannelDataFromChannel.d.ts","sourceRoot":"","sources":["../../../../src/store/apis/upsertChannelDataFromChannel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAK9D,eAAO,MAAM,4BAA4B;;;sDAiBxC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stream-chat-react-native-core",
3
3
  "description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
4
- "version": "5.28.0-beta.1",
4
+ "version": "5.28.0-beta.3",
5
5
  "author": {
6
6
  "company": "Stream.io Inc",
7
7
  "name": "Stream.io Inc"
@@ -1,4 +1,3 @@
1
- import { DefaultStreamChatGenerics } from 'src/types/types';
2
1
  import type { Event, StreamChat } from 'stream-chat';
3
2
 
4
3
  import { deleteChannel } from '../../../store/apis/deleteChannel';
@@ -14,6 +13,7 @@ import { upsertReads } from '../../../store/apis/upsertReads';
14
13
  import { QuickSqliteClient } from '../../../store/QuickSqliteClient';
15
14
  import { createSelectQuery } from '../../../store/sqlite-utils/createSelectQuery';
16
15
  import { PreparedQueries } from '../../../store/types';
16
+ import { DefaultStreamChatGenerics } from '../../../types/types';
17
17
 
18
18
  export const handleEventToSyncDB = <
19
19
  StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
@@ -95,6 +95,7 @@ export type MessageContentPropsWithContext<
95
95
  | 'MessageHeader'
96
96
  | 'MessageDeleted'
97
97
  | 'MessageError'
98
+ | 'MessagePinnedHeader'
98
99
  | 'MessageReplies'
99
100
  | 'MessageStatus'
100
101
  | 'myMessageTheme'
@@ -132,6 +133,7 @@ const MessageContentWithContext = <
132
133
  MessageError,
133
134
  MessageFooter,
134
135
  MessageHeader,
136
+ MessagePinnedHeader,
135
137
  MessageReplies,
136
138
  MessageStatus,
137
139
  onLongPress,
@@ -340,6 +342,7 @@ const MessageContentWithContext = <
340
342
  showMessageStatus={showMessageStatus}
341
343
  />
342
344
  )}
345
+ {message.pinned && <MessagePinnedHeader />}
343
346
  <View onLayout={onLayout} style={wrapper}>
344
347
  {hasThreadReplies && !threadList && !noBorder && (
345
348
  <View
@@ -598,6 +601,7 @@ export const MessageContent = <
598
601
  MessageError,
599
602
  MessageFooter,
600
603
  MessageHeader,
604
+ MessagePinnedHeader,
601
605
  MessageReplies,
602
606
  MessageStatus,
603
607
  myMessageTheme,
@@ -629,6 +633,7 @@ export const MessageContent = <
629
633
  MessageError,
630
634
  MessageFooter,
631
635
  MessageHeader,
636
+ MessagePinnedHeader,
632
637
  MessageReplies,
633
638
  MessageStatus,
634
639
  myMessageTheme,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Text, View } from 'react-native';
2
+ import { StyleSheet, Text, View } from 'react-native';
3
3
 
4
4
  import type { Attachment } from 'stream-chat';
5
5
 
@@ -76,7 +76,7 @@ const MessageFooterWithContext = <
76
76
 
77
77
  if (isDeleted) {
78
78
  return (
79
- <View style={metaContainer} testID='message-deleted'>
79
+ <View style={[styles.container, metaContainer]} testID='message-deleted'>
80
80
  {deletedMessagesVisibilityType === 'sender' && (
81
81
  <>
82
82
  <Eye pathFill={grey_dark} {...eyeIcon} />
@@ -115,7 +115,7 @@ const MessageFooterWithContext = <
115
115
  }
116
116
 
117
117
  return (
118
- <View style={metaContainer} testID='message-status-time'>
118
+ <View style={[styles.container, metaContainer]} testID='message-status-time'>
119
119
  {otherAttachments.length && otherAttachments[0].actions ? (
120
120
  <>
121
121
  <Eye pathFill={grey_dark} {...eyeIcon} />
@@ -249,3 +249,10 @@ export const MessageFooter = <
249
249
  />
250
250
  );
251
251
  };
252
+
253
+ const styles = StyleSheet.create({
254
+ container: {
255
+ flexDirection: 'row',
256
+ marginTop: 4,
257
+ },
258
+ });
@@ -14,9 +14,6 @@ const styles = StyleSheet.create({
14
14
  container: {
15
15
  display: 'flex',
16
16
  flexDirection: 'row',
17
- marginBottom: 8,
18
- marginLeft: 30,
19
- marginTop: 5,
20
17
  },
21
18
  label: {},
22
19
  });
@@ -18,6 +18,13 @@ const styles = StyleSheet.create({
18
18
  alignItems: 'flex-end',
19
19
  flexDirection: 'row',
20
20
  },
21
+ lastMessageContainer: {
22
+ marginBottom: 12,
23
+ },
24
+ messageGroupedSingleOrBottomContainer: {
25
+ marginBottom: 8,
26
+ },
27
+ messageGroupedTopContainer: {},
21
28
  });
22
29
 
23
30
  export type MessageSimplePropsWithContext<
@@ -32,7 +39,6 @@ export type MessageSimplePropsWithContext<
32
39
  | 'myMessageTheme'
33
40
  | 'MessageAvatar'
34
41
  | 'MessageContent'
35
- | 'MessagePinnedHeader'
36
42
  | 'ReactionList'
37
43
  >;
38
44
 
@@ -50,13 +56,17 @@ const MessageSimpleWithContext = <
50
56
  message,
51
57
  MessageAvatar,
52
58
  MessageContent,
53
- MessagePinnedHeader,
54
59
  ReactionList,
55
60
  } = props;
56
61
 
57
62
  const {
58
63
  theme: {
59
- messageSimple: { container },
64
+ messageSimple: {
65
+ container,
66
+ lastMessageContainer,
67
+ messageGroupedSingleOrBottomContainer,
68
+ messageGroupedTopContainer,
69
+ },
60
70
  },
61
71
  } = useTheme();
62
72
 
@@ -65,23 +75,30 @@ const MessageSimpleWithContext = <
65
75
  const isVeryLastMessage =
66
76
  channel?.state.messages[channel?.state.messages.length - 1]?.id === message.id;
67
77
 
68
- const hasMarginBottom = groupStyles.includes('single') || groupStyles.includes('bottom');
78
+ const messageGroupedSingleOrBottom =
79
+ groupStyles.includes('single') || groupStyles.includes('bottom');
69
80
 
70
81
  const showReactions = hasReactions && ReactionList;
71
82
 
83
+ const lastMessageInMessageListStyles = [styles.lastMessageContainer, lastMessageContainer];
84
+ const messageGroupedSingleOrBottomStyles = [
85
+ styles.messageGroupedSingleOrBottomContainer,
86
+ messageGroupedSingleOrBottomContainer,
87
+ ];
88
+ const messageGroupedTopStyles = [styles.messageGroupedTopContainer, messageGroupedTopContainer];
89
+
72
90
  return (
73
91
  <>
74
- {message.pinned && <MessagePinnedHeader />}
75
92
  <View
76
93
  style={[
77
94
  styles.container,
95
+ messageGroupedSingleOrBottom
96
+ ? isVeryLastMessage && enableMessageGroupingByUser
97
+ ? lastMessageInMessageListStyles
98
+ : messageGroupedSingleOrBottomStyles
99
+ : messageGroupedTopStyles,
78
100
  {
79
101
  justifyContent: alignment === 'left' ? 'flex-start' : 'flex-end',
80
- marginBottom: hasMarginBottom
81
- ? isVeryLastMessage && enableMessageGroupingByUser
82
- ? 30
83
- : 8
84
- : 0,
85
102
  marginTop: showReactions ? 2 : 0,
86
103
  },
87
104
  container,
@@ -136,8 +153,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
136
153
  isPrevMessageTypeDeleted === isNextMessageTypeDeleted &&
137
154
  prevMessage.status === nextMessage.status &&
138
155
  prevMessage.type === nextMessage.type &&
139
- prevMessage.text === nextMessage.text &&
140
- prevMessage.pinned === nextMessage.pinned;
156
+ prevMessage.text === nextMessage.text;
141
157
  if (!messageEqual) return false;
142
158
 
143
159
  const isPrevQuotedMessageTypeDeleted = prevMessage.quoted_message?.type === 'deleted';
@@ -208,7 +224,6 @@ export const MessageSimple = <
208
224
  enableMessageGroupingByUser,
209
225
  MessageAvatar,
210
226
  MessageContent,
211
- MessagePinnedHeader,
212
227
  myMessageTheme,
213
228
  ReactionList,
214
229
  } = useMessagesContext<StreamChatGenerics>();
@@ -225,7 +240,6 @@ export const MessageSimple = <
225
240
  message,
226
241
  MessageAvatar,
227
242
  MessageContent,
228
- MessagePinnedHeader,
229
243
  myMessageTheme,
230
244
  ReactionList,
231
245
  }}
@@ -7,9 +7,6 @@ exports[`MessagePinnedHeader should render message pinned 1`] = `
7
7
  {
8
8
  "display": "flex",
9
9
  "flexDirection": "row",
10
- "marginBottom": 8,
11
- "marginLeft": 30,
12
- "marginTop": 5,
13
10
  },
14
11
  {
15
12
  "justifyContent": "flex-start",
@@ -277,9 +277,14 @@ exports[`Thread should match thread snapshot 1`] = `
277
277
  "alignItems": "flex-end",
278
278
  "flexDirection": "row",
279
279
  },
280
+ [
281
+ {
282
+ "marginBottom": 8,
283
+ },
284
+ {},
285
+ ],
280
286
  {
281
287
  "justifyContent": "flex-start",
282
- "marginBottom": 8,
283
288
  "marginTop": 0,
284
289
  },
285
290
  {},
@@ -459,10 +464,13 @@ exports[`Thread should match thread snapshot 1`] = `
459
464
  </View>
460
465
  <View
461
466
  style={
462
- {
463
- "flexDirection": "row",
464
- "marginTop": 4,
465
- }
467
+ [
468
+ {
469
+ "flexDirection": "row",
470
+ "marginTop": 4,
471
+ },
472
+ {},
473
+ ]
466
474
  }
467
475
  testID="message-status-time"
468
476
  >
@@ -547,9 +555,14 @@ exports[`Thread should match thread snapshot 1`] = `
547
555
  "alignItems": "flex-end",
548
556
  "flexDirection": "row",
549
557
  },
558
+ [
559
+ {
560
+ "marginBottom": 8,
561
+ },
562
+ {},
563
+ ],
550
564
  {
551
565
  "justifyContent": "flex-start",
552
- "marginBottom": 8,
553
566
  "marginTop": 0,
554
567
  },
555
568
  {},
@@ -729,10 +742,13 @@ exports[`Thread should match thread snapshot 1`] = `
729
742
  </View>
730
743
  <View
731
744
  style={
732
- {
733
- "flexDirection": "row",
734
- "marginTop": 4,
735
- }
745
+ [
746
+ {
747
+ "flexDirection": "row",
748
+ "marginTop": 4,
749
+ },
750
+ {},
751
+ ]
736
752
  }
737
753
  testID="message-status-time"
738
754
  >
@@ -817,9 +833,14 @@ exports[`Thread should match thread snapshot 1`] = `
817
833
  "alignItems": "flex-end",
818
834
  "flexDirection": "row",
819
835
  },
836
+ [
837
+ {
838
+ "marginBottom": 8,
839
+ },
840
+ {},
841
+ ],
820
842
  {
821
843
  "justifyContent": "flex-start",
822
- "marginBottom": 8,
823
844
  "marginTop": 0,
824
845
  },
825
846
  {},
@@ -999,10 +1020,13 @@ exports[`Thread should match thread snapshot 1`] = `
999
1020
  </View>
1000
1021
  <View
1001
1022
  style={
1002
- {
1003
- "flexDirection": "row",
1004
- "marginTop": 4,
1005
- }
1023
+ [
1024
+ {
1025
+ "flexDirection": "row",
1026
+ "marginTop": 4,
1027
+ },
1028
+ {},
1029
+ ]
1006
1030
  }
1007
1031
  testID="message-status-time"
1008
1032
  >
@@ -1127,9 +1151,14 @@ exports[`Thread should match thread snapshot 1`] = `
1127
1151
  "alignItems": "flex-end",
1128
1152
  "flexDirection": "row",
1129
1153
  },
1154
+ [
1155
+ {
1156
+ "marginBottom": 12,
1157
+ },
1158
+ {},
1159
+ ],
1130
1160
  {
1131
1161
  "justifyContent": "flex-start",
1132
- "marginBottom": 30,
1133
1162
  "marginTop": 0,
1134
1163
  },
1135
1164
  {},
@@ -1309,10 +1338,13 @@ exports[`Thread should match thread snapshot 1`] = `
1309
1338
  </View>
1310
1339
  <View
1311
1340
  style={
1312
- {
1313
- "flexDirection": "row",
1314
- "marginTop": 4,
1315
- }
1341
+ [
1342
+ {
1343
+ "flexDirection": "row",
1344
+ "marginTop": 4,
1345
+ },
1346
+ {},
1347
+ ]
1316
1348
  }
1317
1349
  testID="message-status-time"
1318
1350
  >
@@ -2,11 +2,6 @@ import React, { PropsWithChildren, useContext } from 'react';
2
2
 
3
3
  import type { TouchableOpacityProps } from 'react-native';
4
4
 
5
- import type { ImageLoadingFailedIndicatorProps } from 'src/components/Attachment/ImageLoadingFailedIndicator';
6
- import type { ImageLoadingIndicatorProps } from 'src/components/Attachment/ImageLoadingIndicator';
7
-
8
- import type { MessagePinnedHeaderProps } from 'src/components/Message/MessageSimple/MessagePinnedHeader';
9
-
10
5
  import type { Attachment, ChannelState, MessageResponse } from 'stream-chat';
11
6
 
12
7
  import type { AttachmentProps } from '../../components/Attachment/Attachment';
@@ -18,6 +13,8 @@ import type { FileAttachmentGroupProps } from '../../components/Attachment/FileA
18
13
  import type { FileIconProps } from '../../components/Attachment/FileIcon';
19
14
  import type { GalleryProps } from '../../components/Attachment/Gallery';
20
15
  import type { GiphyProps } from '../../components/Attachment/Giphy';
16
+ import type { ImageLoadingFailedIndicatorProps } from '../../components/Attachment/ImageLoadingFailedIndicator';
17
+ import type { ImageLoadingIndicatorProps } from '../../components/Attachment/ImageLoadingIndicator';
21
18
  import type { VideoThumbnailProps } from '../../components/Attachment/VideoThumbnail';
22
19
  import type {
23
20
  MessageProps,
@@ -29,7 +26,7 @@ import type { MessageContentProps } from '../../components/Message/MessageSimple
29
26
  import type { MessageDeletedProps } from '../../components/Message/MessageSimple/MessageDeleted';
30
27
  import type { MessageErrorProps } from '../../components/Message/MessageSimple/MessageError';
31
28
  import type { MessageFooterProps } from '../../components/Message/MessageSimple/MessageFooter';
32
-
29
+ import type { MessagePinnedHeaderProps } from '../../components/Message/MessageSimple/MessagePinnedHeader';
33
30
  import type { MessageRepliesProps } from '../../components/Message/MessageSimple/MessageReplies';
34
31
  import type { MessageRepliesAvatarsProps } from '../../components/Message/MessageSimple/MessageRepliesAvatars';
35
32
  import type { MessageSimpleProps } from '../../components/Message/MessageSimple/MessageSimple';
@@ -470,10 +470,13 @@ export type Theme = {
470
470
  shuffle: TextStyle;
471
471
  title: TextStyle;
472
472
  };
473
+ lastMessageContainer: ViewStyle;
473
474
  loadingIndicator: {
474
475
  container: ViewStyle;
475
476
  roundedView: ViewStyle;
476
477
  };
478
+ messageGroupedSingleOrBottomContainer: ViewStyle;
479
+ messageGroupedTopContainer: ViewStyle;
477
480
  pinnedHeader: {
478
481
  container: ViewStyle;
479
482
  label: TextStyle;
@@ -957,10 +960,7 @@ export const defaultTheme: Theme = {
957
960
  fontWeight: '700',
958
961
  paddingRight: 6,
959
962
  },
960
- metaContainer: {
961
- flexDirection: 'row',
962
- marginTop: 4,
963
- },
963
+ metaContainer: {},
964
964
  metaText: {
965
965
  fontSize: 12,
966
966
  },
@@ -1012,10 +1012,13 @@ export const defaultTheme: Theme = {
1012
1012
  shuffle: {},
1013
1013
  title: {},
1014
1014
  },
1015
+ lastMessageContainer: {},
1015
1016
  loadingIndicator: {
1016
1017
  container: {},
1017
1018
  roundedView: {},
1018
1019
  },
1020
+ messageGroupedSingleOrBottomContainer: {},
1021
+ messageGroupedTopContainer: {},
1019
1022
  pinnedHeader: {
1020
1023
  container: {},
1021
1024
  label: {},