stream-chat-react-native-core 5.22.0-beta.2 → 5.22.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 (131) hide show
  1. package/lib/commonjs/components/Attachment/FileAttachment.js +10 -7
  2. package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
  3. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +8 -6
  4. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  5. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js +20 -16
  6. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
  7. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +16 -14
  8. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
  9. package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js +4 -2
  10. package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
  11. package/lib/commonjs/components/ImageGallery/ImageGallery.js +28 -25
  12. package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
  13. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +7 -5
  14. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
  15. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js +10 -8
  16. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
  17. package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +10 -8
  18. package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
  19. package/lib/commonjs/components/Indicators/EmptyStateIndicator.js +12 -10
  20. package/lib/commonjs/components/Indicators/EmptyStateIndicator.js.map +1 -1
  21. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +20 -17
  22. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
  23. package/lib/commonjs/components/MessageList/InlineUnreadIndicator.js +13 -11
  24. package/lib/commonjs/components/MessageList/InlineUnreadIndicator.js.map +1 -1
  25. package/lib/commonjs/components/MessageOverlay/MessageActionList.js +8 -14
  26. package/lib/commonjs/components/MessageOverlay/MessageActionList.js.map +1 -1
  27. package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +11 -8
  28. package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js.map +1 -1
  29. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +32 -29
  30. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
  31. package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +17 -15
  32. package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js.map +1 -1
  33. package/lib/commonjs/contexts/themeContext/utils/theme.js +0 -4
  34. package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
  35. package/lib/commonjs/hooks/useViewport.js +47 -0
  36. package/lib/commonjs/hooks/useViewport.js.map +1 -0
  37. package/lib/commonjs/i18n/fr.json +30 -30
  38. package/lib/commonjs/i18n/hi.json +30 -30
  39. package/lib/commonjs/i18n/it.json +30 -30
  40. package/lib/commonjs/i18n/nl.json +30 -30
  41. package/lib/commonjs/i18n/ru.json +30 -30
  42. package/lib/commonjs/i18n/tr.json +30 -30
  43. package/lib/commonjs/utils/utils.js +1 -15
  44. package/lib/commonjs/utils/utils.js.map +1 -1
  45. package/lib/commonjs/version.json +1 -1
  46. package/lib/module/components/Attachment/FileAttachment.js +10 -7
  47. package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
  48. package/lib/module/components/AttachmentPicker/AttachmentPicker.js +8 -6
  49. package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  50. package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js +20 -16
  51. package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
  52. package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +16 -14
  53. package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
  54. package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js +4 -2
  55. package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
  56. package/lib/module/components/ImageGallery/ImageGallery.js +28 -25
  57. package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
  58. package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +7 -5
  59. package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
  60. package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js +10 -8
  61. package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
  62. package/lib/module/components/ImageGallery/components/ImageGrid.js +10 -8
  63. package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
  64. package/lib/module/components/Indicators/EmptyStateIndicator.js +12 -10
  65. package/lib/module/components/Indicators/EmptyStateIndicator.js.map +1 -1
  66. package/lib/module/components/Message/MessageSimple/MessageContent.js +20 -17
  67. package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
  68. package/lib/module/components/MessageList/InlineUnreadIndicator.js +13 -11
  69. package/lib/module/components/MessageList/InlineUnreadIndicator.js.map +1 -1
  70. package/lib/module/components/MessageOverlay/MessageActionList.js +8 -14
  71. package/lib/module/components/MessageOverlay/MessageActionList.js.map +1 -1
  72. package/lib/module/components/MessageOverlay/MessageActionListItem.js +11 -8
  73. package/lib/module/components/MessageOverlay/MessageActionListItem.js.map +1 -1
  74. package/lib/module/components/MessageOverlay/MessageOverlay.js +32 -29
  75. package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
  76. package/lib/module/components/Thread/components/ThreadFooterComponent.js +17 -15
  77. package/lib/module/components/Thread/components/ThreadFooterComponent.js.map +1 -1
  78. package/lib/module/contexts/themeContext/utils/theme.js +0 -4
  79. package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
  80. package/lib/module/hooks/useViewport.js +47 -0
  81. package/lib/module/hooks/useViewport.js.map +1 -0
  82. package/lib/module/i18n/fr.json +30 -30
  83. package/lib/module/i18n/hi.json +30 -30
  84. package/lib/module/i18n/it.json +30 -30
  85. package/lib/module/i18n/nl.json +30 -30
  86. package/lib/module/i18n/ru.json +30 -30
  87. package/lib/module/i18n/tr.json +30 -30
  88. package/lib/module/utils/utils.js +1 -15
  89. package/lib/module/utils/utils.js.map +1 -1
  90. package/lib/module/version.json +1 -1
  91. package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +1 -1
  92. package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +1 -1
  93. package/lib/typescript/contexts/messageContext/MessageContext.d.ts +1 -1
  94. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +1 -1
  95. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +0 -3
  96. package/lib/typescript/hooks/useViewport.d.ts +11 -0
  97. package/lib/typescript/i18n/fr.json +30 -30
  98. package/lib/typescript/i18n/hi.json +30 -30
  99. package/lib/typescript/i18n/it.json +30 -30
  100. package/lib/typescript/i18n/nl.json +30 -30
  101. package/lib/typescript/i18n/ru.json +30 -30
  102. package/lib/typescript/i18n/tr.json +30 -30
  103. package/lib/typescript/store/mappers/mapStorableToChannel.d.ts +1 -1
  104. package/lib/typescript/utils/utils.d.ts +0 -2
  105. package/package.json +1 -1
  106. package/src/components/Attachment/FileAttachment.tsx +12 -3
  107. package/src/components/AttachmentPicker/AttachmentPicker.tsx +4 -2
  108. package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx +3 -1
  109. package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx +4 -3
  110. package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayName.ts +4 -3
  111. package/src/components/ImageGallery/ImageGallery.tsx +8 -4
  112. package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx +5 -3
  113. package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx +5 -3
  114. package/src/components/ImageGallery/components/ImageGrid.tsx +2 -1
  115. package/src/components/Indicators/EmptyStateIndicator.tsx +4 -5
  116. package/src/components/Message/MessageSimple/MessageContent.tsx +3 -1
  117. package/src/components/MessageList/InlineUnreadIndicator.tsx +2 -1
  118. package/src/components/MessageOverlay/MessageActionList.tsx +3 -11
  119. package/src/components/MessageOverlay/MessageActionListItem.tsx +5 -2
  120. package/src/components/MessageOverlay/MessageOverlay.tsx +5 -3
  121. package/src/components/Thread/components/ThreadFooterComponent.tsx +2 -1
  122. package/src/contexts/themeContext/utils/theme.ts +0 -7
  123. package/src/hooks/useViewport.ts +41 -0
  124. package/src/i18n/fr.json +30 -30
  125. package/src/i18n/hi.json +30 -30
  126. package/src/i18n/it.json +30 -30
  127. package/src/i18n/nl.json +30 -30
  128. package/src/i18n/ru.json +30 -30
  129. package/src/i18n/tr.json +30 -30
  130. package/src/utils/utils.ts +0 -13
  131. package/src/version.json +1 -1
