@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,195 +1,210 @@
1
- import React, { useEffect, useRef } from "react";
1
+ import React, { useEffect, useMemo, useRef } from "react";
2
2
  import { Animated, Dimensions, Easing, ScrollView, StyleSheet, View } from "react-native";
3
3
  import Svg, { Circle, Defs, LinearGradient, Rect, Stop } from "react-native-svg";
4
4
  import { useTheme } from "../theme";
5
-
6
- const { width: screenWidth } = Dimensions.get("window");
7
-
8
- // Constants for dimensions
9
- const padding = 20;
10
- const listItemHeight = 25; // Increased from 15 to 25
11
- const listItemSpacing = 54; // Adjust if necessary
12
- const avatarRadius = 25; // Increased from 12 to 20
13
- const listItemCount = 14;
14
-
15
- const SkeletonItemBottom = () => {
16
- const theme = useTheme();
17
-
18
- // Calculate the total height needed for the SVG
19
- const totalHeight = padding + listItemCount * (listItemHeight + listItemSpacing);
20
-
21
- return (
22
- <Svg height={totalHeight} width={screenWidth} fill='none' preserveAspectRatio='xMidYMid meet'>
23
- {/* List Items */}
24
- {Array.from({ length: listItemCount }).map((_, index) => {
25
- const itemY = padding + index * (listItemHeight + listItemSpacing) - 20;
26
-
5
+ import type { ColorValue } from "react-native";
6
+ import { CometChatTheme } from "../theme/type";
7
+
8
+ /**
9
+ * Animated skeleton placeholder mimicking a *user list* in CometChat UI‑Kit.
10
+ *
11
+ * The component respects the defaults provided by `theme.userStyles.skeletonStyle`,
12
+ * but every visual property can be **overridden per instance** using the
13
+ * `style` prop.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * <Skeleton
18
+ * style={{
19
+ * linearGradientColors: ["#4c669f", "#3b5998"],
20
+ * shimmerOpacity: 0.4,
21
+ * }}
22
+ * />
23
+ * ```
24
+ */
25
+ export interface SkeletonProps {
26
+ /** Partial style overrides (theme fallback for omitted keys). */
27
+ style?: Partial<SkeletonStyle>;
28
+ }
29
+
30
+ /** Alias for the skeleton style slice inside the theme. */
31
+ type SkeletonStyle = CometChatTheme["userStyles"]["skeletonStyle"];
32
+
33
+ // ──────────────────────────────────────────────────────────────────────────────
34
+ // Utility helpers
35
+ // ──────────────────────────────────────────────────────────────────────────────
36
+
37
+ function getStyleValue<K extends keyof SkeletonStyle>(
38
+ key: K,
39
+ overrides: Partial<SkeletonStyle> | undefined,
40
+ theme: CometChatTheme
41
+ ): NonNullable<SkeletonStyle[K]> {
42
+ // Guaranteed fallback to theme defaults; cast is safe as UI‑Kit defines them.
43
+ return ((overrides?.[key] as SkeletonStyle[K]) ??
44
+ theme.userStyles.skeletonStyle[key]) as NonNullable<SkeletonStyle[K]>;
45
+ }
46
+
47
+ // ──────────────────────────────────────────────────────────────────────────────
48
+ // Layout constants – tweak here if the design changes
49
+ // ──────────────────────────────────────────────────────────────────────────────
50
+
51
+ const { width: SCREEN_WIDTH } = Dimensions.get("window");
52
+
53
+ const PADDING = 20;
54
+ const AVATAR_RADIUS = 25;
55
+ const LIST_ITEM_HEIGHT = 25;
56
+ const LIST_ITEM_SPACING = 54; // gap between items (includes avatar & text)
57
+ const LIST_ITEM_COUNT = 14;
58
+
59
+ /** Total height required for the SVG canvas */
60
+ const TOTAL_HEIGHT = PADDING + LIST_ITEM_COUNT * (LIST_ITEM_HEIGHT + LIST_ITEM_SPACING);
61
+
62
+ // ──────────────────────────────────────────────────────────────────────────────
63
+ // SVG rows factory (memoized for perf)
64
+ // ──────────────────────────────────────────────────────────────────────────────
65
+
66
+ const useRows = (fill: ColorValue) =>
67
+ useMemo(
68
+ () =>
69
+ Array.from({ length: LIST_ITEM_COUNT }).map((_, index) => {
70
+ const y = PADDING + index * (LIST_ITEM_HEIGHT + LIST_ITEM_SPACING) - 20;
27
71
  return (
72
+ // eslint-disable-next-line react/no-array-index-key
28
73
  <React.Fragment key={index}>
29
- {/* Avatar Circle */}
30
74
  <Circle
31
- cx={padding + avatarRadius}
32
- cy={itemY + avatarRadius}
33
- r={avatarRadius}
34
- fill='url(#paint0_linear)'
75
+ cx={PADDING + AVATAR_RADIUS}
76
+ cy={y + AVATAR_RADIUS}
77
+ r={AVATAR_RADIUS}
78
+ fill={fill as string}
35
79
  />
36
-
37
- {/* Username Rectangle */}
38
80
  <Rect
39
- x={padding + 2 * avatarRadius + 12} // 12 units spacing after avatar
40
- y={itemY + 12}
41
- width={screenWidth - (padding + 2 * avatarRadius + 12 + padding)}
42
- height={listItemHeight}
43
- rx={listItemHeight / 2} // Rounded corners matching height
44
- fill='url(#paint0_linear)'
81
+ x={PADDING + AVATAR_RADIUS * 2 + 12}
82
+ y={y + 12}
83
+ width={SCREEN_WIDTH - (PADDING + AVATAR_RADIUS * 2 + 12 + PADDING)}
84
+ height={LIST_ITEM_HEIGHT}
85
+ rx={LIST_ITEM_HEIGHT / 2}
86
+ fill={fill as string}
45
87
  />
46
88
  </React.Fragment>
47
89
  );
48
- })}
49
-
50
- {/* Gradient Definition */}
51
- <Defs>
52
- <LinearGradient
53
- id='paint0_linear'
54
- x1='0'
55
- y1='0'
56
- x2={screenWidth}
57
- y2='0'
58
- gradientUnits='userSpaceOnUse'
59
- >
60
- <Stop stopColor={theme.userStyles.skeletonStyle.linearGradientColors[0]} />
61
- <Stop offset='1' stopColor={theme.userStyles.skeletonStyle.linearGradientColors[1]} />
62
- </LinearGradient>
63
- </Defs>
64
- </Svg>
90
+ }),
91
+ [fill]
65
92
  );
66
- };
67
-
68
- const SkeletonItemTop = () => {
69
- const theme = useTheme();
70
-
71
- // Calculate the total height needed for the SVG
72
- const totalHeight = padding + listItemCount * (listItemHeight + listItemSpacing);
73
-
74
- return (
75
- <Svg height={totalHeight} width={screenWidth} fill='none' preserveAspectRatio='xMidYMid meet'>
76
- {/* List Items */}
77
- {Array.from({ length: listItemCount }).map((_, index) => {
78
- const itemY = padding + index * (listItemHeight + listItemSpacing) - 20;
79
-
80
- return (
81
- <React.Fragment key={index}>
82
- {/* Avatar Circle */}
83
- <Circle
84
- cx={padding + avatarRadius}
85
- cy={itemY + avatarRadius}
86
- r={avatarRadius}
87
- fill={theme.userStyles.skeletonStyle.backgroundColor}
88
- />
89
93
 
90
- {/* Username Rectangle */}
91
- <Rect
92
- x={padding + 2 * avatarRadius + 12} // 12 units spacing after avatar
93
- y={itemY + 12}
94
- width={screenWidth - (padding + 2 * avatarRadius + 12 + padding)}
95
- height={listItemHeight}
96
- rx={listItemHeight / 2} // Rounded corners matching height
97
- fill={theme.userStyles.skeletonStyle.backgroundColor}
98
- />
99
- </React.Fragment>
100
- );
101
- })}
102
- </Svg>
103
- );
104
- };
94
+ // ──────────────────────────────────────────────────────────────────────────────
95
+ // Component Implementation
96
+ // ──────────────────────────────────────────────────────────────────────────────
105
97
 
106
- export const Skeleton = () => {
98
+ export const Skeleton: React.FC<SkeletonProps> = ({ style }) => {
107
99
  const theme = useTheme();
108
- const animatedValue = useRef(new Animated.Value(0)).current;
100
+ const get = <K extends keyof SkeletonStyle>(key: K) => getStyleValue(key, style, theme);
101
+
102
+ // Shimmer animation ------------------------------------------
103
+ const translate = useRef(new Animated.Value(0)).current;
109
104
 
110
105
  useEffect(() => {
111
- const startShimmer = () => {
112
- animatedValue.setValue(0);
113
- Animated.loop(
114
- Animated.timing(animatedValue, {
115
- toValue: 1,
116
- duration: (1 / theme.userStyles.skeletonStyle.speed) * 1000,
117
- easing: Easing.linear,
118
- useNativeDriver: false,
119
- })
120
- ).start();
121
- };
122
-
123
- startShimmer();
124
- }, [animatedValue, theme.userStyles.skeletonStyle.speed]);
125
-
126
- const shimmerTranslateX = animatedValue.interpolate({
106
+ const speed = get("speed");
107
+ const duration = 1000 / speed;
108
+ const loop = Animated.loop(
109
+ Animated.timing(translate, {
110
+ toValue: 1,
111
+ duration,
112
+ easing: Easing.linear,
113
+ useNativeDriver: false, // SVG not yet compatible with native driver
114
+ })
115
+ );
116
+
117
+ loop.start();
118
+ return () => loop.stop();
119
+ }, [get("speed"), translate]);
120
+
121
+ const translateX = translate.interpolate({
127
122
  inputRange: [0, 1],
128
- outputRange: [-screenWidth * 2, screenWidth],
123
+ outputRange: [-SCREEN_WIDTH * 2, SCREEN_WIDTH],
129
124
  });
130
125
 
126
+ // Pre‑build row shapes (bottom gradient + top mask)
127
+ const rowsGradient = useRows("url(#gradient)");
128
+ const rowsSolid = useRows(String(get("backgroundColor")));
129
+
131
130
  return (
132
131
  <ScrollView
133
132
  scrollEnabled={false}
134
133
  showsVerticalScrollIndicator={false}
135
- style={{ backgroundColor: theme.userStyles.containerStyle.backgroundColor }}
134
+ style={{ backgroundColor: get("containerBackgroundColor") }}
136
135
  >
137
- <SkeletonItemBottom />
138
- <Animated.View
139
- style={[
140
- {
141
- transform: [
142
- { translateX: shimmerTranslateX },
143
- { translateY: -20 },
144
- { rotate: "15deg" },
145
- ],
146
- },
147
- styles.animatedView,
148
- {
149
- backgroundColor: theme.userStyles.skeletonStyle.shimmerBackgroundColor,
150
- opacity: theme.userStyles.skeletonStyle.shimmerOpacity,
151
- },
152
- ]}
153
- />
154
- <Animated.View
155
- style={[
156
- {
157
- transform: [
158
- {
159
- translateX: Animated.add(shimmerTranslateX, screenWidth / 2),
160
- },
161
- { translateY: -20 },
162
- { rotate: "15deg" },
163
- ],
164
- },
165
- styles.animatedView,
166
- {
167
- backgroundColor: theme.userStyles.skeletonStyle.shimmerBackgroundColor,
168
- opacity: theme.userStyles.skeletonStyle.shimmerOpacity,
169
- },
170
- ]}
171
- />
172
- <View
173
- style={{
174
- position: "absolute",
175
- top: 0,
176
- left: 0,
177
- right: 0,
178
- bottom: 0,
179
- }}
136
+ {/* Bottom layer (gradient fill) */}
137
+ <Svg
138
+ height={TOTAL_HEIGHT}
139
+ width={SCREEN_WIDTH}
140
+ fill='none'
141
+ preserveAspectRatio='xMidYMid meet'
180
142
  >
181
- <SkeletonItemTop />
143
+ <Defs>
144
+ <LinearGradient
145
+ id='gradient'
146
+ x1='0'
147
+ y1='0'
148
+ x2={SCREEN_WIDTH}
149
+ y2='0'
150
+ gradientUnits='userSpaceOnUse'
151
+ >
152
+ {(() => {
153
+ const colors = get("linearGradientColors");
154
+ return [
155
+ <Stop key={0} stopColor={colors[0]} />,
156
+ <Stop key={1} offset='1' stopColor={colors[1]} />,
157
+ ];
158
+ })()}
159
+ </LinearGradient>
160
+ </Defs>
161
+ {rowsGradient}
162
+ </Svg>
163
+
164
+ {/* Moving shimmer highlight (rendered twice for coverage) */}
165
+ {[0, SCREEN_WIDTH / 2].map((offset) => (
166
+ // eslint-disable-next-line react/no-array-index-key
167
+ <Animated.View
168
+ key={offset}
169
+ style={[
170
+ styles.shimmer,
171
+ {
172
+ transform: [
173
+ { translateX: Animated.add(translateX, offset) },
174
+ { translateY: -20 },
175
+ { rotate: "15deg" },
176
+ ],
177
+ backgroundColor: get("shimmerBackgroundColor"),
178
+ opacity: get("shimmerOpacity"),
179
+ },
180
+ ]}
181
+ />
182
+ ))}
183
+
184
+ {/* Top mask – solid shapes clip the shimmer to list items */}
185
+ <View style={StyleSheet.absoluteFill} pointerEvents='none'>
186
+ <Svg
187
+ height={TOTAL_HEIGHT}
188
+ width={SCREEN_WIDTH}
189
+ fill='none'
190
+ preserveAspectRatio='xMidYMid meet'
191
+ >
192
+ {rowsSolid}
193
+ </Svg>
182
194
  </View>
183
195
  </ScrollView>
184
196
  );
185
197
  };
186
198
 
199
+ // ──────────────────────────────────────────────────────────────────────────────
200
+ // Styles
201
+ // ──────────────────────────────────────────────────────────────────────────────
202
+
187
203
  const styles = StyleSheet.create({
188
- animatedView: {
189
- width: "25%",
204
+ shimmer: {
205
+ position: "absolute",
206
+ width: "25%", // thin bar for highlight
190
207
  top: 0,
191
208
  bottom: 0,
192
- position: "absolute",
193
209
  },
194
210
  });
195
-
@@ -6,11 +6,12 @@ import { DeepPartial } from "../shared/helper/types";
6
6
 
7
7
  export type UserStyle = CometChatListStylesInterface & {
8
8
  skeletonStyle: {
9
- backgroundColor: ColorValue;
10
- linearGradientColors: [string, string];
11
- shimmerBackgroundColor: ColorValue;
12
- shimmerOpacity: number;
13
- speed: number;
9
+ backgroundColor?: ColorValue;
10
+ linearGradientColors?: [string, string];
11
+ shimmerBackgroundColor?: ColorValue;
12
+ shimmerOpacity?: number;
13
+ speed?: number;
14
+ containerBackgroundColor?: ColorValue;
14
15
  };
15
16
  headerContainerStyle: ViewStyle;
16
17
  };
@@ -63,14 +64,12 @@ export const getUserListStyleLight = (
63
64
  },
64
65
  headViewContainerStyle: {},
65
66
  titleSubtitleContainerStyle: {
66
- alignSelf: 'center'
67
+ alignSelf: "center",
67
68
  },
68
69
  trailingViewContainerStyle: {},
69
70
  },
70
- selectionIconStyle: {},
71
- selectionIcon: undefined,
72
- cancellationIcon: undefined,
73
- cancellationIconStyle: {},
71
+ confirmSelectionStyle: {},
72
+ selectionCancelStyle: undefined,
74
73
  loadingIconTint: color.primary,
75
74
  sectionHeaderTextStyle: {
76
75
  marginHorizontal: spacing.spacing.s5,
@@ -138,6 +137,13 @@ export const getUserListStyleLight = (
138
137
  },
139
138
  },
140
139
  errorStateStyle: {
140
+ containerStyle: {
141
+ flex: 1,
142
+ justifyContent: "center",
143
+ alignItems: "center",
144
+ paddingHorizontal: "10%",
145
+ flexDirection: "column",
146
+ },
141
147
  titleStyle: {
142
148
  color: color.textPrimary,
143
149
  ...typography.heading3.bold,
@@ -145,21 +151,17 @@ export const getUserListStyleLight = (
145
151
  },
146
152
  subTitleStyle: {
147
153
  color: color.textSecondary,
148
- textAlign: "center" as const,
154
+ textAlign: "center",
149
155
  ...typography.body.regular,
150
156
  },
151
- containerStyle: {
152
- justifyContent: "center",
153
- alignItems: "center",
154
- padding: spacing.padding.p3,
155
- },
156
157
  },
157
158
  skeletonStyle: {
158
- backgroundColor: color.background3,
159
+ backgroundColor: "transparent",
159
160
  linearGradientColors: ["#E8E8E8", "#F5F5F5"] as [string, string],
160
161
  shimmerBackgroundColor: color.staticBlack,
161
162
  shimmerOpacity: 0.01,
162
163
  speed: 1,
164
+ containerBackgroundColor: color.background1,
163
165
  },
164
166
  };
165
167
  };
@@ -171,11 +173,12 @@ export const getUserListStyleDark = (
171
173
  ): DeepPartial<UserStyle> => {
172
174
  return deepMerge(getUserListStyleLight(color, spacing, typography), {
173
175
  skeletonStyle: {
174
- backgroundColor: color.background3,
176
+ backgroundColor: "transparent",
175
177
  linearGradientColors: ["#383838", "#272727"] as [string, string],
176
178
  shimmerBackgroundColor: color.staticWhite,
177
179
  shimmerOpacity: 0.01,
178
180
  speed: 1,
181
+ containerBackgroundColor: color.background1,
179
182
  },
180
183
  });
181
184
  };
@@ -1,13 +1,14 @@
1
1
  import { CometChat } from "@cometchat/chat-sdk-react-native";
2
2
  import { CometChatCallButtonConfiguration } from "./CometChatCallButtons";
3
-
3
+ import { CallingPackage } from "./CallingPackage";
4
+ const CometChatCalls = CallingPackage.CometChatCalls;
4
5
  export class CallingConfiguration {
5
6
  callButtonsConfiguration?: CometChatCallButtonConfiguration;
6
7
  groupCallSettingsBuilder?: (
7
8
  user?: CometChat.User,
8
9
  group?: CometChat.Group,
9
10
  isAudioOnly?: boolean
10
- ) => CometChat.CallSettingsBuilder;
11
+ ) => typeof CometChatCalls.CallSettingsBuilder;
11
12
 
12
13
  constructor(params: {
13
14
  callButtonsConfiguration?: CometChatCallButtonConfiguration;
@@ -15,7 +16,7 @@ export class CallingConfiguration {
15
16
  user?: CometChat.User,
16
17
  group?: CometChat.Group,
17
18
  isAudioOnly?: boolean
18
- ) => CometChat.CallSettingsBuilder;
19
+ ) => typeof CometChatCalls.CallSettingsBuilder;
19
20
  }) {
20
21
  this.callButtonsConfiguration = params.callButtonsConfiguration;
21
22
  this.groupCallSettingsBuilder = params.groupCallSettingsBuilder;
@@ -2,7 +2,7 @@ import { CometChat } from "@cometchat/chat-sdk-react-native";
2
2
  import React from "react";
3
3
  import { Modal, View } from "react-native";
4
4
  import { ChatConfigurator, CometChatUIEventHandler, CometChatUIKit } from "../shared";
5
- import { AdditionalParams } from "../shared/base/Types";
5
+ import { AdditionalAuxiliaryHeaderOptionsParams, AdditionalParams } from "../shared/base/Types";
6
6
  import {
7
7
  CallContstatnts,
8
8
  MessageCategoryConstants,
@@ -333,7 +333,7 @@ export class CallingExtensionDecorator extends DataSourceDecorator {
333
333
  getAuxiliaryHeaderAppbarOptions(
334
334
  user?: CometChat.User,
335
335
  group?: CometChat.Group,
336
- additionalParams?: AdditionalParams
336
+ additionalAuxiliaryHeaderOptionsParams?: AdditionalAuxiliaryHeaderOptionsParams
337
337
  ) {
338
338
  // For one-to-one chats: if a user exists and is blocked, don't render the call buttons.
339
339
  if (user && !group && user.getBlockedByMe()) {
@@ -346,7 +346,9 @@ export class CallingExtensionDecorator extends DataSourceDecorator {
346
346
  user={user}
347
347
  group={group}
348
348
  {...this.configuration?.callButtonsConfiguration}
349
- style={additionalParams?.callButtonStyle}
349
+ style={additionalAuxiliaryHeaderOptionsParams?.callButtonStyle}
350
+ hideVoiceCallButton={additionalAuxiliaryHeaderOptionsParams?.hideVoiceCallButton}
351
+ hideVideoCallButton={additionalAuxiliaryHeaderOptionsParams?.hideVideoCallButton}
350
352
  />
351
353
  </View>
352
354
  );
@@ -1,12 +1,14 @@
1
1
  import { CometChat } from "@cometchat/chat-sdk-react-native";
2
2
  import { OutgoingCallConfiguration } from "../CometChatOutgoingCall";
3
+ import { CallingPackage } from "../CallingPackage";
4
+ const CometChatCalls = CallingPackage.CometChatCalls;
3
5
 
4
6
  export interface CometChatCallButtonConfigurationInterface {
5
7
  callSettingsBuilder?: (
6
8
  user?: CometChat.User,
7
9
  group?: CometChat.Group,
8
10
  isAudioOnly?: boolean
9
- ) => CometChat.CallSettingsBuilder;
11
+ ) => typeof CometChatCalls.CallSettingsBuilder;
10
12
  outgoingCallConfiguration?: OutgoingCallConfiguration;
11
13
  }
12
14
 
@@ -15,7 +17,7 @@ export class CometChatCallButtonConfiguration implements CometChatCallButtonConf
15
17
  user?: CometChat.User,
16
18
  group?: CometChat.Group,
17
19
  isAudioOnly?: boolean
18
- ) => CometChat.CallSettingsBuilder;
20
+ ) => typeof CometChatCalls.CallSettingsBuilder;
19
21
 
20
22
  constructor({ callSettingsBuilder }: CometChatCallButtonConfigurationInterface) {
21
23
  this.callSettingsBuilder = callSettingsBuilder;
@@ -22,6 +22,8 @@ import { CallUIEvents } from "../CallEvents";
22
22
  import { CometChatOutgoingCall, OutgoingCallConfiguration } from "../CometChatOutgoingCall";
23
23
  import { CallButtonStyle } from "./style";
24
24
  import { DeepPartial } from "../../shared/helper/types";
25
+ import { CallingPackage } from "../CallingPackage";
26
+ const CometChatCalls = CallingPackage.CometChatCalls;
25
27
 
26
28
  const listenerId = "callEventListener_" + new Date().getTime();
27
29
 
@@ -42,11 +44,11 @@ export interface CometChatCallButtonsInterface {
42
44
  /**
43
45
  * Should the voice call icon be shown.
44
46
  */
45
- hideVoiceCall?: boolean;
47
+ hideVoiceCallButton?: boolean;
46
48
  /**
47
49
  * Should the video call icon be shown.
48
50
  */
49
- hideVideoCall?: boolean;
51
+ hideVideoCallButton?: boolean;
50
52
  /**
51
53
  * Callback to handle errors.
52
54
  *
@@ -59,13 +61,13 @@ export interface CometChatCallButtonsInterface {
59
61
  * @param {CometChat.User} [user] - The user object.
60
62
  * @param {CometChat.Group} [group] - The group object.
61
63
  * @param {boolean} [isAudioOnly] - Flag indicating if the call is audio only.
62
- * @returns {CometChat.CallSettingsBuilder} The call settings builder.
64
+ * @returns {CometChatCalls.CallSettingsBuilder} The call settings builder.
63
65
  */
64
66
  callSettingsBuilder?: (
65
67
  user?: CometChat.User,
66
68
  group?: CometChat.Group,
67
69
  isAudioOnly?: boolean
68
- ) => CometChat.CallSettingsBuilder;
70
+ ) => typeof CometChatCalls.CallSettingsBuilder;
69
71
  /**
70
72
  * Configuration for outgoing calls.
71
73
  */
@@ -89,8 +91,8 @@ export const CometChatCallButtons = (props: CometChatCallButtonsInterface): JSX.
89
91
  const {
90
92
  user,
91
93
  group,
92
- hideVoiceCall = false,
93
- hideVideoCall = false,
94
+ hideVoiceCallButton = false,
95
+ hideVideoCallButton = false,
94
96
  onError,
95
97
  callSettingsBuilder,
96
98
  outgoingCallConfiguration,
@@ -292,7 +294,7 @@ export const CometChatCallButtons = (props: CometChatCallButtonsInterface): JSX.
292
294
 
293
295
  return (
294
296
  <View style={callButtonStyles.containerStyle as ViewStyle}>
295
- {!hideVoiceCall && (
297
+ {!hideVoiceCallButton && (
296
298
  <TouchableOpacity onPress={() => makeVoiceCall()}>
297
299
  <Icon
298
300
  name='call'
@@ -305,7 +307,7 @@ export const CometChatCallButtons = (props: CometChatCallButtonsInterface): JSX.
305
307
  />
306
308
  </TouchableOpacity>
307
309
  )}
308
- {!hideVideoCall && (
310
+ {!hideVideoCallButton && (
309
311
  <TouchableOpacity onPress={() => makeVideoCall()}>
310
312
  <Icon
311
313
  name='videocam'