@cometchat/chat-uikit-react-native 5.0.0-beta.1 → 5.0.0

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 (98) hide show
  1. package/README.md +2 -3
  2. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  3. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  4. package/android/src/main/java/com/reactnativecometchatuikit/CometChatSoundModule.java +29 -44
  5. package/android/src/main/java/com/reactnativecometchatuikit/SoundPlayer.java +12 -0
  6. package/ios/FileManager.m +26 -9
  7. package/package.json +11 -36
  8. package/src/CometChatConversations/CometChatConversations.tsx +287 -147
  9. package/src/CometChatConversations/Skeleton.tsx +116 -73
  10. package/src/CometChatConversations/style.ts +17 -22
  11. package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +439 -227
  12. package/src/CometChatGroupMembers/style.ts +2 -4
  13. package/src/CometChatGroups/CometChatGroups.tsx +239 -135
  14. package/src/CometChatGroups/GroupsStyle.ts +20 -17
  15. package/src/CometChatGroups/Skeleton.tsx +198 -288
  16. package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +208 -73
  17. package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +97 -43
  18. package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +4 -2
  19. package/src/CometChatMessageList/CometChatMessageList.tsx +200 -76
  20. package/src/CometChatMessageList/style.ts +4 -4
  21. package/src/CometChatThreadHeader/CometChatThreadHeader.tsx +77 -11
  22. package/src/CometChatThreadHeader/style.ts +2 -2
  23. package/src/CometChatUsers/CometChatUsers.tsx +203 -51
  24. package/src/CometChatUsers/Skeleton.tsx +174 -159
  25. package/src/CometChatUsers/style.ts +21 -18
  26. package/src/calls/CallingConfiguration.ts +4 -3
  27. package/src/calls/CallingExtensionDecorator.tsx +5 -3
  28. package/src/calls/CometChatCallButtons/CometChatCallButtonConfiguration.ts +4 -2
  29. package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +10 -8
  30. package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +240 -97
  31. package/src/calls/CometChatCallLogs/Skeleton.tsx +175 -91
  32. package/src/calls/CometChatCallLogs/index.ts +1 -0
  33. package/src/calls/CometChatCallLogs/style.ts +85 -43
  34. package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +42 -29
  35. package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +36 -10
  36. package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +39 -12
  37. package/src/extensions/MessageTranslation/MessageTranslationDecorator.tsx +5 -4
  38. package/src/extensions/Polls/PollsDecorator.tsx +30 -9
  39. package/src/extensions/Stickers/StickersExtensionDecorator.tsx +34 -16
  40. package/src/index.ts +3 -1
  41. package/src/shared/base/Types.ts +31 -1
  42. package/src/shared/framework/DataSource.ts +64 -20
  43. package/src/shared/framework/DataSourceDecorator.tsx +46 -37
  44. package/src/shared/framework/MessageDataSource.tsx +518 -316
  45. package/src/shared/index.ts +3 -1
  46. package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +3 -2
  47. package/src/shared/resources/CometChatLocalize/resources/de/translation.json +3 -2
  48. package/src/shared/resources/CometChatLocalize/resources/en/translation.json +3 -2
  49. package/src/shared/resources/CometChatLocalize/resources/es/translation.json +3 -2
  50. package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +3 -2
  51. package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +3 -2
  52. package/src/shared/resources/CometChatLocalize/resources/hu/translation.json +3 -2
  53. package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +3 -2
  54. package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +3 -2
  55. package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +3 -2
  56. package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +3 -2
  57. package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +3 -2
  58. package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +3 -2
  59. package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +3 -2
  60. package/src/shared/utils/MessageUtils.tsx +41 -20
  61. package/src/shared/utils/conversationUtils.ts +2 -2
  62. package/src/shared/views/CometChatAvatar/CometChatAvatar.tsx +22 -1
  63. package/src/shared/views/CometChatBadge/CometChatBadge.tsx +20 -8
  64. package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +177 -123
  65. package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +76 -10
  66. package/src/shared/views/CometChatConfirmDialog/style.ts +2 -2
  67. package/src/shared/views/CometChatDate/CometChatDate.tsx +26 -18
  68. package/src/shared/views/CometChatDateSeperator/CometChatDateSeparator.tsx +22 -16
  69. package/src/shared/views/CometChatDeletedBubble/CometChatDeletedBubble.tsx +17 -5
  70. package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +65 -35
  71. package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +22 -11
  72. package/src/shared/views/CometChatImageBubble/CometChatImageLoader.tsx +47 -18
  73. package/src/shared/views/CometChatList/CometChatList.tsx +70 -46
  74. package/src/shared/views/CometChatList/Header.tsx +122 -37
  75. package/src/shared/views/CometChatList/styles.ts +1 -0
  76. package/src/shared/views/CometChatListItem/CometChatListItem.tsx +116 -30
  77. package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +52 -30
  78. package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +36 -22
  79. package/src/shared/views/CometChatQuickReactions/CometChatQuickReactions.tsx +41 -13
  80. package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +132 -17
  81. package/src/shared/views/CometChatReactions/CometChatReactions.tsx +30 -2
  82. package/src/shared/views/CometChatReceipt/CometChatReceipt.tsx +10 -6
  83. package/src/shared/views/CometChatStatusIndicator/CometChatStatusIndicator.tsx +20 -13
  84. package/src/shared/views/CometChatStatusIndicator/styles.ts +26 -13
  85. package/src/shared/views/CometChatSuggestionList/CometChatSuggestionList.tsx +25 -2
  86. package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +94 -14
  87. package/src/shared/views/CometChatTooltipMenu/CometChatTooltipMenu.tsx +52 -16
  88. package/src/shared/views/CometChatTooltipMenu/index.ts +2 -1
  89. package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +29 -9
  90. package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +20 -2
  91. package/src/shared/views/ErrorEmptyView/ErrorEmptyView.tsx +29 -14
  92. package/src/shared/views/index.ts +2 -0
  93. package/src/theme/default/index.ts +5 -5
  94. package/src/theme/type.ts +2 -2
  95. package/src/shared/views/CometChatPanel/CometChatPanel.tsx +0 -57
  96. package/src/shared/views/CometChatPanel/PanelStyle.tsx +0 -43
  97. package/src/shared/views/CometChatPanel/resources/CloseIcon.png +0 -0
  98. package/src/shared/views/CometChatPanel/resources/index.ts +0 -3