@@ -2,7 +2,7 @@
2
2
  "1 Reply": "1 Cevap",
3
3
  "1 Thread Reply": "1 Konu Yanıtı",
4
4
  "Allow access to your Gallery": "Galerinize erişime izin verin",
5
- "Also send to channel": "",
5
+ "Also send to channel": "Kanala da gönder",
6
6
  "Are you sure you want to permanently delete this message?": "Bu mesajı kalıcı olarak silmek istediğinizden emin misiniz?",
7
7
  "Block User": "Kullanıcıyı engelle",
8
8
  "Cancel": "İptal",
@@ -12,62 +12,62 @@
12
12
  "Delete Message": "Mesajı Sil",
13
13
  "Do you want to send a copy of this message to a moderator for further investigation?": "Detaylı inceleme için bu mesajın kopyasını moderatöre göndermek istiyor musunuz?",
14
14
  "Edit Message": "Mesajı Düzenle",
15
- "Editing Message": "",
15
+ "Editing Message": "Mesaj Düzenleniyor",
16
16
  "Emoji matching": "Emoji eşleştirme",
17
- "Empty message...": "",
18
- "Error loading": "",
19
- "Error loading channel list...": "",
20
- "Error loading messages for this channel...": "",
21
- "Error while loading, please reload/refresh": "",
17
+ "Empty message...": "Boş mesaj...",
18
+ "Error loading": "Yükleme hatası",
19
+ "Error loading channel list...": "Kanal listesi yüklenirken hata oluştu...",
20
+ "Error loading messages for this channel...": "Bu kanal için mesajlar yüklenirken hata oluştu...",
21
+ "Error while loading, please reload/refresh": "Yüklenirken hata oluştu, lütfen tekrar deneyiniz",
22
22
  "File type not supported": "Dosya türü desteklenmiyor",
23
23
  "Flag": "Raporla",
24
24
  "Flag Message": "Mesajı Raporla",
25
25
  "Flag action failed either due to a network issue or the message is already flagged": "Mesajın daha önce raporlanmış olması veya bir ağ bağlantısı sorunu nedeniyle raporlama işlemi başarısız oldu.",
26
- "How about sending your first message to a friend?": "",
26
+ "How about sending your first message to a friend?": "İlk mesajınızı bir arkadaşınıza göndermeye ne dersiniz?",
27
27
  "Instant Commands": "Anlık Komutlar",
