@cometchat/chat-uikit-react-native 4.3.21 → 4.3.22

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 (37) hide show
  1. package/package.json +1 -1
  2. package/src/AI/AIConversationSummary/AIConversationSummaryView.tsx +171 -167
  3. package/src/AI/CardView.tsx +55 -53
  4. package/src/CometChatCreateGroup/CometChatCreateGroup.tsx +8 -13
  5. package/src/CometChatGroups/CometChatGroups.tsx +545 -514
  6. package/src/CometChatJoinProtectedGroup/CometChatJoinProtectedGroup.tsx +5 -8
  7. package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +544 -378
  8. package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +90 -72
  9. package/src/CometChatThreadedMessages/CometChatThreadedMessages.tsx +3 -8
  10. package/src/CometChatTransferOwnership/CometChatTransferOwnership.tsx +11 -13
  11. package/src/CometChatUsers/CometChatUsers.tsx +24 -23
  12. package/src/extensions/CollaborativeBubble/CometChatCollaborativeBubble.tsx +24 -25
  13. package/src/extensions/Polls/Polls.tsx +8 -16
  14. package/src/extensions/Polls/PollsBubble.tsx +5 -10
  15. package/src/extensions/SmartReplies/SmartRepliesView.tsx +16 -22
  16. package/src/extensions/Stickers/CometChatStickerKeyboard/CometChatStickerKeyboard.tsx +51 -51
  17. package/src/shared/libs/datePickerModal/DateTimePickerModal.android.js +1 -7
  18. package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.js +38 -46
  19. package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +19 -19
  20. package/src/shared/views/CometChatAvatar/CometChatAvatar.tsx +8 -20
  21. package/src/shared/views/CometChatBadge/CometChatBadge.tsx +8 -14
  22. package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +141 -140
  23. package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +47 -51
  24. package/src/shared/views/CometChatDate/CometChatDate.tsx +18 -17
  25. package/src/shared/views/CometChatDateTimePicker/CometChatDateTimePicker.tsx +65 -51
  26. package/src/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.tsx +76 -72
  27. package/src/shared/views/CometChatFormBubble/CometChatFormBubble.tsx +3 -8
  28. package/src/shared/views/CometChatList/CometChatList.tsx +133 -134
  29. package/src/shared/views/CometChatListItem/CometChatListItem.tsx +62 -61
  30. package/src/shared/views/CometChatMediaRecorder/CometChatMediaRecorder.tsx +2 -6
  31. package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +3 -8
  32. package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +24 -23
  33. package/src/shared/views/CometChatReactions/CometChatReactions.tsx +107 -53
  34. package/src/shared/views/CometChatReceipt/CometChatReceipt.tsx +22 -14
  35. package/src/shared/views/CometChatStatusIndicator/CometChatStatusIndicator.tsx +15 -8
  36. package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +2 -6
  37. package/src/shared/views/SwipeRow/SwipeRow.tsx +6 -14
@@ -176,7 +176,6 @@ export interface CometChatMessageHeaderInterface {
176
176
  tailViewContainerStyle?: StyleProp<ViewStyle>;
177
177
  }
178
178
 
