@ethora/chat-component-rn 26.7.3 → 26.7.4

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 (193) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +9 -8
  3. package/lib/commonjs/assets/icons.js +7 -2
  4. package/lib/commonjs/assets/icons.js.map +1 -1
  5. package/lib/commonjs/components/Header/HeaderRoomList.js +20 -6
  6. package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
  7. package/lib/commonjs/components/MainComponents/ChatRoom.js +26 -4
  8. package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
  9. package/lib/commonjs/components/MainComponents/MessageList.js +2 -1
  10. package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
  11. package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +5 -5
  12. package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
  13. package/lib/commonjs/components/MainComponents/RoomList.js +62 -32
  14. package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
  15. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +208 -70
  16. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
  17. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +307 -99
  18. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  19. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +552 -213
  20. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  21. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +226 -0
  22. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
  23. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +6 -2
  24. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  25. package/lib/commonjs/components/Modals/Modal/Modal.js +8 -0
  26. package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
  27. package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +202 -104
  28. package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
  29. package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +556 -0
  30. package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
  31. package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +210 -0
  32. package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
  33. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
  34. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  35. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +507 -244
  36. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  37. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +74 -46
  38. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  39. package/lib/commonjs/components/Modals/styledModalComponents.js +9 -2
  40. package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
  41. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +17 -7
  42. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
  43. package/lib/commonjs/components/styled/SendInput.js +80 -1
  44. package/lib/commonjs/components/styled/SendInput.js.map +1 -1
  45. package/lib/commonjs/components/styled/StyledComponents.js +9 -3
  46. package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
  47. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
  48. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  49. package/lib/commonjs/helpers/getChatBackground.js +23 -0
  50. package/lib/commonjs/helpers/getChatBackground.js.map +1 -0
  51. package/lib/commonjs/helpers/mediaLibraryRuntime.js +31 -0
  52. package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +1 -0
  53. package/lib/commonjs/helpers/sheetGestures.js +32 -0
  54. package/lib/commonjs/helpers/sheetGestures.js.map +1 -0
  55. package/lib/commonjs/i18n/strings.js +121 -1
  56. package/lib/commonjs/i18n/strings.js.map +1 -1
  57. package/lib/commonjs/networking/api-requests/user.api.js +59 -0
  58. package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
  59. package/lib/commonjs/roomStore/chatSettingsSlice.js +3 -1
  60. package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
  61. package/lib/module/assets/icons.js +6 -1
  62. package/lib/module/assets/icons.js.map +1 -1
  63. package/lib/module/components/Header/HeaderRoomList.js +20 -6
  64. package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
  65. package/lib/module/components/MainComponents/ChatRoom.js +26 -4
  66. package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
  67. package/lib/module/components/MainComponents/MessageList.js +2 -1
  68. package/lib/module/components/MainComponents/MessageList.js.map +1 -1
  69. package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +5 -5
  70. package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
  71. package/lib/module/components/MainComponents/RoomList.js +62 -32
  72. package/lib/module/components/MainComponents/RoomList.js.map +1 -1
  73. package/lib/module/components/Menu/HeaderRoomListMenu.js +211 -73
  74. package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
  75. package/lib/module/components/Modals/AttachSheet/AttachSheet.js +298 -102
  76. package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  77. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +555 -217
  78. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  79. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +223 -0
  80. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
  81. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +6 -2
  82. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  83. package/lib/module/components/Modals/Modal/Modal.js +9 -1
  84. package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
  85. package/lib/module/components/Modals/NewChatModal/NewChatModal.js +205 -106
  86. package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
  87. package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +548 -0
  88. package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
  89. package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +205 -0
  90. package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
  91. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
  92. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  93. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +509 -248
  94. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  95. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +76 -48
  96. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  97. package/lib/module/components/Modals/styledModalComponents.js +9 -2
  98. package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
  99. package/lib/module/components/RoomComponents/ChatRoomItem.js +17 -7
  100. package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
  101. package/lib/module/components/styled/SendInput.js +80 -1
  102. package/lib/module/components/styled/SendInput.js.map +1 -1
  103. package/lib/module/components/styled/StyledComponents.js +9 -3
  104. package/lib/module/components/styled/StyledComponents.js.map +1 -1
  105. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
  106. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  107. package/lib/module/helpers/getChatBackground.js +18 -0
  108. package/lib/module/helpers/getChatBackground.js.map +1 -0
  109. package/lib/module/helpers/mediaLibraryRuntime.js +25 -0
  110. package/lib/module/helpers/mediaLibraryRuntime.js.map +1 -0
  111. package/lib/module/helpers/sheetGestures.js +26 -0
  112. package/lib/module/helpers/sheetGestures.js.map +1 -0
  113. package/lib/module/i18n/strings.js +121 -1
  114. package/lib/module/i18n/strings.js.map +1 -1
  115. package/lib/module/networking/api-requests/user.api.js +56 -0
  116. package/lib/module/networking/api-requests/user.api.js.map +1 -1
  117. package/lib/module/roomStore/chatSettingsSlice.js +3 -1
  118. package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
  119. package/lib/typescript/assets/icons.d.ts +12 -0
  120. package/lib/typescript/assets/icons.d.ts.map +1 -1
  121. package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
  122. package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
  123. package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
  124. package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
  125. package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
  126. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +9 -0
  127. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
  128. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +10 -0
  129. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
  130. package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +9 -0
  131. package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +1 -0
  132. package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
  133. package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
  134. package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts +1 -1
  135. package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
  136. package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +75 -0
  137. package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +1 -0
  138. package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +25 -0
  139. package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +1 -0
  140. package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +6 -1
  141. package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
  142. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts +16 -0
  143. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
  144. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +1 -0
  145. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
  146. package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
  147. package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
  148. package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
  149. package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
  150. package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
  151. package/lib/typescript/helpers/getChatBackground.d.ts +15 -0
  152. package/lib/typescript/helpers/getChatBackground.d.ts.map +1 -0
  153. package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +3 -0
  154. package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +1 -0
  155. package/lib/typescript/helpers/sheetGestures.d.ts +20 -0
  156. package/lib/typescript/helpers/sheetGestures.d.ts.map +1 -0
  157. package/lib/typescript/i18n/strings.d.ts.map +1 -1
  158. package/lib/typescript/networking/api-requests/user.api.d.ts +27 -0
  159. package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
  160. package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
  161. package/lib/typescript/types/types.d.ts +8 -5
  162. package/lib/typescript/types/types.d.ts.map +1 -1
  163. package/package.json +6 -1
  164. package/src/assets/icons.tsx +29 -9
  165. package/src/components/Header/HeaderRoomList.tsx +20 -5
  166. package/src/components/MainComponents/ChatRoom.tsx +29 -7
  167. package/src/components/MainComponents/MessageList.tsx +2 -1
  168. package/src/components/MainComponents/ProfileImagePlaceholder.tsx +5 -5
  169. package/src/components/MainComponents/RoomList.tsx +65 -34
  170. package/src/components/Menu/HeaderRoomListMenu.tsx +209 -64
  171. package/src/components/Modals/AttachSheet/AttachSheet.tsx +318 -86
  172. package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +598 -279
  173. package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +244 -0
  174. package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +4 -2
  175. package/src/components/Modals/Modal/Modal.tsx +7 -0
  176. package/src/components/Modals/NewChatModal/NewChatModal.tsx +219 -117
  177. package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +615 -0
  178. package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +217 -0
  179. package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +14 -4
  180. package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +617 -307
  181. package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +75 -58
  182. package/src/components/Modals/styledModalComponents.tsx +9 -2
  183. package/src/components/RoomComponents/ChatRoomItem.tsx +14 -7
  184. package/src/components/styled/SendInput.tsx +83 -2
  185. package/src/components/styled/StyledComponents.ts +9 -3
  186. package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +11 -4
  187. package/src/helpers/getChatBackground.ts +18 -0
  188. package/src/helpers/mediaLibraryRuntime.ts +25 -0
  189. package/src/helpers/sheetGestures.ts +25 -0
  190. package/src/i18n/strings.ts +121 -1
  191. package/src/networking/api-requests/user.api.ts +71 -0
  192. package/src/roomStore/chatSettingsSlice.ts +3 -1
  193. package/src/types/types.ts +8 -5