28
- "Let's start chatting!": "",
29
- "Links are disabled": "",
30
- "Loading channels...": "",
31
- "Loading messages...": "",
32
- "Loading...": "",
33
- "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
34
- "Message Reactions": "",
35
- "Message deleted": "",
28
+ "Let's start chatting!": "Haydi sohbete başlayalım!",
29
+ "Links are disabled": "Bağlantılar devre dışı",
30
+ "Loading channels...": "Kanallar yükleniyor...",
31
+ "Loading messages...": "Mesajlar yükleniyor...",
32
+ "Loading...": "Yükleniyor...",
33
+ "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.",
34
+ "Message Reactions": "Mesaj Tepkileri",
35
+ "Message deleted": "Mesaj silindi",
36
36
  "Message flagged": "Mesaj işaretlendi",
37
37
  "Mute User": "Kullanıcıyı sessize al",
38
- "Not supported": "",
39
- "Nothing yet...": "",
38
+ "Not supported": "Desteklenmiyor",
39
+ "Nothing yet...": "Henüz değil...",
40
40
  "Ok": "Tamam",
41
- "Only visible to you": "",
41
+ "Only visible to you": "Sadece siz görebilirsiniz",
42
42
  "Photo": "Fotoğraf",
43
43
  "Photos and Videos": "Fotoğraflar ve Videolar",
44
44
  "Pin to Conversation": "Konuşmaya sabitle",
45
45
  "Pinned by": "Tarafından sabitlendi",
46
46
  "Please enable access to your photos and videos so you can share them.": "Paylaşım yapabilmek için lutfen fotoğraflarınıza ve videolarınıza erişimi etkinleştirin.",
47
- "Please select a channel first": "",
48
- "Reconnecting...": "",
47
+ "Please select a channel first": "Lütfen önce bir kanal seçiniz",
48
+ "Reconnecting...": "Yeniden Bağlanılıyor...",
49
49
  "Reply": "Yanıtla",
50
- "Reply to Message": "",
50
+ "Reply to Message": "Mesajı Yanıtla",
51
51
  "Resend": "Yeniden gönder",
52
- "Search GIFs": "",
52
+ "Search GIFs": "GIF Ara",
53
53
  "Select More Photos": "Daha Fazla Fotoğraf Seçin",
54
- "Send a message": "",
55
- "Sending links is not allowed in this conversation": "",
56
- "Slow mode ON": "",
54
+ "Send a message": "Mesaj gönder",
55
+ "Sending links is not allowed in this conversation": "Bu konuşmada bağlantı göndermek desteklenmiyor",
56
+ "Slow mode ON": "Yavaş Mod Açık",
57
57
  "The message has been reported to a moderator.": "Mesaj moderatöre bildirildi.",
58
58
  "Thread Reply": "Konu Yanıtı",
59
59
  "Unblock User": "Kullanıcının engelini kaldır",
60
60
  "Unknown User": "Bilinmeyen kullanıcı",
61
61
  "Unmute User": "Kullanıcının sesini aç",
62
62
  "Unpin from Conversation": "Sabitlemeyi kaldır",
63
- "Unread Messages": "",
63
+ "Unread Messages": "Okunmamış Mesajlar",
64
64
  "Video": "Video",
65
- "You": "",
66
- "You can't send messages in this channel": "",
65
+ "You": "Sen",
66
+ "You can't send messages in this channel": "Bu konuşmaya mesaj gönderemezsiniz",
67
67
  "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} ve {{ nonSelfUserLength }} kişi daha yazıyor",
68
68
  "{{ index }} of {{ photoLength }}": "{{ index }} / {{ photoLength }}",
69
69
  "{{ replyCount }} Replies": "{{ replyCount }} Cevap",
70
70
  "{{ replyCount }} Thread Replies": "{{responseCount}} Konu Cevapı",
71
71
  "{{ user }} is typing": "{{ user }} yazıyor",
72
- "🏙 Attachment...": ""
72
+ "🏙 Attachment...": "🏙 Ek..."
73
73
  }
@@ -1,4 +1,4 @@
1
1
  import type { ChannelAPIResponse } from 'stream-chat';
2
2
  import type { DefaultStreamChatGenerics } from '../../types/types';
3
3
  import type { TableRow } from '../types';
4
- export declare const mapStorableToChannel: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(channelRow: TableRow<'channels'>) => Omit<ChannelAPIResponse<StreamChatGenerics>, "members" | "duration" | "messages" | "pinned_messages">;
4
+ export declare const mapStorableToChannel: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(channelRow: TableRow<'channels'>) => Omit<ChannelAPIResponse<StreamChatGenerics>, "duration" | "members" | "messages" | "pinned_messages">;
@@ -105,8 +105,6 @@ export declare const ACITriggerSettings: <StreamChatGenerics extends DefaultStre
105
105
  export declare const makeImageCompatibleUrl: (url: string) => string;