179
-
180
179
  export const CometChatMessageHeader = (
181
180
  props: CometChatMessageHeaderInterface
182
181
  ) => {
@@ -192,9 +191,6 @@ export const CometChatMessageHeader = (
192
191
  protectedGroupIcon,
193
192
  privateGroupIcon,
194
193
  AppBarOptions,
195
- style,
196
- user,
197
- group,
198
194
  backButtonIcon,
199
195
  hideBackIcon,
200
196
  ListItemView,
@@ -205,25 +201,31 @@ export const CometChatMessageHeader = (
205
201
  headViewContainerStyle,
206
202
  bodyViewContainerStyle,
207
203
  tailViewContainerStyle,
204
+
205
+ user = null,
206
+ group = null,
207
+ style = {},
208
208
  } = props;
209
209
 
210
210
  const _avatarStyle = new AvatarStyle({
211
211
  backgroundColor: theme?.palette?.getAccent600(),
212
212
  nameTextColor: theme?.palette?.getAccent(),
213
213
  nameTextFont: theme?.typography.body,
214
- ...props?.avatarStyle
214
+ ...avatarStyle,
215
215
  });
216
216
 
217
217
  const [groupObj, setGroupObj] = useState(group);
218
- const [userStatus, setUserStatus] = useState((user && user.getStatus) ? user.getStatus() : '');
218
+ const [userStatus, setUserStatus] = useState(
219
+ user && user.getStatus ? user.getStatus() : ''
220
+ );
219
221
  const [typingText, setTypingText] = useState('');
220
222
 
221
223
  const receiverTypeRef = useRef(
222
224
  user
223
225
  ? CometChat.RECEIVER_TYPE.USER
224
226
  : group
225
- ? CometChat.RECEIVER_TYPE.GROUP
226
- : null
227
+ ? CometChat.RECEIVER_TYPE.GROUP
228
+ : null
227
229
  );
228
230
 
229
231
  useEffect(() => {
@@ -243,8 +245,8 @@ export const CometChatMessageHeader = (
243
245
  ? { uri: backButtonIcon }
244
246
  : typeof backButtonIcon == 'object' ||
245
247
  typeof backButtonIcon == 'number'
246
- ? backButtonIcon
247
- : ICONS.BACK
248
+ ? backButtonIcon
249
+ : ICONS.BACK
248
250
  }
249
251
  style={[
250
252
  styles.backButtonIconStyle,
@@ -259,13 +261,16 @@ export const CometChatMessageHeader = (
259
261
  if (!disableTyping && typingText !== '')
260
262
  return (
261
263
  <Text
262
- style={[
263
- {
264
- color:
265
- style?.typingIndicatorTextColor ?? theme.palette.getAccent600(),
266
- },
267
- style?.typingIndicatorTextFont ?? theme.typography.text1,
268
- ] as TextStyle}
264
+ style={
265
+ [
266
+ {
267
+ color:
268
+ style?.typingIndicatorTextColor ??
269
+ theme.palette.getAccent600(),
270
+ },
271
+ style?.typingIndicatorTextFont ?? theme.typography.text1,
272
+ ] as TextStyle[]
273
+ }
269
274
  >
270
275
  {typingText}
271
276
  </Text>
@@ -273,19 +278,21 @@ export const CometChatMessageHeader = (
273
278
  if (disableUsersPresence) return null;
274
279
  return (
275
280
  <Text
276
- style={[
277
- { color: style?.subtitleTextColor ?? theme.palette.getAccent600() },
278
- style?.subtitleTextFont ?? theme.typography.text1,
279
- ] as TextStyle}
281
+ style={
282
+ [
283
+ { color: style?.subtitleTextColor ?? theme.palette.getAccent600() },
284
+ style?.subtitleTextFont ?? theme.typography.text1,
285
+ ] as TextStyle[]
286
+ }
280
287
  >
281
288
  {receiverTypeRef.current === CometChat.RECEIVER_TYPE.GROUP &&
282
- (groupObj?.['membersCount'] || groupObj?.['membersCount'] === 0)
289
+ (groupObj?.['membersCount'] || groupObj?.['membersCount'] === 0)
283
290
  ? `${groupObj['membersCount']} ${localize('MEMBERS')}`
284
291
  : receiverTypeRef.current === CometChat.RECEIVER_TYPE.USER
285
- ? userStatus === UserStatusConstants.online
286
- ? localize('ONLINE')
287
- : localize('OFFLINE')
288
- : ''}
292
+ ? userStatus === UserStatusConstants.online
293
+ ? localize('ONLINE')
294
+ : localize('OFFLINE')
295
+ : ''}
289
296
  </Text>
290
297
  );
291
298
  };
@@ -315,7 +322,10 @@ export const CometChatMessageHeader = (
315
322
  };
316
323
 
317
324
  const handleGroupListener = (groupDetails: any) => {
318
- if (groupDetails?.guid === groupObj?.getGuid() && groupDetails.membersCount) {
325
+ if (
326
+ groupDetails?.guid === groupObj?.getGuid() &&
327
+ groupDetails.membersCount
328
+ ) {
319
329
  setGroupObj(groupDetails);
320
330
  }
321
331
  };
@@ -392,17 +402,19 @@ export const CometChatMessageHeader = (
392
402
 
393
403
  return (
394
404
  <View
395
- style={[
396
- { flexDirection: 'row' },
397
- {
398
- width: style?.width ?? 'auto',
399
- height: style?.height ?? 'auto',
400
- backgroundColor:
401
- style?.backgroundColor ?? theme.palette.getBackgroundColor(),
402
- borderRadius: style?.borderRadius ?? 0,
403
- },
404
- style?.border ?? {},
405
- ] as ViewProps}
405
+ style={
406
+ [
407
+ { flexDirection: 'row' },
408
+ {
409
+ width: style?.width ?? 'auto',
410
+ height: style?.height ?? 'auto',
411
+ backgroundColor:
412
+ style?.backgroundColor ?? theme.palette.getBackgroundColor(),
413
+ borderRadius: style?.borderRadius ?? 0,
414
+ },
415
+ style?.border ?? {},
416
+ ] as ViewProps
417
+ }
406
418
  >
407
419
  {!hideBackIcon && <BackButton />}
408
420
  <View style={{ flex: 1 }}>
@@ -412,19 +424,31 @@ export const CometChatMessageHeader = (
412
424
  <CometChatListItem
413
425
  id={user ? user.getUid() : groupObj ? groupObj.getGuid() : ''}
414
426
  title={user ? user.getName() : groupObj ? groupObj.getName() : ''}
415
- avatarName={user ? user.getName() : groupObj ? groupObj.getName() : ''}
416
- avatarURL={user ? user.getAvatar() ? { uri: user.getAvatar() } : undefined : groupObj ? groupObj.getIcon() ? { uri: groupObj.getIcon() } : undefined : undefined}
427
+ avatarName={
428
+ user ? user.getName() : groupObj ? groupObj.getName() : ''
429
+ }
430
+ avatarURL={
431
+ user
432
+ ? user.getAvatar()
433
+ ? { uri: user.getAvatar() }
434
+ : undefined
435
+ : groupObj
436
+ ? groupObj.getIcon()
437
+ ? { uri: groupObj.getIcon() }
438
+ : undefined
439
+ : undefined
440
+ }
417
441
  SubtitleView={
418
442
  SubtitleView
419
443
  ? () => (
420
- <SubtitleView
421
- {...(user
422
- ? { user }
423
- : groupObj
444
+ <SubtitleView
445
+ {...(user
446
+ ? { user }
447
+ : groupObj
424
448
  ? { group: groupObj }
425
449
  : {})}
426
- />
427
- )
450
+ />
451
+ )
428
452
  : SubtitleViewFnc
429
453
  }
430
454
  bodyViewContainerStyle={{
@@ -440,23 +464,23 @@ export const CometChatMessageHeader = (
440
464
  disableUsersPresence
441
465
  ? 'transparent'
442
466
  : user && userStatus === UserStatusConstants.online
443
- ? style?.onlineStatusColor || theme.palette.getSuccess()
444
- : 'transparent'
467
+ ? style?.onlineStatusColor || theme.palette.getSuccess()
468
+ : 'transparent'
445
469
  }
446
470
  statusIndicatorStyle={
447
471
  (groupObj
448
472
  ? {
449
- height: 15,
450
- width: 15,
451
- backgroundColor:
452
- groupObj.getType() === CometChat.GROUP_TYPE.PASSWORD
453
- ? PASSWORD_GROUP_COLOR // Note: Need to add this in palette
454
- : groupObj.getType() === CometChat.GROUP_TYPE.PRIVATE
473
+ height: 15,
474
+ width: 15,
475
+ backgroundColor:
476
+ groupObj.getType() === CometChat.GROUP_TYPE.PASSWORD
477
+ ? PASSWORD_GROUP_COLOR // Note: Need to add this in palette
478
+ : groupObj.getType() === CometChat.GROUP_TYPE.PRIVATE
455
479
  ? PRIVATE_GROUP_COLOR // Note: Need to add this in palette
456
480
  : '',
457
- borderRadius: 15,
458
- ...statusIndicatorStyle,
459
- }
481
+ borderRadius: 15,
482
+ ...statusIndicatorStyle,
483
+ }
460
484
  : { ...statusIndicatorStyle }) as ViewProps
461
485
  }
462
486
  statusIndicatorIcon={
@@ -466,25 +490,25 @@ export const CometChatMessageHeader = (
466
490
  ? protectedGroupIcon
467
491
  : ICONS.PROTECTED
468
492
  : groupObj.getType() === CometChat.GROUP_TYPE.PRIVATE
493
+ ? privateGroupIcon
469
494
  ? privateGroupIcon
470
495
  ? privateGroupIcon
471
- ? privateGroupIcon
472
- : ICONS.PRIVATE
473
- : null
496
+ : ICONS.PRIVATE
474
497
  : null
498
+ : null
475
499
  : null
476
500
  }
477
501
  TailView={
478
502
  AppBarOptions
479
503
  ? () => (
480
- <AppBarOptions
481
- {...(user
482
- ? { user }
483
- : groupObj
504
+ <AppBarOptions
505
+ {...(user
506
+ ? { user }
507
+ : groupObj
484
508
  ? { group: groupObj }
485
509
  : {})}
486
- />
487
- )
510
+ />
511
+ )
488
512
  : null
489
513
  }
490
514
  headViewContainerStyle={headViewContainerStyle}
@@ -496,9 +520,3 @@ export const CometChatMessageHeader = (
496
520
  </View>
497
521
  );
498
522
  };
499
-
500
- CometChatMessageHeader.defaultProps = {
501
- user: null,
502
- group: null,
503
- style: {},
504
- };
@@ -125,7 +125,6 @@ export const CometChatThreadedMessages = (
125
125
 
126
126
  const {
127
127
  parentMessage,
128
- title,
129
128
  closeIcon,
130
129
  BubbleView,
131
130
  MessageActionView,
@@ -136,7 +135,8 @@ export const CometChatThreadedMessages = (
136
135
  threadedMessagesStyle,
137
136
  hideMessageComposer,
138
137
  MessageComposerView,
139
- MessageListView
138
+ MessageListView,
139
+ title= localize('THREAD'),
140
140
  } = props;
141
141
 
142
142
  const loggedInUser = useRef<CometChat.User | null>(null);
@@ -286,7 +286,7 @@ export const CometChatThreadedMessages = (
286
286
  {
287
287
  color: theme.palette.getAccent600(),
288
288
  },
289
- ] as TextStyle}
289
+ ] as TextStyle[]}
290
290
  >
291
291
  {replyCount ?? 0} {replyCount > 1 ? localize("REPLIES") : localize("REPLY")}
292
292
  </Text>
@@ -343,8 +343,3 @@ export const CometChatThreadedMessages = (
343
343
  </View>
344
344
  );
345
345
  };
346
- CometChatThreadedMessages.defaultProps = {
347
- title: localize('THREAD'),
348
- threadedMessagesStyle: {},
349
- parentMessage: {},
350
- };
@@ -65,7 +65,7 @@ export const CometChatTransferOwnership = (
65
65
  const { theme } = useContext(CometChatContext);
66
66
 
67
67
  const {
68
- title = localize("TRANSFER_OWNERSHIP"),
68
+ title = localize('TRANSFER_OWNERSHIP'),
69
69
  group,
70
70
  onTransferOwnership,
71
71
  transferOwnershipStyle,
@@ -76,7 +76,7 @@ export const CometChatTransferOwnership = (
76
76
  const [loggedInUser, setLoggedInUser] = useState<CometChat.User | null>();
77
77
 
78
78
  const transferOwnership = (members: string | any[]) => {
79
- if(!members.length) return
79
+ if (!members.length) return;
80
80
  let member = members[0];
81
81
  let GUID: string = member.guid;
82
82
  let UID: string = member.uid;
@@ -89,12 +89,15 @@ export const CometChatTransferOwnership = (
89
89
  group['scope'] = GroupMemberScope.admin;
90
90
  group['owner'] = UID;
91
91
  onTransferOwnership && onTransferOwnership(group, member);
92
-
92
+
93
93
  //message parameter removed
94
- CometChatUIEventHandler.emitGroupEvent(CometChatUIEvents.ccOwnershipChanged, {
95
- group,
96
- newOwner: member,
97
- });
94
+ CometChatUIEventHandler.emitGroupEvent(
95
+ CometChatUIEvents.ccOwnershipChanged,
96
+ {
97
+ group,
98
+ newOwner: member,
99
+ }
100
+ );
98
101
  onBack && onBack();
99
102
  },
100
103
  (error: any) => {
@@ -123,7 +126,7 @@ export const CometChatTransferOwnership = (
123
126
  TailView={(item: any) => {
124
127
  return (
125
128
  <View>
126
- <Text style={{color: theme?.palette?.getAccent()}}>
129
+ <Text style={{ color: theme?.palette?.getAccent() }}>
127
130
  {loggedInUser?.getUid() === item.owner
128
131
  ? GroupMemberScope.owner
129
132
  : item.scope}
@@ -140,8 +143,3 @@ export const CometChatTransferOwnership = (
140
143
  </View>
141
144
  );
142
145
  };
143
-
144
- CometChatTransferOwnership.defaultProps = {
145
- group: {},
146
- title: localize("Transfer Ownership"), // Note: Update after localization is updated
147
- };
@@ -13,7 +13,7 @@ import {
13
13
  CometChatListStylesInterface,
14
14
  CometChatOptions,
15
15
  } from '../shared';
16
- import {UsersStyle, UsersStyleInterface} from './UsersStyle'
16
+ import { UsersStyle, UsersStyleInterface } from './UsersStyle';
17
17
  import { CometChatUIEventHandler } from '../shared/events/CometChatUIEventHandler/CometChatUIEventHandler';
18
18
 
19
19
  export interface CometChatUsersInterface
@@ -31,8 +31,6 @@ export interface CometChatUsersInterface
31
31
  | 'listItemKey'
32
32
  | 'onSelection'
33
33
  > {
34
-
35
-
36
34
  /**
37
35
  *
38
36
  *
@@ -106,7 +104,18 @@ export const CometChatUsers = React.forwardRef<
106
104
  const ccUserBlockedId = 'ccUserBlocked_' + new Date().getTime();
107
105
  const ccUserUnBlockedId = 'ccUserBlocked_' + new Date().getTime();
108
106
 
109
- const { usersRequestBuilder, usersStyle, ...newProps } = props;
107
+ const {
108
+ usersRequestBuilder = new CometChat.UsersRequestBuilder()
109
+ .setLimit(30)
110
+ .hideBlockedUsers(false)
111
+ .setRoles([])
112
+ .friendsOnly(false)
113
+ .setStatus('')
114
+ .setTags([])
115
+ .setUIDs([]),
116
+ usersStyle,
117
+ ...newProps
118
+ } = props;
110
119
 
111
120
  //context values
112
121
  const { theme } = React.useContext<CometChatContextType>(CometChatContext);
@@ -122,8 +131,8 @@ export const CometChatUsers = React.forwardRef<
122
131
  errorTextFont: theme?.typography.subtitle1,
123
132
  searchBackgroundColor: theme?.palette.getAccent600(),
124
133
  searchBorder: new BorderStyle({
125
- borderColor: theme?.palette.getAccent700(),
126
- ...usersStyle?.border,
134
+ borderColor: theme?.palette.getAccent700(),
135
+ ...usersStyle?.border,
127
136
  }),
128
137
  separatorColor: theme?.palette.getAccent100(),
129
138
  subtitleTextColor: theme?.palette.getAccent600(),
@@ -131,9 +140,9 @@ export const CometChatUsers = React.forwardRef<
131
140
  titleColor: theme?.palette.getAccent(),
132
141
  titleFont: theme?.typography.title1,
133
142
  loadingIconTint: theme?.palette.getPrimary(),
134
- ...usersStyle
135
- });
136
-
143
+ ...usersStyle,
144
+ });
145
+
137
146
  useImperativeHandle(ref, () => {
138
147
  return {
139
148
  updateList: userRef.current!.updateList,
@@ -143,7 +152,7 @@ export const CometChatUsers = React.forwardRef<
143
152
  updateAndMoveToFirst: userRef.current!.updateAndMoveToFirst,
144
153
  getSelectedItems: userRef.current!.getSelectedItems,
145
154
  getAllListItems: userRef.current!.getAllListItems,
146
- clearSelection: userRef.current!.clearSelection
155
+ clearSelection: userRef.current!.clearSelection,
147
156
  };
148
157
  });
149
158
 
@@ -195,21 +204,13 @@ export const CometChatUsers = React.forwardRef<
195
204
  ref={userRef}
196
205
  title={'Users'}
197
206
  requestBuilder={usersRequestBuilder}
198
- listStyle={{ ..._usersStyle, background: _usersStyle.backgroundColor }}
199
- {...newProps as CometChatListProps}
207
+ listStyle={{
208
+ ..._usersStyle,
209
+ background: _usersStyle.backgroundColor,
210
+ }}
211
+ {...(newProps as CometChatListProps)}
200
212
  listItemKey="uid"
201
213
  />
202
214
  </View>
203
215
  );
204
216
  });
205
-
206
- CometChatUsers.defaultProps = {
207
- usersRequestBuilder: new CometChat.UsersRequestBuilder()
208
- .setLimit(30)
209
- .hideBlockedUsers(false)
210
- .setRoles([])
211
- .friendsOnly(false)
212
- .setStatus('')
213
- .setTags([])
214
- .setUIDs([]),
215
- };
@@ -44,44 +44,53 @@ interface CollaborativeBubbleProps {
44
44
 
45
45
  export const CometChatCollaborativeBubble = (props: CollaborativeBubbleProps) => {
46
46
 
47
+ const {
48
+ title= "",
49
+ subTitle= "",
50
+ buttonText= "",
51
+ icon= undefined,
52
+ style= new CollaborativeBubbleStyle({}),
53
+ url= undefined,
54
+ onPress
55
+ } = props;
56
+
47
57
 
48
58
  const openLink = () => {
49
59
 
50
- if (props.url != "")
51
- if(props.onPress!=undefined){
52
- props.onPress(props.url)
60
+ if (url != "")
61
+ if(onPress!=undefined){
62
+ onPress(url)
53
63
  } else {
54
- console.log("opening uRL , ", props.url);
55
- WebView.openUrl(props.url);
64
+ console.log("opening uRL , ", url);
65
+ WebView.openUrl(url);
56
66
  }
57
67
 
58
68
  }
59
69
 
60
70
  const getIcon = () => {
61
- if (props.icon) {
62
- if (typeof props.icon == 'number')
63
- return props.icon
64
- if (typeof props.icon == 'string')
65
- return {uri: props.icon}
71
+ if (icon) {
72
+ if (typeof icon == 'number')
73
+ return icon
74
+ if (typeof icon == 'string')
75
+ return {uri: icon}
66
76
  }
67
77
  return whiteboard
68
78
  }
69
79
 
70
80
  const getButtonText = () => {
71
- if (props.buttonText && props.buttonText.trim().length > 0) {
72
- return props.buttonText;
81
+ if (buttonText && buttonText.trim().length > 0) {
82
+ return buttonText;
73
83
  }
74
84
  return "";
75
85
  }
76
86
 
77
- const {style} = props;
78
87
 
79
88
  return (
80
89
  <View style={Styles(style).containerStyle}>
81
90
  <View style={Styles(style).rowStyle}>
82
91
  <View style={{ flex: 1 }}>
83
- <Text numberOfLines={2} ellipsizeMode={"tail"} style={Styles(style).titleStyle}>{props.title}</Text>
84
- <Text numberOfLines={2} ellipsizeMode={"tail"} style={Styles(style).subtitleStyle}>{props.subTitle}</Text>
92
+ <Text numberOfLines={2} ellipsizeMode={"tail"} style={Styles(style).titleStyle}>{title}</Text>
93
+ <Text numberOfLines={2} ellipsizeMode={"tail"} style={Styles(style).subtitleStyle}>{subTitle}</Text>
85
94
  </View>
86
95
  <View style={Styles(style).imageContainerStyle}>
87
96
  <Image source={getIcon()} style={Styles(style).imageStyle} />
@@ -95,13 +104,3 @@ export const CometChatCollaborativeBubble = (props: CollaborativeBubbleProps) =>
95
104
  );
96
105
  }
97
106
 
98
- CometChatCollaborativeBubble.defaultProps = {
99
- title: "",
100
- subTitle: "",
101
- buttonText: "",
102
- icon: undefined,
103
- whiteboardURL: "",
104
- loggedInUser: undefined,
105
- style: new CollaborativeBubbleStyle({}),
106
- }
107
-
@@ -161,21 +161,21 @@ export interface CometChatCreatePollInterface {
161
161
  export const CometChatCreatePoll = (props: CometChatCreatePollInterface) => {
162
162
  const { theme } = useContext<CometChatContextType>(CometChatContext);
163
163
  const {
164
- title,
165
164
  closeIcon,
166
165
  createIcon,
167
- questionPlaceholderText,
168
166
  onError,
169
- createPollsStyle,
170
167
  user,
171
168
  group,
172
169
  onClose,
173
- answerPlaceholderText,
174
170
  answerHelpText,
175
171
  addAnswerText,
176
172
  deleteIcon,
177
173
  createPollIcon,
178
- defaultAnswers,
174
+ title= localize('CREATE_POLL'),
175
+ questionPlaceholderText= localize('NAME'),
176
+ answerPlaceholderText= localize('ANSWER'),
177
+ createPollsStyle= {},
178
+ defaultAnswers= 2,
179
179
  } = props;
180
180
 
181
181
  const [question, setQuestion] = React.useState('');
@@ -256,7 +256,7 @@ export const CometChatCreatePoll = (props: CometChatCreatePollInterface) => {
256
256
  styles.errorTextTitle,
257
257
  theme.typography.body,
258
258
  { color: theme.palette.getError() },
259
- ] as TextStyle}
259
+ ] as TextStyle[]}
260
260
  >
261
261
  {error?.length > 0 ? error : ''}
262
262
  </Text>
@@ -265,7 +265,7 @@ export const CometChatCreatePoll = (props: CometChatCreatePollInterface) => {
265
265
  styles.errorText,
266
266
  theme.typography.body,
267
267
  { color: theme.palette.getError() },
268
- ] as TextStyle}
268
+ ] as TextStyle[]}
269
269
  >
270
270
  {localize('TRY_AGAIN_LATER')}
271
271
  </Text>
@@ -353,7 +353,7 @@ export const CometChatCreatePoll = (props: CometChatCreatePollInterface) => {
353
353
  {
354
354
  color: theme.palette.getPrimary(),
355
355
  },
356
- ] as TextStyle}
356
+ ] as TextStyle[]}
357
357
  >
358
358
  {addAnswerText ?? localize('ADD_ANOTHER_ANSWER')}
359
359
  </Text>
@@ -481,11 +481,3 @@ export const CometChatCreatePoll = (props: CometChatCreatePollInterface) => {
481
481
  </KeyboardAvoidingView>
482
482
  );
483
483
  };
484
-
485
- CometChatCreatePoll.defaultProps = {
486
- title: 'Create Polls',
487
- questionPlaceholderText: localize('NAME'),
488
- answerPlaceholderText: localize('ANSWER'),
489
- createPollsStyle: {},
490
- defaultAnswers: 2,
491
- };
@@ -190,7 +190,7 @@ export const PollsBubble = (props: PollsBubbleInterface) => {
190
190
  },
191
191
  theme.typography.subtitle1,
192
192
  pollsBubbleStyle?.pollOptionsTextStyle,
193
- ] as TextStyle}
193
+ ] as TextStyle[]}
194
194
  >
195
195
  {value}
196
196
  </Text>
@@ -204,7 +204,7 @@ export const PollsBubble = (props: PollsBubbleInterface) => {
204
204
  },
205
205
  theme.typography.subtitle1,
206
206
  pollsBubbleStyle?.pollOptionsTextStyle,
207
- ] as TextStyle}>
207
+ ] as TextStyle[]}>
208
208
  {optionsMetaData.results.options[id].count}
209
209
  </Text>
210
210
  </TouchableOpacity>
@@ -260,7 +260,7 @@ export const PollsBubble = (props: PollsBubbleInterface) => {
260
260
  },
261
261
  style.questionText,
262
262
  pollsBubbleStyle?.questionTextStyle,
263
- ] as TextStyle}
263
+ ] as TextStyle[]}
264
264
  >
265
265
  {pollQuestion}
266
266
  </Text>
@@ -278,7 +278,7 @@ export const PollsBubble = (props: PollsBubbleInterface) => {
278
278
  theme.palette.getAccent600(),
279
279
  },
280
280
  pollsBubbleStyle?.voteCountTextStyle,
281
- ] as TextStyle}
281
+ ] as TextStyle[]}
282
282
  >
283
283
  {optionsMetaData.results?.total} people voted
284
284
  </Text>
@@ -342,9 +342,4 @@ const style = StyleSheet.create({
342
342
  alignItems: "center",
343
343
  zIndex: 1,
344
344
  }
345
- });
346
- PollsBubble.defaultProps = {
347
- options: {},
348
- loggedInUser: {},
349
- pollsBubbleStyle: {},
350
- };
345
+ });