@@ -0,0 +1,217 @@
1
+ /** @format */
2
+
3
+ import React, { useRef, useState } from 'react';
4
+ import {
5
+ Animated,
6
+ Dimensions,
7
+ Easing,
8
+ Modal,
9
+ Pressable,
10
+ StyleSheet,
11
+ Text,
12
+ TouchableOpacity,
13
+ View,
14
+ } from 'react-native';
15
+ import { MoreIcon } from '../../../assets/icons';
16
+
17
+ export interface ProfileMenuItem {
18
+ key: string;
19
+ label: string;
20
+ icon: React.ReactNode;
21
+ destructive?: boolean;
22
+ onPress: () => void;
23
+ }
24
+
25
+ /** Fallbacks used for the very first frame, before the card is measured. */
26
+ const ESTIMATED_WIDTH = 220;
27
+ const ESTIMATED_HEIGHT = 160;
28
+ const GAP = 8;
29
+ /** Roughly a notch inset + the header band, used until measured. */
30
+ const DEFAULT_TOP = 104;
31
+ const EDGE = 12;
32
+
33
+ /**
34
+ * The "…" overflow menu shared by the chat and user profile screens.
35
+ *
36
+ * The shared `DropdownMenu` pins its card at a hard-coded `top: 95`, which
37
+ * on this screen landed it over the host's own tab bar, unanchored to the
38
+ * button. This one measures the button and grows the card out of it: the
39
+ * card scales up from its top-right corner (translate → scale → translate
40
+ * back, which is how you fake a transform-origin in React Native) so the
41
+ * menu visibly unfolds from the three dots.
42
+ */
43
+ const ProfileMenu: React.FC<{
44
+ items: ProfileMenuItem[];
45
+ testIDPrefix?: string;
46
+ }> = ({ items, testIDPrefix = 'chat-profile' }) => {
47
+ const buttonRef = useRef<View>(null);
48
+ const [open, setOpen] = useState(false);
49
+ const [anchor, setAnchor] = useState({ top: DEFAULT_TOP, right: EDGE });
50
+ const [size, setSize] = useState({
51
+ width: ESTIMATED_WIDTH,
52
+ height: ESTIMATED_HEIGHT,
53
+ });
54
+ const progress = useRef(new Animated.Value(0)).current;
55
+
56
+ const animate = (to: number, done?: () => void) =>
57
+ Animated.timing(progress, {
58
+ toValue: to,
59
+ duration: to ? 180 : 140,
60
+ easing: to ? Easing.out(Easing.back(1.3)) : Easing.in(Easing.quad),
61
+ useNativeDriver: true,
62
+ }).start(({ finished }) => finished && done?.());
63
+
64
+ // Anchor to the button's window frame — that is the same coordinate
65
+ // space the <Modal> lays out in, so no insets to subtract. Measured on
66
+ // layout (and again on open) rather than *before* opening: on some hosts
67
+ // the measure callback never fires, and gating the open on it would mean
68
+ // a menu that simply doesn't appear.
69
+ const measure = () =>
70
+ buttonRef.current?.measureInWindow?.((x, y, width, height) => {
71
+ if (typeof y !== 'number' || typeof x !== 'number') {return;}
72
+ const screenWidth = Dimensions.get('window').width;
73
+ setAnchor({
74
+ top: y + height + GAP,
75
+ right: Math.max(screenWidth - (x + width), EDGE),
76
+ });
77
+ });
78
+
79
+ const openMenu = () => {
80
+ measure();
81
+ progress.setValue(0);
82
+ setOpen(true);
83
+ animate(1);
84
+ };
85
+
86
+ const closeMenu = (then?: () => void) =>
87
+ animate(0, () => {
88
+ setOpen(false);
89
+ then?.();
90
+ });
91
+
92
+ const scale = progress.interpolate({
93
+ inputRange: [0, 1],
94
+ outputRange: [0.2, 1],
95
+ });
96
+
97
+ if (items.length === 0) {
98
+ return null;
99
+ }
100
+
101
+ return (
102
+ <>
103
+ <View ref={buttonRef} collapsable={false} onLayout={measure}>
104
+ <TouchableOpacity
105
+ testID={`${testIDPrefix}-menu`}
106
+ activeOpacity={0.7}
107
+ onPress={openMenu}
108
+ style={styles.button}
109
+ >
110
+ <MoreIcon color="#FFFFFF" />
111
+ </TouchableOpacity>
112
+ </View>
113
+
114
+ <Modal
115
+ transparent
116
+ visible={open}
117
+ animationType="none"
118
+ onRequestClose={() => closeMenu()}
119
+ >
120
+ <Pressable
121
+ testID={`${testIDPrefix}-menu-backdrop`}
122
+ style={StyleSheet.absoluteFill}
123
+ onPress={() => closeMenu()}
124
+ />
125
+ <Animated.View
126
+ testID={`${testIDPrefix}-menu-card`}
127
+ onLayout={(e) => {
128
+ const { width, height } = e.nativeEvent.layout;
129
+ if (width && height) {setSize({ width, height });}
130
+ }}
131
+ style={[
132
+ styles.card,
133
+ {
134
+ top: anchor.top,
135
+ right: anchor.right,
136
+ opacity: progress,
137
+ transform: [
138
+ // Move the origin to the card's top-right corner, scale
139
+ // there, then move back — RN has no transform-origin.
140
+ { translateX: size.width / 2 },
141
+ { translateY: -size.height / 2 },
142
+ { scale },
143
+ { translateX: -size.width / 2 },
144
+ { translateY: size.height / 2 },
145
+ ],
146
+ },
147
+ ]}
148
+ >
149
+ {items.map((item, index) => (
150
+ <TouchableOpacity
151
+ key={item.key}
152
+ testID={`${testIDPrefix}-menu-${item.key}`}
153
+ activeOpacity={0.6}
154
+ style={[styles.row, index > 0 && styles.rowDivider]}
155
+ onPress={() => closeMenu(item.onPress)}
156
+ >
157
+ <Text
158
+ style={[styles.label, item.destructive && styles.destructive]}
159
+ >
160
+ {item.label}
161
+ </Text>
162
+ <View style={styles.icon}>{item.icon}</View>
163
+ </TouchableOpacity>
164
+ ))}
165
+ </Animated.View>
166
+ </Modal>
167
+ </>
168
+ );
169
+ };
170
+
171
+ const styles = StyleSheet.create({
172
+ button: {
173
+ width: 40,
174
+ height: 40,
175
+ borderRadius: 20,
176
+ backgroundColor: 'rgba(0,0,0,0.28)',
177
+ alignItems: 'center',
178
+ justifyContent: 'center',
179
+ },
180
+ card: {
181
+ position: 'absolute',
182
+ minWidth: 200,
183
+ backgroundColor: '#FFFFFF',
184
+ borderRadius: 14,
185
+ paddingVertical: 4,
186
+ shadowColor: '#121219',
187
+ shadowOffset: { width: 0, height: 6 },
188
+ shadowOpacity: 0.18,
189
+ shadowRadius: 16,
190
+ elevation: 12,
191
+ },
192
+ row: {
193
+ flexDirection: 'row',
194
+ alignItems: 'center',
195
+ justifyContent: 'space-between',
196
+ gap: 24,
197
+ paddingHorizontal: 16,
198
+ paddingVertical: 13,
199
+ },
200
+ rowDivider: {
201
+ borderTopWidth: StyleSheet.hairlineWidth,
202
+ borderTopColor: '#EFEFF2',
203
+ },
204
+ label: {
205
+ fontSize: 16,
206
+ color: '#141414',
207
+ },
208
+ destructive: {
209
+ color: '#E53935',
210
+ },
211
+ icon: {
212
+ width: 22,
213
+ alignItems: 'center',
214
+ },
215
+ });
216
+
217
+ export default ProfileMenu;
@@ -17,7 +17,13 @@ import { useToast } from '../../../context/ToastContext';
17
17
  import { updateRoom } from '../../../roomStore/roomsSlice';
18
18
  import { Text } from 'react-native';
19
19
 
20
- const SelectUsersModal: React.FC = () => {
20
+ interface SelectUsersModalProps {
21
+ /** Render the opener yourself (the chat profile uses an "Add Members"
22
+ * row). Falls back to the plain "Add more Users" button. */
23
+ trigger?: (open: () => void) => React.ReactNode;
24
+ }
25
+
26
+ const SelectUsersModal: React.FC<SelectUsersModalProps> = ({ trigger }) => {
21
27
  const { showToast } = useToast();
22
28
  const dispatch = useDispatch();
23
29
 
@@ -74,9 +80,13 @@ const SelectUsersModal: React.FC = () => {
74
80
 
75
81
  return (
76
82
  <>
77
- <ActionButton variant="filled" unstyled onPress={handleOpenModal}>
78
- Add more Users
79
- </ActionButton>
83
+ {trigger ? (
84
+ trigger(handleOpenModal)
85
+ ) : (
86
+ <ActionButton variant="filled" unstyled onPress={handleOpenModal}>
87
+ Add more Users
88
+ </ActionButton>
89
+ )}
80
90
 
81
91
  {isModalOpen && (
82
92
  <ModalBackground>