106
106
  export declare const getUrlWithoutParams: (url?: string | undefined) => string | undefined;
107
107
  export declare const isLocalUrl: (url: string) => boolean;
108
- export declare const vw: (percentageWidth: number, rounded?: boolean) => number;
109
- export declare const vh: (percentageHeight: number, rounded?: boolean) => number;
110
108
  export declare const generateRandomId: (a?: string) => string;
111
109
  export declare const emojiRegex: RegExp;
112
110
  export declare const urlRegex: RegExp;
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.22.0-beta.2",
4
+ "version": "5.22.0-beta.3",
5
5
  "author": {
6
6
  "company": "Stream.io Inc",
7
7
  "name": "Stream.io Inc"
@@ -24,8 +24,8 @@ import {
24
24
  useMessagesContext,
25
25
  } from '../../contexts/messagesContext/MessagesContext';
26
26
  import { useTheme } from '../../contexts/themeContext/ThemeContext';
27
+ import { useViewport } from '../../hooks/useViewport';
27
28
  import type { DefaultStreamChatGenerics } from '../../types/types';
28
- import { vw } from '../../utils/utils';
29
29
 
30
30
  const styles = StyleSheet.create({
31
31
  container: {
@@ -35,7 +35,6 @@ const styles = StyleSheet.create({
35
35
  padding: 8,
36
36
  },
37
37
  details: {
38
- maxWidth: vw(60),
39
38
  paddingLeft: 16,
40
39
  },
41
40
  size: {
@@ -94,6 +93,7 @@ const FileAttachmentWithContext = <
94
93
  },
95
94
  },
96
95
  } = useTheme();
96
+ const { vw } = useViewport();
97
97
 
98
98
  const defaultOnPress = () => openUrlSafely(attachment.asset_url);
99
99
 
@@ -134,7 +134,16 @@ const FileAttachmentWithContext = <
134
134
  >
135
135
  <View style={[styles.container, { backgroundColor: white }, container, stylesProp.container]}>
136
136
  <FileAttachmentIcon mimeType={attachment.mime_type} size={attachmentSize} />
137
- <View style={[styles.details, details, stylesProp.details]}>
137
+ <View
138
+ style={[
139
+ styles.details,
140
+ {
141
+ maxWidth: vw(60),
142
+ },
143
+ details,
144
+ stylesProp.details,
145
+ ]}
146
+ >
138
147
  <Text numberOfLines={2} style={[styles.title, { color: black }, title, stylesProp.title]}>
139
148
  {attachment.title}
140
149
  </Text>
@@ -20,13 +20,13 @@ import { renderAttachmentPickerItem } from './components/AttachmentPickerItem';
20
20
  import { useAttachmentPickerContext } from '../../contexts/attachmentPickerContext/AttachmentPickerContext';
21
21
  import { useTheme } from '../../contexts/themeContext/ThemeContext';
22
22
  import { useTranslationContext } from '../../contexts/translationContext/TranslationContext';
23
+ import { useViewport } from '../../hooks/useViewport';
23
24
  import {
24
25
  getPhotos,
25
26
  iOS14RefreshGallerySelection,
26
27
  oniOS14GalleryLibrarySelectionChange,
27
28
  } from '../../native';
28
29
  import type { Asset } from '../../types/types';
29
- import { vh } from '../../utils/utils';
30
30
 
31
31
  dayjs.extend(duration);
32
32
 
@@ -36,7 +36,6 @@ const styles = StyleSheet.create({
36
36
  },
37
37
  });
38
38
 
39
- const screenHeight = vh(100);
40
39
  const fullScreenHeight = Dimensions.get('window').height;
41
40
 
42
41
  export type AttachmentPickerProps = {
@@ -106,6 +105,9 @@ export const AttachmentPicker = React.forwardRef(
106
105
  setSelectedPicker,
107
106
  topInset,
108
107
  } = useAttachmentPickerContext();
108
+ const { vh } = useViewport();
109
+
110
+ const screenHeight = vh(100);
109
111
 
110
112
  const [currentIndex, setCurrentIndex] = useState(-1);
111
113
  const endCursorRef = useRef<string>();
@@ -8,10 +8,10 @@ import { lookup } from 'mime-types';
8
8
 
9
9
  import type { AttachmentPickerContextValue } from '../../../contexts/attachmentPickerContext/AttachmentPickerContext';
10
10
  import { useTheme } from '../../../contexts/themeContext/ThemeContext';
11
+ import { useViewport } from '../../../hooks/useViewport';
11
12
  import { Recorder } from '../../../icons';
12
13
  import { getLocalAssetUri } from '../../../native';
13
14
  import type { Asset, File } from '../../../types/types';
14
- import { vw } from '../../../utils/utils';
15
15
 
16
16
  type AttachmentPickerItemType = Pick<
17
17
  AttachmentPickerContextValue,
@@ -39,6 +39,7 @@ const AttachmentVideo: React.FC<AttachmentVideoProps> = (props) => {
39
39
  selectedFiles,
40
40
  setSelectedFiles,
41
41
  } = props;
42
+ const { vw } = useViewport();
42
43
 
43
44
  const {
44
45
  theme: {
@@ -152,6 +153,7 @@ const AttachmentImage: React.FC<AttachmentImageProps> = (props) => {
152
153
  colors: { overlay },
153
154
  },
154
155
  } = useTheme();
156
+ const { vw } = useViewport();
155
157
 
156
158
  const size = vw(100) / (numberOfAttachmentPickerImageColumns || 3) - 2;
157
159
 
@@ -19,8 +19,8 @@ import {
19
19
  } from '../../contexts/channelsContext/ChannelsContext';
20
20
  import { useChatContext } from '../../contexts/chatContext/ChatContext';
21
21
  import { useTheme } from '../../contexts/themeContext/ThemeContext';
22
+ import { useViewport } from '../../hooks/useViewport';
22
23
  import type { DefaultStreamChatGenerics } from '../../types/types';
23
- import { vw } from '../../utils/utils';
24
24
 
25
25
  const styles = StyleSheet.create({
26
26
  container: {
@@ -45,8 +45,6 @@ const styles = StyleSheet.create({
45
45
  title: { fontSize: 14, fontWeight: '700' },
46
46
  });
47
47
 
48
- const maxWidth = vw(80) - 16 - 40;
49
-
50
48
  export type ChannelPreviewMessengerPropsWithContext<
51
49
  StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
52
50
  > = Pick<ChannelPreviewProps<StreamChatGenerics>, 'channel'> &
@@ -120,6 +118,9 @@ const ChannelPreviewMessengerWithContext = <
120
118
  PreviewMutedStatus = ChannelPreviewMutedStatus,
121
119
  unread,
122
120
  } = props;
121
+ const { vw } = useViewport();
122
+
123
+ const maxWidth = vw(80) - 16 - 40;
123
124
 
124
125
  const {
125
126
  theme: {
@@ -3,11 +3,9 @@ import { useEffect, useState } from 'react';
3
3
  import type { Channel, ChannelMemberResponse } from 'stream-chat';
4
4
 
5
5
  import { useChatContext } from '../../../contexts/chatContext/ChatContext';
6
+ import { useViewport } from '../../../hooks/useViewport';
6
7
 
7
8
  import type { DefaultStreamChatGenerics } from '../../../types/types';
8
- import { vw } from '../../../utils/utils';
9
-
10
- const DEFAULT_MAX_CHARACTER_LENGTH = (vw(100) - 16) / 6;
11
9
 
12
10
  const ELLIPSIS = `...`;
13
11
 
@@ -81,6 +79,9 @@ export const useChannelPreviewDisplayName = <
81
79
  characterLength?: number,
82
80
  ) => {
83
81
  const { client } = useChatContext<StreamChatGenerics>();
82
+ const { vw } = useViewport();
83
+
84
+ const DEFAULT_MAX_CHARACTER_LENGTH = (vw(100) - 16) / 6;
84
85
 
85
86
  const currentUserId = client?.userID;
86
87
  const members = channel?.state?.members;
@@ -55,18 +55,16 @@ import {
55
55
  useOverlayContext,
56
56
  } from '../../contexts/overlayContext/OverlayContext';
57
57
  import { useTheme } from '../../contexts/themeContext/ThemeContext';
58
+ import { useViewport } from '../../hooks/useViewport';
58
59
  import { isVideoPackageAvailable, VideoType } from '../../native';
59
60
  import type { DefaultStreamChatGenerics } from '../../types/types';
60
61
  import { getResizedImageUrl } from '../../utils/getResizedImageUrl';
61
62
  import { getUrlOfImageAttachment } from '../../utils/getUrlOfImageAttachment';
62
- import { vh, vw } from '../../utils/utils';
63
63
  import { getGiphyMimeType } from '../Attachment/utils/getGiphyMimeType';
64
64
 
65
65
  const isAndroid = Platform.OS === 'android';
66
66
  const fullScreenHeight = Dimensions.get('screen').height;
67
- const measuredScreenHeight = vh(100);
68
- const screenWidth = vw(100);
69
- const halfScreenWidth = vw(50);
67
+
70
68
  const MARGIN = 32;
71
69
 
72
70
  export enum HasPinched {
@@ -162,6 +160,12 @@ export const ImageGallery = <
162
160
  const { messages, selectedMessage, setSelectedMessage } =
163
161
  useImageGalleryContext<StreamChatGenerics>();
164
162
 
163
+ const { vh, vw } = useViewport();
164
+
165
+ const measuredScreenHeight = vh(100);
166
+ const screenWidth = vw(100);
167
+ const halfScreenWidth = vw(50);
168
+
165
169
  /**
166
170
  * Height constants
167
171
  */
@@ -3,10 +3,8 @@ import { View } from 'react-native';
3
3
  import type { ImageStyle, StyleProp } from 'react-native';
4
4
  import Animated, { useAnimatedStyle } from 'react-native-reanimated';
5
5
 
6
- import { vw } from '../../../utils/utils';
6
+ import { useViewport } from '../../../hooks/useViewport';
7
7
 
8
- const screenWidth = vw(100);
9
- const halfScreenWidth = vw(50);
10
8
  const oneEighth = 1 / 8;
11
9
 
12
10
  type Props = {
@@ -40,6 +38,10 @@ export const AnimatedGalleryImage: React.FC<Props> = React.memo(
40
38
  translateX,
41
39
  translateY,
42
40
  } = props;
41
+ const { vw } = useViewport();
42
+
43
+ const screenWidth = vw(100);
44
+ const halfScreenWidth = vw(50);
43
45
 
44
46
  /**
45
47
  * The current image, designated by selected is scaled and translated
@@ -3,6 +3,7 @@ import { StyleSheet, View, ViewStyle } from 'react-native';
3
3
  import type { StyleProp } from 'react-native';
4
4
  import Animated, { useAnimatedStyle } from 'react-native-reanimated';
5
5
 
6
+ import { useViewport } from '../../../hooks/useViewport';
6
7
  import {
7
8
  isVideoPackageAvailable,
8
9
  PlaybackStatus,
@@ -12,11 +13,8 @@ import {
12
13
  VideoType,
13
14
  } from '../../../native';
14
15
 
15
- import { vw } from '../../../utils/utils';
16
16
  import { Spinner } from '../../Spinner/Spinner';
17
17
 
18
- const screenWidth = vw(100);
19
- const halfScreenWidth = vw(50);
20
18
  const oneEighth = 1 / 8;
21
19
 
22
20
  export type AnimatedGalleryVideoType = {
@@ -74,6 +72,10 @@ export const AnimatedGalleryVideo: React.FC<AnimatedGalleryVideoType> = React.me
74
72
  translateY,
75
73
  videoRef,
76
74
  } = props;
75
+ const { vw } = useViewport();
76
+
77
+ const screenWidth = vw(100);
78
+ const halfScreenWidth = vw(50);
77
79
 
78
80
  const onLoadStart = () => {
79
81
  setOpacity(1);
@@ -5,8 +5,8 @@ import { BottomSheetFlatList, TouchableOpacity } from '@gorhom/bottom-sheet';
5
5
 
6
6
  import { VideoThumbnail } from '../../../components/Attachment/VideoThumbnail';
7
7
  import { useTheme } from '../../../contexts/themeContext/ThemeContext';
8
+ import { useViewport } from '../../../hooks/useViewport';
8
9
  import type { DefaultStreamChatGenerics } from '../../../types/types';
9
- import { vw } from '../../../utils/utils';
10
10
 
11
11
  import type { Photo } from '../ImageGallery';
12
12
 
@@ -71,6 +71,7 @@ const GridImage = <
71
71
  },
72
72
  },
73
73
  } = useTheme();
74
+ const { vw } = useViewport();
74
75
  const { imageComponent, ...restItem } = item;
75
76
 
76
77
  const { numberOfImageGalleryGridColumns, selectAndClose, type, uri } = restItem;
@@ -3,10 +3,8 @@ import { StyleSheet, Text, View } from 'react-native';
3
3
 
4
4
  import { useTheme } from '../../contexts/themeContext/ThemeContext';
5
5
  import { useTranslationContext } from '../../contexts/translationContext/TranslationContext';
6
+ import { useViewport } from '../../hooks/useViewport';
6
7
  import { MessageIcon } from '../../icons/MessageIcon';
7
- import { vw } from '../../utils/utils';
8
-
9
- const width = vw(33);
10
8
 
11
9
  const styles = StyleSheet.create({
12
10
  channelContainer: {
@@ -17,7 +15,6 @@ const styles = StyleSheet.create({
17
15
  channelDetails: {
18
16
  fontSize: 14,
19
17
  textAlign: 'center',
20
- width: vw(66),
21
18
  },
22
19
  channelTitle: {
23
20
  fontSize: 16,
@@ -37,6 +34,8 @@ export const EmptyStateIndicator: React.FC<EmptyStateProps> = ({ listType }) =>
37
34
  emptyStateIndicator: { channelContainer, channelDetails, channelTitle },
38
35
  },
39
36
  } = useTheme();
37
+ const { vw } = useViewport();
38
+ const width = vw(33);
40
39
  const { t } = useTranslationContext();
41
40
 
42
41
  switch (listType) {
@@ -51,7 +50,7 @@ export const EmptyStateIndicator: React.FC<EmptyStateProps> = ({ listType }) =>
51
50
  {t("Let's start chatting!")}
52
51
  </Text>
53
52
  <Text
54
- style={[styles.channelDetails, { color: grey }, channelDetails]}
53
+ style={[styles.channelDetails, { color: grey, width: vw(66) }, channelDetails]}
55
54
  testID='empty-channel-state-details'
56
55
  >
57
56
  {t('How about sending your first message to a friend?')}
@@ -19,8 +19,9 @@ import {
19
19
  useTranslationContext,
20
20
  } from '../../../contexts/translationContext/TranslationContext';
21
21
 
22
+ import { useViewport } from '../../../hooks/useViewport';
22
23
  import type { DefaultStreamChatGenerics } from '../../../types/types';
23
- import { MessageStatusTypes, vw } from '../../../utils/utils';
24
+ import { MessageStatusTypes } from '../../../utils/utils';
24
25
 
25
26
  const styles = StyleSheet.create({
26
27
  containerInner: {
@@ -164,6 +165,7 @@ const MessageContentWithContext = <
164
165
  },
165
166
  },
166
167
  } = useTheme();
168
+ const { vw } = useViewport();
167
169
 
168
170
  const getDateText = (formatter?: (date: TDateTimeParserInput) => string) => {
169
171
  if (!message.created_at) return '';
@@ -4,7 +4,7 @@ import Svg, { Defs, LinearGradient, Rect, Stop } from 'react-native-svg';
4
4
 
5
5
  import { useTheme } from '../../contexts/themeContext/ThemeContext';
6
6
  import { useTranslationContext } from '../../contexts/translationContext/TranslationContext';
7
- import { vw } from '../../utils/utils';
7
+ import { useViewport } from '../../hooks/useViewport';
8
8
 
9
9
  const styles = StyleSheet.create({
10
10
  container: {
@@ -28,6 +28,7 @@ export const InlineUnreadIndicator: React.FC = () => {
28
28
  },
29
29
  } = useTheme();
30
30
  const { t } = useTranslationContext();
31
+ const { vw } = useViewport();
31
32
 
32
33
  return (
33
34
  <View style={[styles.container, container]}>
@@ -10,8 +10,8 @@ import {
10
10
  } from '../../contexts/messageOverlayContext/MessageOverlayContext';
11
11
  import type { OverlayProviderProps } from '../../contexts/overlayContext/OverlayContext';
12
12
  import { useTheme } from '../../contexts/themeContext/ThemeContext';
13
+ import { useViewport } from '../../hooks/useViewport';
13
14
  import type { DefaultStreamChatGenerics } from '../../types/types';
14
- import { vw } from '../../utils/utils';
15
15
 
16
16
  export type MessageActionListPropsWithContext<
17
17
  StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
@@ -52,6 +52,7 @@ const MessageActionListWithContext = <
52
52
  message,
53
53
  messageReactions,
54
54
  };
55
+ const { vw } = useViewport();
55
56
 
56
57
  const {
57
58
  theme: {
@@ -89,7 +90,7 @@ const MessageActionListWithContext = <
89
90
  width.value = layout.width;
90
91
  height.value = layout.height;
91
92
  }}
92
- style={[styles.container, { backgroundColor: white_snow }, showScreenStyle]}
93
+ style={[styles.container, { backgroundColor: white_snow, minWidth: vw(65) }, showScreenStyle]}
93
94
  testID='message-action-list'
94
95
  >
95
96
  {messageActions?.map((messageAction, index) => (
@@ -154,17 +155,8 @@ const styles = StyleSheet.create({
154
155
  container: {
155
156
  borderRadius: 16,
156
157
  marginTop: 8,
157
- minWidth: vw(65),
158
158
  overflow: 'hidden',
159
159
  },
160
- row: {
161
- alignItems: 'center',
162
- flexDirection: 'row',
163
- justifyContent: 'flex-start',
164
- minWidth: vw(65),
165
- paddingHorizontal: 20,
166
- paddingVertical: 10,
167
- },
168
160
  titleStyle: {
169
161
  paddingLeft: 20,
170
162
  },
@@ -6,8 +6,8 @@ import Animated from 'react-native-reanimated';
6
6
  import { useMessageActionAnimation } from './hooks/useMessageActionAnimation';
7
7
 
8
8
  import { useTheme } from '../../contexts/themeContext/ThemeContext';
9
+ import { useViewport } from '../../hooks/useViewport';
9
10
  import type { DefaultStreamChatGenerics } from '../../types/types';
10
- import { vw } from '../../utils/utils';
11
11
  import type { MessageOverlayPropsWithContext } from '../MessageOverlay/MessageOverlay';
12
12
 
13
13
  export type ActionType =
@@ -50,6 +50,7 @@ const MessageActionListItemWithContext = <
50
50
  props: MessageActionListItemProps<StreamChatGenerics>,
51
51
  ) => {
52
52
  const { action, actionType, icon, index, length, title, titleStyle } = props;
53
+ const { vw } = useViewport();
53
54
 
54
55
  const {
55
56
  theme: {
@@ -65,6 +66,9 @@ const MessageActionListItemWithContext = <
65
66
  <Animated.View
66
67
  style={[
67
68
  styles.row,
69
+ {
70
+ minWidth: vw(65),
71
+ },
68
72
  index !== length - 1 ? { ...styles.bottomBorder, borderBottomColor: border } : {},
69
73
  animatedStyle,
70
74
  messageActions.actionContainer,
@@ -114,7 +118,6 @@ const styles = StyleSheet.create({
114
118
  alignItems: 'center',
115
119
  flexDirection: 'row',
116
120
  justifyContent: 'flex-start',
117
- minWidth: vw(65),
118
121
  paddingHorizontal: 20,
119
122
  paddingVertical: 10,
120
123
  },
@@ -41,8 +41,8 @@ import {
41
41
  } from '../../contexts/overlayContext/OverlayContext';
42
42
  import { mergeThemes, ThemeProvider, useTheme } from '../../contexts/themeContext/ThemeContext';
43
43
 
44
+ import { useViewport } from '../../hooks/useViewport';
44
45
  import type { DefaultStreamChatGenerics } from '../../types/types';
45
- import { vh, vw } from '../../utils/utils';
46
46
  import { MessageTextContainer } from '../Message/MessageSimple/MessageTextContainer';
47
47
  import {
48
48
  OverlayReactions as DefaultOverlayReactions,
@@ -78,8 +78,6 @@ const styles = StyleSheet.create({
78
78
  scrollView: { overflow: Platform.OS === 'ios' ? 'visible' : 'scroll' },
79
79
  });
80
80
 
81
- const screenHeight = vh(100);
82
- const halfScreenHeight = vh(50);
83
81
  const DefaultMessageTextNumberOfLines = 5;
84
82
 
85
83
  export type MessageOverlayPropsWithContext<
@@ -154,6 +152,10 @@ const MessageOverlayWithContext = <
154
152
  };
155
153
 
156
154
  const { theme } = useTheme();
155
+ const { vh, vw } = useViewport();
156
+
157
+ const screenHeight = vh(100);
158
+ const halfScreenHeight = vh(50);
157
159
 
158
160
  const myMessageTheme = messagesContext?.myMessageTheme;
159
161
  const wrapMessageInTheme = clientId === message?.user?.id && !!myMessageTheme;
@@ -12,8 +12,8 @@ import {
12
12
  useThreadContext,
13
13
  } from '../../../contexts/threadContext/ThreadContext';
14
14
  import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext';
15
+ import { useViewport } from '../../../hooks/useViewport';
15
16
  import type { DefaultStreamChatGenerics } from '../../../types/types';
16
- import { vw } from '../../../utils/utils';
17
17
 
18
18
  const styles = StyleSheet.create({
19
19
  absolute: { position: 'absolute' },
@@ -47,6 +47,7 @@ const ThreadFooterComponentWithContext = <
47
47
  ) => {
48
48
  const { Message, thread } = props;
49
49
  const { t } = useTranslationContext();
50
+ const { vw } = useViewport();
50
51
 
51
52
  const {
52
53
  theme: {
@@ -2,7 +2,6 @@ import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';
2
2
  import type { CircleProps, Color, StopProps } from 'react-native-svg';
3
3
 
4
4
  import type { IconProps } from '../../../icons/utils/base';
5
- import { vh } from '../../../utils/utils';
6
5
 
7
6
  export const DEFAULT_STATUS_ICON_SIZE = 16;
8
7
 
@@ -302,9 +301,6 @@ export type Theme = {
302
301
  iconContainer: ViewStyle;
303
302
  title: TextStyle;
304
303
  };
305
- container: ViewStyle & {
306
- maxHeight: number;
307
- };
308
304
  emoji: {
309
305
  container: ViewStyle;
310
306
  text: TextStyle;
@@ -810,9 +806,6 @@ export const defaultTheme: Theme = {
810
806
  iconContainer: {},
811
807
  title: {},
812
808
  },
813
- container: {
814
- maxHeight: vh(25),
815
- },
816
809
  emoji: {
817
810
  container: {},
818
811
  text: {},