@@ -1,4 +1,10 @@
1
- import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
1
+ import React, {
2
+ forwardRef,
3
+ useEffect,
4
+ useImperativeHandle,
5
+ useRef,
6
+ useState,
7
+ } from "react";
2
8
  import {
3
9
  Animated,
4
10
  BackHandler,
@@ -13,12 +19,33 @@ import {
13
19
  } from "react-native";
14
20
  import { useTheme } from "../../../theme";
15
21
 
22
+ /**
23
+ * Props for the CometChatBottomSheet component.
24
+ */
16
25
  export interface CometChatBottomSheetInterface {
26
+ /**
27
+ * Content to be rendered inside the bottom sheet.
28
+ */
17
29
  children?: any;
30
+ /**
31
+ * Determines whether the bottom sheet is open.
32
+ */
18
33
  isOpen?: boolean;
34
+ /**
35
+ * Callback function invoked when the bottom sheet is opened.
36
+ */
19
37
  onOpen?: Function;
38
+ /**
39
+ * Callback function invoked when the bottom sheet is requested to close.
40
+ */
20
41
  onClose?: Function;
21
- onDismiss?:()=> void; //iOS SPECIFIC
42
+ /**
43
+ * iOS specific callback invoked when the modal is dismissed.
44
+ */
45
+ onDismiss?: () => void; //iOS
46
+ /**
47
+ * Custom styles for the bottom sheet.
48
+ */
22
49
  style?: {
23
50
  shadowColor?: string;
24
51
  backgroundColor?: string;
@@ -30,139 +57,166 @@ export interface CometChatBottomSheetInterface {
30
57
  maxHeight?: DimensionValue;
31
58
  minHeight?: DimensionValue;
32
59
  };
60
+ /**
61
+ * Enables scrolling for the bottom sheet content.
62
+ */
33
63
  scrollEnabled?: boolean;
34
- /**When rendering FlatList, pass this as true to enable {height: 100%}**/
64
+ /**
65
+ * When rendering a FlatList, pass this as true to enable {height: 100%}.
66
+ */
35
67
  doNotOccupyEntireHeight?: boolean;
36
68
  }
37
69
 
38
- const CometChatBottomSheet = forwardRef((props: CometChatBottomSheetInterface, ref) => {
39
- const theme = useTheme();
40
- const {
41
- style = {
42
- maxHeight: Dimensions.get("screen").height * 0.9,
43
- minHeight: 50,
44
- },
45
- children = <View />,
46
- isOpen = true,
47
- onClose = null,
48
- scrollEnabled = false,
49
- doNotOccupyEntireHeight = false,
50
- onDismiss,
51
- } = props;
70
+ /**
71
+ * CometChatBottomSheet is a component that renders a modal bottom sheet.
72
+ * It provides a customizable bottom sheet with overlay fade effect and keyboard handling.
73
+ *
74
+ * @param {CometChatBottomSheetInterface} props - Props for the bottom sheet component.
75
+ * @param {React.Ref<any>} ref - Reference object to expose component methods.
76
+ * @returns {JSX.Element} The rendered modal bottom sheet.
77
+ */
78
+ const CometChatBottomSheet = forwardRef(
79
+ (props: CometChatBottomSheetInterface, ref) => {
80
+ const theme = useTheme();
81
+ const {
82
+ style = {
83
+ maxHeight: Dimensions.get("screen").height * 0.9,
84
+ minHeight: 50,
85
+ },
86
+ children = <View />,
87
+ isOpen = true,
88
+ onClose = null,
89
+ scrollEnabled = false,
90
+ doNotOccupyEntireHeight = false,
91
+ onDismiss,
92
+ } = props;
52
93
 
53
- // Animated value for overlay fade
54
- const overlayAnim = useRef(new Animated.Value(0)).current;
55
- const [isModalOpen, setIsModalOpen] = useState(isOpen);
94
+ // Animated value for overlay fade
95
+ const overlayAnim = useRef(new Animated.Value(0)).current;
96
+ const [isModalOpen, setIsModalOpen] = useState(isOpen);
56
97
 
57
- useEffect(() => {
58
- setIsModalOpen(isOpen);
59
- }, [isOpen]);
98
+ useEffect(() => {
99
+ setIsModalOpen(isOpen);
100
+ }, [isOpen]);
60
101
 
61
- // Fade in/out the overlay when isOpen changes
62
- useEffect(() => {
63
- if (isOpen) {
64
- // Fade from 0 -> 0.5
65
- Animated.timing(overlayAnim, {
66
- toValue: 0.3,
67
- duration: 100,
68
- easing: Easing.ease,
69
- useNativeDriver: false,
70
- }).start();
71
- } else {
72
- // Immediately reset to 0 if closed
73
- overlayAnim.setValue(0);
74
- }
75
- }, [isOpen, overlayAnim]);
102
+ // Fade in/out the overlay when isOpen changes
103
+ useEffect(() => {
104
+ if (isOpen) {
105
+ // Fade from 0 -> 0.3 over 100ms
106
+ Animated.timing(overlayAnim, {
107
+ toValue: 0.3,
108
+ duration: 100,
109
+ easing: Easing.ease,
110
+ useNativeDriver: false,
111
+ }).start();
112
+ } else {
113
+ // Immediately reset to 0 if closed
114
+ overlayAnim.setValue(0);
115
+ }
116
+ }, [isOpen, overlayAnim]);
76
117
 
77
- const togglePanel = () => {
78
- onClose();
79
- };
80
-
81
- const onBackPress = () => {
82
- if (isOpen) {
83
- togglePanel();
84
- return true; // prevent default back behavior
85
- }
86
- return false;
87
- };
88
-
89
- useEffect(() => {
90
- const backHandler = BackHandler.addEventListener("hardwareBackPress", onBackPress);
91
-
92
- return () => {
93
- backHandler.remove();
118
+ /**
119
+ * Toggles the bottom sheet panel by invoking the onClose callback.
120
+ */
121
+ const togglePanel = () => {
122
+ onClose && onClose();
94
123
  };
95
- }, [onBackPress]);
96
124
 
97
- useImperativeHandle(ref, () => {
98
- return {
99
- togglePanel,
125
+ /**
126
+ * Handles the hardware back button press.
127
+ * Closes the bottom sheet if it is open.
128
+ *
129
+ * @returns True if the back press is handled.
130
+ */
131
+ const onBackPress = () => {
132
+ if (isOpen) {
133
+ togglePanel();
134
+ return true; // Prevent default back behavior
135
+ }
136
+ return false;
100
137
  };
101
- });
102
138
 
103
- return (
104
- <Modal
105
- animationType='fade'
106
- transparent={true}
107
- hardwareAccelerated={true}
108
- visible={isModalOpen}
109
- onRequestClose={togglePanel}
110
- onDismiss={onDismiss}
111
- >
112
- {/* Animated overlay that fades in from transparent to rgba(0,0,0,0.5) */}
113
- <Animated.View
114
- style={{
115
- flex: 1,
116
- backgroundColor: overlayAnim.interpolate({
117
- inputRange: [0, 0.2],
118
- outputRange: ["rgba(0,0,0,0)", "rgba(0,0,0,0.2)"],
119
- }),
120
- }}
121
- onStartShouldSetResponder={() => {
122
- togglePanel();
123
- return true;
124
- }}
125
- />
139
+ useEffect(() => {
140
+ const backHandler = BackHandler.addEventListener(
141
+ "hardwareBackPress",
142
+ onBackPress
143
+ );
144
+
145
+ return () => {
146
+ backHandler.remove();
147
+ };
148
+ }, [onBackPress]);
126
149
 
127
- {/* Bottom sheet content */}
128
- <KeyboardAvoidingView
129
- behavior={Platform.OS === "ios" ? "padding" : "height"}
130
- enabled={Platform.OS === "ios" ? true : false}
131
- style={{
132
- backgroundColor: theme.color.background1,
133
- paddingTop: 25,
134
- position: "absolute",
135
- bottom: 0,
136
- left: 0,
137
- right: 0,
138
- borderTopLeftRadius: 24,
139
- borderTopRightRadius: 24,
140
- shadowOffset: { width: 0, height: 6 },
141
- shadowOpacity: 0.37,
142
- shadowRadius: 7.49,
143
- elevation: 12,
144
- paddingHorizontal: 5,
145
- maxHeight: style.maxHeight,
146
- minHeight: style.minHeight,
147
- ...(doNotOccupyEntireHeight ? {} : { height: "100%" }),
148
- }}
150
+ useImperativeHandle(ref, () => {
151
+ return {
152
+ togglePanel,
153
+ };
154
+ });
155
+
156
+ return (
157
+ <Modal
158
+ animationType="fade"
159
+ transparent={true}
160
+ hardwareAccelerated={true}
161
+ visible={isModalOpen}
162
+ onRequestClose={togglePanel}
163
+ onDismiss={onDismiss}
149
164
  >
150
- {scrollEnabled ? (
151
- <ScrollView
152
- scrollEnabled={scrollEnabled}
153
- keyboardShouldPersistTaps='always'
154
- style={{ flex: 1 }}
155
- >
156
- {typeof children === "function" ? children() : children}
157
- </ScrollView>
158
- ) : typeof children === "function" ? (
159
- children()
160
- ) : (
161
- children
162
- )}
163
- </KeyboardAvoidingView>
164
- </Modal>
165
- );
166
- });
165
+ {/* Animated overlay that fades in from transparent to a semi-transparent black */}
166
+ <Animated.View
167
+ style={{
168
+ flex: 1,
169
+ backgroundColor: overlayAnim.interpolate({
170
+ inputRange: [0, 0.2],
171
+ outputRange: ["rgba(0,0,0,0)", "rgba(0,0,0,0.2)"],
172
+ }),
173
+ }}
174
+ onStartShouldSetResponder={() => {
175
+ togglePanel();
176
+ return true;
177
+ }}
178
+ />
179
+
180
+ {/* Bottom sheet content */}
181
+ <KeyboardAvoidingView
182
+ behavior={Platform.OS === "ios" ? "padding" : "height"}
183
+ enabled={Platform.OS === "ios"}
184
+ style={{
185
+ backgroundColor: theme.color.background1,
186
+ paddingTop: 25,
187
+ position: "absolute",
188
+ bottom: 0,
189
+ left: 0,
190
+ right: 0,
191
+ borderTopLeftRadius: 24,
192
+ borderTopRightRadius: 24,
193
+ shadowOffset: { width: 0, height: 6 },
194
+ shadowOpacity: 0.37,
195
+ shadowRadius: 7.49,
196
+ elevation: 12,
197
+ paddingHorizontal: 5,
198
+ maxHeight: style.maxHeight,
199
+ minHeight: style.minHeight,
200
+ ...(doNotOccupyEntireHeight ? {} : { height: "100%" }),
201
+ }}
202
+ >
203
+ {scrollEnabled ? (
204
+ <ScrollView
205
+ scrollEnabled={scrollEnabled}
206
+ keyboardShouldPersistTaps="always"
207
+ style={{ flex: 1 }}
208
+ >
209
+ {typeof children === "function" ? children() : children}
210
+ </ScrollView>
211
+ ) : typeof children === "function" ? (
212
+ children()
213
+ ) : (
214
+ children
215
+ )}
216
+ </KeyboardAvoidingView>
217
+ </Modal>
218
+ );
219
+ }
220
+ );
167
221
 
168
- export { CometChatBottomSheet };
222
+ export { CometChatBottomSheet };
@@ -15,27 +15,91 @@ import {
15
15
  import { useTheme } from "../../../theme";
16
16
  import { Icon } from "../../icons/Icon";
17
17
 
18
+ /**
19
+ * Props for the CometChatConfirmDialog component.
20
+ */
18
21
  export interface CometChatConfirmDialogInterface {
22
+ /**
23
+ * Callback invoked when the confirm action is triggered.
24
+ */
19
25
  onConfirm?: () => void;
26
+ /**
27
+ * Callback invoked when the cancel action is triggered.
28
+ */
20
29
  onCancel?: () => void;
21
- onDismiss?:() => void;
30
+ /**
31
+ * Callback invoked when the dialog is dismissed (iOS specific).
32
+ */
33
+ onDismiss?: () => void;
34
+ /**
35
+ * Flag to determine if the dialog is visible.
36
+ */
22
37
  isOpen?: boolean;
38
+ /**
39
+ * Custom style for the container view.
40
+ */
23
41
  containerStyle?: StyleProp<ViewStyle>;
42
+ /**
43
+ * Icon to be displayed. Can be an image source or a JSX element.
44
+ */
24
45
  icon?: ImageSourcePropType | JSX.Element;
46
+ /**
47
+ * Custom style for the icon image.
48
+ */
25
49
  iconImageStyle?: StyleProp<ImageStyle>;
50
+ /**
51
+ * Custom style for the icon container.
52
+ */
26
53
  iconContainerStyle?: StyleProp<ViewStyle>;
54
+ /**
55
+ * Custom style for the title text.
56
+ */
27
57
  titleTextStyle?: StyleProp<TextStyle>;
58
+ /**
59
+ * Custom style for the message text.
60
+ */
28
61
  messageTextStyle?: StyleProp<TextStyle>;
62
+ /**
63
+ * Custom style for the cancel button container.
64
+ */
29
65
  cancelButtonStyle?: StyleProp<ViewStyle>;
66
+ /**
67
+ * Custom style for the confirm button container.
68
+ */
30
69
  confirmButtonStyle?: StyleProp<ViewStyle>;
70
+ /**
71
+ * Custom style for the cancel button text.
72
+ */
31
73
  cancelButtonTextStyle?: StyleProp<TextStyle>;
74
+ /**
75
+ * Custom style for the confirm button text.
76
+ */
32
77
  confirmButtonTextStyle?: StyleProp<TextStyle>;
33
-
78
+ /**
79
+ * The title text of the dialog.
80
+ */
34
81
  titleText?: string;
82
+ /**
83
+ * The message text of the dialog.
84
+ */
35
85
  messageText?: string;
86
+ /**
87
+ * The text to display on the cancel button.
88
+ */
36
89
  cancelButtonText?: string;
90
+ /**
91
+ * The text to display on the confirm button.
92
+ */
37
93
  confirmButtonText?: string;
38
94
  }
95
+
96
+ /**
97
+ * CometChatConfirmDialog is a modal dialog component that displays a confirmation prompt.
98
+ * It is typically used to confirm actions such as deletion.
99
+ *
100
+ * Props for the confirm dialog component.
101
+ * The rendered confirmation dialog.
102
+ */
39
103
  export const CometChatConfirmDialog = (props: CometChatConfirmDialogInterface) => {
40
104
  const {
41
105
  onConfirm,
@@ -61,7 +125,13 @@ export const CometChatConfirmDialog = (props: CometChatConfirmDialogInterface) =
61
125
  const theme = useTheme();
62
126
 
63
127
  return (
64
- <Modal animationType='fade' transparent={true} visible={isOpen} onRequestClose={onCancel} onDismiss={onDismiss}>
128
+ <Modal
129
+ animationType="fade"
130
+ transparent={true}
131
+ visible={isOpen}
132
+ onRequestClose={onCancel}
133
+ onDismiss={onDismiss}
134
+ >
65
135
  <Pressable onPress={onCancel} style={styles.wrapper}>
66
136
  <View style={[theme.confirmDialogStyles.containerStyle, containerStyle]}>
67
137
  {icon && (
@@ -90,9 +160,7 @@ export const CometChatConfirmDialog = (props: CometChatConfirmDialogInterface) =
90
160
  onCancel?.();
91
161
  }}
92
162
  >
93
- <Text
94
- style={[theme.confirmDialogStyles.cancelButtonTextStyle, cancelButtonTextStyle]}
95
- >
163
+ <Text style={[theme.confirmDialogStyles.cancelButtonTextStyle, cancelButtonTextStyle]}>
96
164
  {cancelButtonText}
97
165
  </Text>
98
166
  </TouchableOpacity>
@@ -103,9 +171,7 @@ export const CometChatConfirmDialog = (props: CometChatConfirmDialogInterface) =
103
171
  onConfirm?.();
104
172
  }}
105
173
  >
106
- <Text
107
- style={[theme.confirmDialogStyles.confirmButtonTextStyle, confirmButtonTextStyle]}
108
- >
174
+ <Text style={[theme.confirmDialogStyles.confirmButtonTextStyle, confirmButtonTextStyle]}>
109
175
  {confirmButtonText}
110
176
  </Text>
111
177
  </TouchableOpacity>
@@ -129,4 +195,4 @@ const styles = StyleSheet.create({
129
195
  width: "100%",
130
196
  gap: 8,
131
197
  },
132
- });
198
+ });
@@ -64,7 +64,7 @@ export const getConfirmDialogStyleLight = (
64
64
  },
65
65
  cancelButtonTextStyle: {
66
66
  color: color.textPrimary,
67
- textTransform: "uppercase",
67
+ //textTransform: "uppercase",
68
68
  ...typography.button.medium,
69
69
  },
70
70
  confirmButtonStyle: {
@@ -77,7 +77,7 @@ export const getConfirmDialogStyleLight = (
77
77
  },
78
78
  confirmButtonTextStyle: {
79
79
  color: color.primaryButtonIcon,
80
- textTransform: "uppercase",
80
+ //textTransform: "uppercase",
81
81
  ...typography.button.medium,
82
82
  },
83
83
  });
@@ -8,40 +8,46 @@ import { ValueOf } from "../../helper/types";
8
8
  import { DateStyle } from "./styles";
9
9
 
10
10
  /**
11
- * CometChatDate is a component useful for displaying date/time
12
- * This component displays the date/time based on pattern parameter.
13
- *
14
- * @Version 1.0.0
15
- * @author CometChat
16
- *
11
+ * Props for the CometChatDate component.
17
12
  */
18
-
19
13
  export interface CometChatDateInterface {
20
14
  /**
21
- * Unix epoch time.
15
+ * Unix epoch time to be formatted and displayed.
22
16
  */
23
- timeStamp: number;
17
+ timeStamp?: number;
24
18
  /**
25
- * Pattern for Date.
26
- * one of
27
- * 1. timeFormat: "hh:mm a".
28
- * 2. dayDateFormat: Today, Yesterday, week-day or "d MMM, yyyy".
29
- * 3. dayWeekDayDateTimeFormat: Today, Yesterday, week-day or "dd/mm/yyyy".
19
+ * Pattern for formatting the date.
20
+ * One of the following values:
21
+ * - timeFormat: "hh:mm a".
22
+ * - dayDateFormat: Today, Yesterday, week-day or "d MMM, yyyy".
23
+ * - dayWeekDayDateTimeFormat: Today, Yesterday, week-day or "dd/mm/yyyy".
30
24
  */
31
25
  pattern?: ValueOf<typeof DateHelper.patterns>;
32
26
  /**
33
- * A string for custom date reprasentation.
27
+ * A custom date string to override the formatted date.
34
28
  */
35
29
  customDateString?: string;
36
-
30
+ /**
31
+ * Custom styles for the date component.
32
+ */
37
33
  style?: DateStyle;
38
34
  }
39
35
 
36
+ /**
37
+ * CometChatDate is a component for displaying a formatted date/time.
38
+ *
39
+ * If a customDateString is provided, it will be displayed instead of the formatted date.
40
+ * Otherwise, the component formats the provided timeStamp using the given pattern.
41
+ *
42
+ * - Props for the component.
43
+ * The rendered date view.
44
+ */
40
45
  export const CometChatDate = (props: CometChatDateInterface) => {
41
46
  const { timeStamp, pattern, customDateString, style = {} } = props;
42
47
  const theme = useTheme();
43
48
  const compTheme = useCompTheme();
44
49
 
50
+ // Merge theme date styles with component date styles and any custom style overrides.
45
51
  const dateStyles = useMemo(() => {
46
52
  return deepMerge(theme.dateStyles, compTheme.dateStyles ?? {}, style);
47
53
  }, [theme.dateStyles, style, compTheme.dateStyles]);
@@ -49,9 +55,11 @@ export const CometChatDate = (props: CometChatDateInterface) => {
49
55
  return (
50
56
  <View style={[dateStyles.containerStyle]}>
51
57
  <Text style={[dateStyles.textStyle]} numberOfLines={1}>
52
- {customDateString
58
+ {timeStamp
53
59
  ? customDateString
54
- : pattern && dateHelperInstance.getFormattedDate(timeStamp, pattern)}
60
+ ? customDateString
61
+ : pattern && dateHelperInstance.getFormattedDate(timeStamp, pattern)
62
+ : ""}
55
63
  </Text>
56
64
  </View>
57
65
  );
@@ -6,32 +6,38 @@ import { ValueOf } from "../../helper/types";
6
6
  import { CometChatTheme } from "../../../theme/type";
7
7
 
8
8
  /**
9
- * CometChatDateSeparator is a component useful for displaying date/time
10
- * in between messages.
11
- *
12
- * @Version 1.0.0
13
- * @author CometChat
14
- *
9
+ * Props for the CometChatDateSeparator component.
15
10
  */
16
-
17
11
  export interface CometChatDateSeparatorInterface {
12
+ /**
13
+ * Unix epoch time used to display the date.
14
+ */
18
15
  timeStamp: number;
19
16
  /**
20
- * Pattern for Date.
21
- * one of
22
- * 1. timeFormat: "hh:mm a".
23
- * 2. dayDateFormat: Today, Yesterday, or "d MMM, yyyy".
24
- * 3. dayWeekDayDateTimeFormat: Today(time), weekday, Yesterday, or "dd/mm/yyyy".
17
+ * Pattern for formatting the date.
18
+ * One of the following values:
19
+ * - timeFormat: "hh:mm a"
20
+ * - dayDateFormat: Today, Yesterday, or "d MMM, yyyy"
21
+ * - dayWeekDayDateTimeFormat: Today (time), weekday, Yesterday, or "dd/mm/yyyy"
25
22
  */
26
23
  pattern: ValueOf<typeof DateHelper.patterns>;
27
24
  /**
28
- * A string for custom date reprasentation.
25
+ * Custom string to be displayed instead of the formatted date.
29
26
  */
30
27
  customDateString?: string;
31
-
32
- style?: CometChatTheme['dateSeparatorStyles'];
28
+ /**
29
+ * Custom styles for the date separator component.
30
+ */
31
+ style?: CometChatTheme["dateSeparatorStyles"];
33
32
  }
34
33
 
34
+ /**
35
+ * CometChatDateSeparator is a component that displays a formatted date/time separator
36
+ * between messages. If a custom date string is provided, it will be displayed instead.
37
+ *
38
+ * - Props for the component.
39
+ * The rendered date separator view.
40
+ */
35
41
  export const CometChatDateSeparator = (props: CometChatDateSeparatorInterface) => {
36
42
  const { timeStamp, pattern, customDateString, style } = props;
37
43
  const theme = useTheme();
@@ -45,4 +51,4 @@ export const CometChatDateSeparator = (props: CometChatDateSeparatorInterface) =
45
51
  </Text>
46
52
  </View>
47
53
  );
48
- };
54
+ };
@@ -1,4 +1,4 @@
1
- import React, { useEffect } from "react";
1
+ import React from "react";
2
2
  import { View } from "react-native";
3
3
  import { useTheme } from "../../../theme";
4
4
  import { Icon } from "../../icons/Icon";
@@ -6,15 +6,27 @@ import { localize } from "../../resources";
6
6
  import { CometChatTextBubbleText } from "../CometChatTextBubble/CometChatTextBubble";
7
7
  import { DeletedBubbleStyle } from "./styles";
8
8
 
9
+ /**
10
+ * Props for the CometChatDeletedBubble component.
11
+ */
9
12
  export interface CometChatDeletedBubbleInterface {
10
13
  /**
11
- * text tobe shown
14
+ * Text to be displayed in the deleted message bubble.
12
15
  */
13
16
  text?: string;
14
-
17
+ /**
18
+ * Custom styles for the deleted bubble.
19
+ */
15
20
  style?: Partial<DeletedBubbleStyle>;
16
21
  }
17
22
 
23
+ /**
24
+ * CometChatDeletedBubble is a component that displays a deleted message bubble.
25
+ * It shows an icon along with the provided text.
26
+ *
27
+ * - Props for the component.
28
+ * The rendered deleted message bubble.
29
+ */
18
30
  export const CometChatDeletedBubble = (props: CometChatDeletedBubbleInterface) => {
19
31
  const theme = useTheme();
20
32
  const { text = localize("DELETE_MSG_TEXT"), style = {} } = props;
@@ -28,7 +40,7 @@ export const CometChatDeletedBubble = (props: CometChatDeletedBubbleInterface) =
28
40
  }}
29
41
  >
30
42
  <Icon
31
- name='block'
43
+ name="block"
32
44
  icon={style?.icon}
33
45
  height={style?.iconStyle?.height ?? 16}
34
46
  width={style?.iconStyle?.width ?? 16}
@@ -39,4 +51,4 @@ export const CometChatDeletedBubble = (props: CometChatDeletedBubbleInterface) =
39
51
  <CometChatTextBubbleText text={text} textStyle={[style?.textStyle]} />
40
52
  </View>
41
53
  );
42
- };
54
+ };