@cometchat/chat-uikit-react-native 5.2.2 → 5.2.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.
- package/package.json +1 -1
- package/src/CometChatConversations/CometChatConversations.tsx +170 -91
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +312 -116
- package/src/CometChatMessageComposer/styles.tsx +2 -1
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +83 -17
- package/src/CometChatMessageList/CometChatMessageList.tsx +603 -65
- package/src/CometChatMessageList/style.ts +47 -2
- package/src/CometChatSearch/CometChatSearch.tsx +1718 -0
- package/src/CometChatSearch/SearchConstants.ts +46 -0
- package/src/CometChatSearch/Skeleton.tsx +192 -0
- package/src/CometChatSearch/index.ts +1 -0
- package/src/CometChatSearch/style.ts +414 -0
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +43 -7
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +45 -7
- package/src/extensions/Polls/Polls.tsx +36 -2
- package/src/extensions/Polls/PollsBubble.tsx +13 -9
- package/src/extensions/Polls/PollsDecorator.tsx +13 -1
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +50 -11
- package/src/extensions/Stickers/style.ts +0 -1
- package/src/index.ts +5 -0
- package/src/shared/base/Types.ts +8 -0
- package/src/shared/constants/UIKitConstants.ts +2 -0
- package/src/shared/events/CometChatMessageEvents/index.ts +8 -7
- package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +3 -0
- package/src/shared/events/CometChatUIEventHandler/Listener.ts +8 -0
- package/src/shared/events/ListenerInitializer.ts +3 -0
- package/src/shared/events/messages.ts +1 -0
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +158 -27
- package/src/shared/framework/DataSource.ts +7 -0
- package/src/shared/framework/DataSourceDecorator.tsx +12 -0
- package/src/shared/framework/MessageDataSource.tsx +182 -1
- package/src/shared/helper/functions.js +0 -67
- package/src/shared/helper/helperFunctions.ts +73 -0
- package/src/shared/icons/components/documents.tsx +23 -0
- package/src/shared/icons/components/empty-search.tsx +52 -0
- package/src/shared/icons/components/message-blocked.tsx +32 -0
- package/src/shared/icons/components/unread.tsx +29 -0
- package/src/shared/icons/icon-mapping.tsx +9 -0
- package/src/shared/index.ts +2 -1
- package/src/shared/modals/CometChatMessageTemplate.ts +23 -0
- package/src/shared/resources/CometChatLocalizeNew/CometChatLocalizationHelper.ts +4 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/de/translation.json +22 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/en/translation.json +75 -36
- package/src/shared/resources/CometChatLocalizeNew/resources/es/translation.json +65 -27
- package/src/shared/resources/CometChatLocalizeNew/resources/fr/translation.json +42 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/hi/translation.json +66 -27
- package/src/shared/resources/CometChatLocalizeNew/resources/hu/translation.json +42 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/it/translation.json +43 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/ja/translation.json +43 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/ko/translation.json +43 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/lt/translation.json +45 -7
- package/src/shared/resources/CometChatLocalizeNew/resources/ms/translation.json +42 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/nl/translation.json +43 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/pt/translation.json +42 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/ru/translation.json +42 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/sv/translation.json +43 -5
- package/src/shared/resources/CometChatLocalizeNew/resources/tr/translation.json +43 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/zh/translation.json +42 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/zh-tw/translation.json +45 -7
- package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.tsx +274 -23
- package/src/shared/utils/MessageReceiptUtils.ts +32 -0
- package/src/shared/utils/MessageUtils.tsx +106 -4
- package/src/shared/views/CometChatAudioBubble/style.ts +0 -2
- package/src/shared/views/CometChatFileBubble/style.ts +0 -4
- package/src/shared/views/CometChatImageBubble/CometChatImageLoader.tsx +1 -0
- package/src/shared/views/CometChatList/CometChatList.tsx +12 -0
- package/src/shared/views/CometChatList/Header.tsx +79 -49
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +14 -4
- package/src/shared/views/CometChatReportDialog/CometChatReportDialog.tsx +390 -0
- package/src/shared/views/CometChatReportDialog/index.ts +3 -0
- package/src/shared/views/CometChatReportDialog/style.ts +164 -0
- package/src/shared/views/CometChatStatusIndicator/private.png +0 -0
- package/src/shared/views/CometChatStatusIndicator/protected.png +0 -0
- package/src/shared/views/CometChatStatusIndicator/styles.ts +2 -2
- package/src/shared/views/CometChatSuggestionList/CometChatSuggestionList.tsx +18 -2
- package/src/shared/views/index.ts +6 -0
- package/src/theme/default/default.ts +3 -0
- package/src/theme/provider.tsx +7 -5
- package/src/theme/type.ts +21 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { StyleSheet, TextStyle, ViewStyle } from "react-native";
|
|
2
|
+
import { CometChatTheme } from "../../../theme/type";
|
|
3
|
+
import { deepMerge } from "../../helper/helperFunctions";
|
|
4
|
+
|
|
5
|
+
export type ReportDialogStyle = {
|
|
6
|
+
containerStyle: ViewStyle;
|
|
7
|
+
titleContainerStyle: ViewStyle;
|
|
8
|
+
titleTextStyle: TextStyle;
|
|
9
|
+
messageTextStyle: TextStyle;
|
|
10
|
+
pillsContainerStyle: ViewStyle;
|
|
11
|
+
pillsStyle: ViewStyle;
|
|
12
|
+
pillsTextStyle: TextStyle;
|
|
13
|
+
textInputContainerStyle: ViewStyle;
|
|
14
|
+
sectionTitle: TextStyle;
|
|
15
|
+
descriptionTextStyle: TextStyle;
|
|
16
|
+
buttonContainer: ViewStyle;
|
|
17
|
+
cancelButtonStyle: ViewStyle;
|
|
18
|
+
cancelButtonTextStyle: TextStyle;
|
|
19
|
+
confirmButtonStyle: ViewStyle;
|
|
20
|
+
confirmButtonTextStyle: TextStyle;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const getReportDialogStyleLight = (
|
|
24
|
+
color: CometChatTheme["color"],
|
|
25
|
+
spacing: CometChatTheme["spacing"],
|
|
26
|
+
typography: CometChatTheme["typography"]
|
|
27
|
+
): ReportDialogStyle => {
|
|
28
|
+
return StyleSheet.create({
|
|
29
|
+
containerStyle: {
|
|
30
|
+
backgroundColor: color.background1,
|
|
31
|
+
width: "100%",
|
|
32
|
+
padding: 24,
|
|
33
|
+
maxWidth: 500,
|
|
34
|
+
borderRadius: 16,
|
|
35
|
+
borderColor: color.borderDark,
|
|
36
|
+
shadowColor: "#000",
|
|
37
|
+
shadowOpacity: 0.12,
|
|
38
|
+
shadowRadius: 16,
|
|
39
|
+
shadowOffset: { width: 0, height: 6 },
|
|
40
|
+
elevation: 6,
|
|
41
|
+
},
|
|
42
|
+
titleContainerStyle: {
|
|
43
|
+
borderBottomColor: color.borderLight,
|
|
44
|
+
borderBottomWidth: 1,
|
|
45
|
+
paddingBottom: 16,
|
|
46
|
+
marginBottom: 16,
|
|
47
|
+
gap: 8,
|
|
48
|
+
},
|
|
49
|
+
titleTextStyle: {
|
|
50
|
+
color: color.textPrimary,
|
|
51
|
+
...typography.heading2.bold,
|
|
52
|
+
},
|
|
53
|
+
messageTextStyle: {
|
|
54
|
+
color: color.textSecondary,
|
|
55
|
+
...typography.button.regular,
|
|
56
|
+
},
|
|
57
|
+
pillsContainerStyle: {
|
|
58
|
+
width: "100%",
|
|
59
|
+
marginBottom: 16,
|
|
60
|
+
flexDirection: "row",
|
|
61
|
+
flexWrap: "wrap",
|
|
62
|
+
},
|
|
63
|
+
pillsStyle: {
|
|
64
|
+
borderWidth: 1,
|
|
65
|
+
borderRadius: 24,
|
|
66
|
+
borderColor: color.borderDefault,
|
|
67
|
+
paddingVertical: 10,
|
|
68
|
+
paddingHorizontal: 16,
|
|
69
|
+
marginBottom: 8,
|
|
70
|
+
marginRight: 8,
|
|
71
|
+
},
|
|
72
|
+
pillsTextStyle: {
|
|
73
|
+
color: color.textPrimary,
|
|
74
|
+
...typography.button.regular,
|
|
75
|
+
},
|
|
76
|
+
textInputContainerStyle: {
|
|
77
|
+
width: "100%",
|
|
78
|
+
marginBottom: 24,
|
|
79
|
+
},
|
|
80
|
+
sectionTitle: {
|
|
81
|
+
...typography.body.medium,
|
|
82
|
+
color: color.textPrimary,
|
|
83
|
+
marginBottom: 8,
|
|
84
|
+
},
|
|
85
|
+
descriptionTextStyle: {
|
|
86
|
+
borderWidth: 1,
|
|
87
|
+
borderRadius: 12,
|
|
88
|
+
minHeight: 100,
|
|
89
|
+
padding: 12,
|
|
90
|
+
textAlignVertical: "top",
|
|
91
|
+
maxHeight: 100,
|
|
92
|
+
borderColor: color.borderLight,
|
|
93
|
+
color: color.textPrimary,
|
|
94
|
+
...typography.body.regular,
|
|
95
|
+
},
|
|
96
|
+
buttonContainer: {
|
|
97
|
+
flexDirection: "row",
|
|
98
|
+
width: "100%",
|
|
99
|
+
gap: 12,
|
|
100
|
+
},
|
|
101
|
+
cancelButtonStyle: {
|
|
102
|
+
flex: 1,
|
|
103
|
+
borderRadius: spacing.radius.r2,
|
|
104
|
+
height: 40,
|
|
105
|
+
backgroundColor: color.background1,
|
|
106
|
+
justifyContent: "center",
|
|
107
|
+
alignItems: "center",
|
|
108
|
+
borderWidth: 1,
|
|
109
|
+
borderColor: color.borderDark,
|
|
110
|
+
},
|
|
111
|
+
cancelButtonTextStyle: {
|
|
112
|
+
color: color.textPrimary,
|
|
113
|
+
...typography.button.medium,
|
|
114
|
+
paddingHorizontal: 6,
|
|
115
|
+
textAlign: "center",
|
|
116
|
+
},
|
|
117
|
+
confirmButtonStyle: {
|
|
118
|
+
flex: 1,
|
|
119
|
+
backgroundColor: color.error,
|
|
120
|
+
borderRadius: spacing.radius.r2,
|
|
121
|
+
height: 40,
|
|
122
|
+
justifyContent: "center",
|
|
123
|
+
alignItems: "center",
|
|
124
|
+
},
|
|
125
|
+
confirmButtonTextStyle: {
|
|
126
|
+
color: color.primaryButtonIcon,
|
|
127
|
+
paddingHorizontal: 6,
|
|
128
|
+
textAlign: "center",
|
|
129
|
+
...typography.button.medium,
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const getReportDialogStyleDark = (
|
|
135
|
+
color: CometChatTheme["color"],
|
|
136
|
+
spacing: CometChatTheme["spacing"],
|
|
137
|
+
typography: CometChatTheme["typography"]
|
|
138
|
+
): ReportDialogStyle => {
|
|
139
|
+
return <ReportDialogStyle>(
|
|
140
|
+
deepMerge(getReportDialogStyleLight(color, spacing, typography), {
|
|
141
|
+
containerStyle: {
|
|
142
|
+
backgroundColor: color.background2,
|
|
143
|
+
},
|
|
144
|
+
titleTextStyle: {
|
|
145
|
+
color: color.textPrimary,
|
|
146
|
+
},
|
|
147
|
+
messageTextStyle: {
|
|
148
|
+
color: color.textSecondary,
|
|
149
|
+
},
|
|
150
|
+
cancelButtonStyle: {
|
|
151
|
+
borderColor: color.borderDark,
|
|
152
|
+
},
|
|
153
|
+
cancelButtonTextStyle: {
|
|
154
|
+
color: color.textPrimary,
|
|
155
|
+
},
|
|
156
|
+
confirmButtonStyle: {
|
|
157
|
+
backgroundColor: color.error,
|
|
158
|
+
},
|
|
159
|
+
confirmButtonTextStyle: {
|
|
160
|
+
color: color.primaryButtonIcon,
|
|
161
|
+
},
|
|
162
|
+
})
|
|
163
|
+
);
|
|
164
|
+
};
|
|
Binary file
|
|
Binary file
|
|
@@ -37,7 +37,7 @@ export const getStatusIndicatorStyles = (
|
|
|
37
37
|
borderRadius: spacing.radius.max,
|
|
38
38
|
borderWidth: spacing.spacing.s0_5,
|
|
39
39
|
borderColor: color.background1,
|
|
40
|
-
backgroundColor: color.
|
|
40
|
+
backgroundColor: color.warning,
|
|
41
41
|
justifyContent: "center",
|
|
42
42
|
alignItems: "center",
|
|
43
43
|
},
|
|
@@ -52,7 +52,7 @@ export const getStatusIndicatorStyles = (
|
|
|
52
52
|
borderColor: color.background1,
|
|
53
53
|
justifyContent: "center",
|
|
54
54
|
alignItems: "center",
|
|
55
|
-
backgroundColor: color.
|
|
55
|
+
backgroundColor: color.success,
|
|
56
56
|
},
|
|
57
57
|
imageStylePrivate: { width: spacing.spacing.s2, height: spacing.spacing.s2 },
|
|
58
58
|
imageStyleProtected: { width: spacing.spacing.s2, height: spacing.spacing.s2 },
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
|
-
import { ActivityIndicator, FlatList, ListRenderItemInfo, View } from "react-native";
|
|
2
|
+
import { ActivityIndicator, FlatList, ListRenderItemInfo, View, Text } from "react-native";
|
|
3
3
|
import { CometChatListItem } from "../CometChatListItem";
|
|
4
4
|
import { SuggestionItem } from "./SuggestionItem";
|
|
5
5
|
import { SuggestionListStyle } from "../../../theme/type";
|
|
6
6
|
import { Skeleton } from "./Skeleton";
|
|
7
|
+
import { useTheme } from "../../../theme";
|
|
8
|
+
import { useCometChatTranslation } from "../..";
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Props for the CometChatSuggestionList component.
|
|
@@ -39,6 +41,8 @@ export interface CometChatSuggestionListInterface {
|
|
|
39
41
|
|
|
40
42
|
export const CometChatSuggestionList = (props: CometChatSuggestionListInterface) => {
|
|
41
43
|
const { data, listStyle, onPress, onEndReached, loading } = props;
|
|
44
|
+
const theme = useTheme();
|
|
45
|
+
const { t } = useCometChatTranslation();
|
|
42
46
|
|
|
43
47
|
const [initialLoad, setInitialLoad] = useState(true);
|
|
44
48
|
|
|
@@ -50,11 +54,23 @@ export const CometChatSuggestionList = (props: CometChatSuggestionListInterface)
|
|
|
50
54
|
|
|
51
55
|
const _render = ({ item, index }: ListRenderItemInfo<SuggestionItem>) => {
|
|
52
56
|
let shouldLoadAvatarName = item.hideLeadingIcon ? {} : { avatarName: item.name };
|
|
57
|
+
const isAllAlias = item.underlyingText?.startsWith?.('<@all:');
|
|
58
|
+
const TitleView = isAllAlias ? (
|
|
59
|
+
<Text
|
|
60
|
+
numberOfLines={1}
|
|
61
|
+
ellipsizeMode='tail'
|
|
62
|
+
style={[listStyle?.listItemStyle.titleStyle, { flexShrink: 1 }]}
|
|
63
|
+
>
|
|
64
|
+
<Text style={[listStyle?.listItemStyle.titleStyle, { fontWeight: '700' }]}>@{item.name} </Text>
|
|
65
|
+
<Text style={[theme.typography.caption1.regular, { opacity: 0.7 }]}>{t('MESSAGE_COMPOSER_MENTION_NOTIFY_EVERYONE_LABEL')}</Text>
|
|
66
|
+
</Text>
|
|
67
|
+
) : undefined;
|
|
53
68
|
return (
|
|
54
69
|
<CometChatListItem
|
|
55
70
|
key={index}
|
|
56
71
|
id={item.id}
|
|
57
|
-
title={item.name}
|
|
72
|
+
title={isAllAlias ? undefined : item.name}
|
|
73
|
+
TitleView={TitleView}
|
|
58
74
|
avatarURL={item.leadingIconUrl ? { uri: item.leadingIconUrl } : undefined}
|
|
59
75
|
containerStyle={listStyle?.listItemStyle.containerStyle}
|
|
60
76
|
titleStyle={listStyle?.listItemStyle.titleStyle}
|
|
@@ -81,9 +81,14 @@ import {
|
|
|
81
81
|
import { CometChatAvatar } from "./CometChatAvatar";
|
|
82
82
|
import { BadgeStyle, CometChatBadge } from "./CometChatBadge";
|
|
83
83
|
import { MenuItemInterface } from "./CometChatTooltipMenu";
|
|
84
|
+
import {
|
|
85
|
+
CometChatReportDialog,
|
|
86
|
+
CometChatReportDialogInterface,
|
|
87
|
+
} from "./CometChatReportDialog";
|
|
84
88
|
|
|
85
89
|
export type {
|
|
86
90
|
CometChatConfirmDialogInterface,
|
|
91
|
+
CometChatReportDialogInterface,
|
|
87
92
|
CometChatDateInterface,
|
|
88
93
|
CometChatFileBubbleInterface,
|
|
89
94
|
CometChatImageBubbleInterface,
|
|
@@ -110,6 +115,7 @@ export {
|
|
|
110
115
|
CometChatBadge,
|
|
111
116
|
CometChatBottomSheet,
|
|
112
117
|
CometChatConfirmDialog,
|
|
118
|
+
CometChatReportDialog,
|
|
113
119
|
CometChatDate,
|
|
114
120
|
CometChatEmojiKeyboard,
|
|
115
121
|
CometChatFileBubble,
|
|
@@ -55,6 +55,7 @@ import { defaultTypography } from "./typography";
|
|
|
55
55
|
import { DeepPartial } from "../../shared/helper/types";
|
|
56
56
|
import { getMediaRecorderStyle } from "../../shared/views/CometChatMediaRecorder/style";
|
|
57
57
|
import { getDateSeparatorStyleDark, getDateSeparatorStyleLight } from "../../shared/views/CometChatDateSeperator";
|
|
58
|
+
import { getReportDialogStyleDark, getReportDialogStyleLight } from "../../shared/views/CometChatReportDialog/style";
|
|
58
59
|
|
|
59
60
|
const getActionSheetStyle = (
|
|
60
61
|
color: CometChatTheme["color"],
|
|
@@ -130,6 +131,7 @@ export const lightThemeMaker = (
|
|
|
130
131
|
dateSeparatorStyles: getDateSeparatorStyleLight(color, spacing, typography),
|
|
131
132
|
conversationStyles: getConversationStyleLight(color, spacing, typography),
|
|
132
133
|
confirmDialogStyles: getConfirmDialogStyleLight(color, spacing, typography),
|
|
134
|
+
reportDialogStyles: getReportDialogStyleLight(color, spacing, typography),
|
|
133
135
|
messageHeaderStyles: getMessageHeaderStyle(color, spacing, typography),
|
|
134
136
|
messageComposerStyles: getComposerStyle(color, spacing, typography),
|
|
135
137
|
userStyles: getUserListStyleLight(color, spacing, typography),
|
|
@@ -170,6 +172,7 @@ export const darkThemeMaker = (
|
|
|
170
172
|
dateSeparatorStyles: getDateSeparatorStyleDark(color, spacing, typography),
|
|
171
173
|
conversationStyles: getConversationStyleDark(color, spacing, typography),
|
|
172
174
|
confirmDialogStyles: getConfirmDialogStyleDark(color, spacing, typography),
|
|
175
|
+
reportDialogStyles: getReportDialogStyleDark(color, spacing, typography),
|
|
173
176
|
messageHeaderStyles: getMessageHeaderStyle(color, spacing, typography),
|
|
174
177
|
messageComposerStyles: getComposerStyle(color, spacing, typography),
|
|
175
178
|
userStyles: getUserListStyleDark(color, spacing, typography),
|
package/src/theme/provider.tsx
CHANGED
|
@@ -56,6 +56,7 @@ export const CometChatThemeProvider = ({
|
|
|
56
56
|
|
|
57
57
|
const lightTheme = useMemo(() => {
|
|
58
58
|
if (light) {
|
|
59
|
+
const isColorAvailable = light.color !== undefined;
|
|
59
60
|
const updatedColors = light.color
|
|
60
61
|
? CometChatThemeHelper.updateColors(
|
|
61
62
|
light.color as Partial<CometChatTheme["color"]>,
|
|
@@ -68,11 +69,11 @@ export const CometChatThemeProvider = ({
|
|
|
68
69
|
light.color = updatedColors;
|
|
69
70
|
light.spacing = updatedSpacing;
|
|
70
71
|
const mergedTheme = deepMerge(parentProviderTheme.light, light);
|
|
71
|
-
const defaultLightThemeWithOverridesApplied = lightThemeMaker(
|
|
72
|
+
const defaultLightThemeWithOverridesApplied = isColorAvailable ? lightThemeMaker(
|
|
72
73
|
mergedTheme.spacing as CometChatTheme["spacing"],
|
|
73
74
|
mergedTheme.color as CometChatTheme["color"],
|
|
74
75
|
mergedTheme.typography as CometChatTheme["typography"]
|
|
75
|
-
);
|
|
76
|
+
) : mergedTheme;
|
|
76
77
|
return deepMerge(defaultLightThemeWithOverridesApplied, light);
|
|
77
78
|
}
|
|
78
79
|
return parentProviderTheme.light;
|
|
@@ -80,6 +81,7 @@ export const CometChatThemeProvider = ({
|
|
|
80
81
|
|
|
81
82
|
const darkTheme = useMemo(() => {
|
|
82
83
|
if (dark) {
|
|
84
|
+
const isColorAvailable = dark.color !== undefined;
|
|
83
85
|
const updatedColors = dark.color
|
|
84
86
|
? CometChatThemeHelper.updateColors(
|
|
85
87
|
dark.color as Partial<CometChatTheme["color"]>,
|
|
@@ -92,12 +94,12 @@ export const CometChatThemeProvider = ({
|
|
|
92
94
|
dark.color = updatedColors;
|
|
93
95
|
dark.spacing = updatedSpacing;
|
|
94
96
|
const mergedTheme = deepMerge(parentProviderTheme.dark, dark);
|
|
95
|
-
const defaultDarkThemeWithOverridesApplied = darkThemeMaker(
|
|
97
|
+
const defaultDarkThemeWithOverridesApplied = isColorAvailable ? darkThemeMaker(
|
|
96
98
|
mergedTheme.spacing as CometChatTheme["spacing"],
|
|
97
99
|
mergedTheme.color as CometChatTheme["color"],
|
|
98
100
|
mergedTheme.typography as CometChatTheme["typography"]
|
|
99
|
-
);
|
|
100
|
-
return deepMerge(defaultDarkThemeWithOverridesApplied,
|
|
101
|
+
) : mergedTheme;
|
|
102
|
+
return deepMerge(defaultDarkThemeWithOverridesApplied, mergedTheme);
|
|
101
103
|
}
|
|
102
104
|
return parentProviderTheme.dark;
|
|
103
105
|
}, [dark, parentProviderTheme.dark]);
|
package/src/theme/type.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { DeepPartial } from "../shared/helper/types";
|
|
|
23
23
|
import { DateSeparatorStyle } from "../shared/views/CometChatDateSeperator/styles";
|
|
24
24
|
import { JSX } from "react";
|
|
25
25
|
import { ChatHistoryStyle } from "../CometChatAIAssistantChatHistory/style";
|
|
26
|
+
import { ReportDialogStyle } from "../shared/views/CometChatReportDialog/style";
|
|
26
27
|
|
|
27
28
|
export type BubbleStyles = {
|
|
28
29
|
containerStyle: ViewStyle;
|
|
@@ -47,6 +48,14 @@ export type BubbleStyles = {
|
|
|
47
48
|
linkPreviewBubbleStyles?: DeepPartial<CometChatTheme["linkPreviewBubbleStyles"]>;
|
|
48
49
|
};
|
|
49
50
|
|
|
51
|
+
export type OutgoingBubbleStyles = Omit<BubbleStyles, 'assistantBubbleStyles'> & {
|
|
52
|
+
moderationStyle?: {
|
|
53
|
+
containerStyle?: ViewStyle;
|
|
54
|
+
textStyle?: TextStyle;
|
|
55
|
+
iconTintColor?: ColorValue;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
|
|
50
59
|
export type ActionSheetStyle = {
|
|
51
60
|
optionsItemStyle: {
|
|
52
61
|
containerStyle: ViewStyle;
|
|
@@ -256,6 +265,11 @@ export interface CometChatTheme {
|
|
|
256
265
|
imageStyle: ImageStyle;
|
|
257
266
|
innerContainerStyle: ViewStyle;
|
|
258
267
|
dateReceiptContainerStyle: ViewStyle;
|
|
268
|
+
moderationStyle?: {
|
|
269
|
+
containerStyle?: ViewStyle;
|
|
270
|
+
textStyle?: TextStyle;
|
|
271
|
+
iconTintColor?: ColorValue;
|
|
272
|
+
};
|
|
259
273
|
};
|
|
260
274
|
threadHeaderStyles: {
|
|
261
275
|
containerStyle: ViewStyle;
|
|
@@ -279,6 +293,11 @@ export interface CometChatTheme {
|
|
|
279
293
|
playIconStyle?: ImageStyle;
|
|
280
294
|
playIconContainerStyle?: ViewStyle;
|
|
281
295
|
placeholderImage?: ImageSourcePropType;
|
|
296
|
+
moderationStyle?: {
|
|
297
|
+
containerStyle?: ViewStyle;
|
|
298
|
+
textStyle?: TextStyle;
|
|
299
|
+
iconTintColor?: ColorValue;
|
|
300
|
+
};
|
|
282
301
|
};
|
|
283
302
|
audioBubbleStyles?: {
|
|
284
303
|
threadedMessageStyle: CometChatTheme["threadedMessageStyles"];
|
|
@@ -438,7 +457,7 @@ export interface CometChatTheme {
|
|
|
438
457
|
};
|
|
439
458
|
dateSeparatorStyle?: DateSeparatorStyle;
|
|
440
459
|
incomingMessageBubbleStyles: DeepPartial<BubbleStyles>;
|
|
441
|
-
outgoingMessageBubbleStyles: DeepPartial<
|
|
460
|
+
outgoingMessageBubbleStyles: DeepPartial<OutgoingBubbleStyles>;
|
|
442
461
|
groupActionBubbleStyles: DeepPartial<CometChatTheme["groupActionBubbleStyles"]>;
|
|
443
462
|
callActionBubbleStyles: DeepPartial<CallActionBubbleStyles>;
|
|
444
463
|
messageInformationStyles: DeepPartial<CometChatTheme["messageInformationStyles"]>;
|
|
@@ -450,6 +469,7 @@ export interface CometChatTheme {
|
|
|
450
469
|
callLogsStyles: CallLogsStyle;
|
|
451
470
|
conversationStyles: ConversationStyle;
|
|
452
471
|
confirmDialogStyles: ConfirmDialogStyle;
|
|
472
|
+
reportDialogStyles: ReportDialogStyle;
|
|
453
473
|
quickReactionStyle: {
|
|
454
474
|
containerStyle: ViewStyle;
|
|
455
475
|
emojiContainerStyle: ViewStyle;
|