@cometchat/chat-uikit-react-native 5.2.9 → 5.2.11
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 +2 -2
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +47 -11
- package/src/CometChatMessageList/CometChatMessageList.tsx +58 -47
- package/src/CometChatMessageList/components/MessageListItem.tsx +11 -8
- package/src/CometChatSearch/style.ts +3 -3
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +71 -14
- package/src/shared/resources/CometChatLocalizeNew/resources/de/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/en/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/es/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/fr/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/hi/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/hu/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/it/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/ja/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/ko/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/lt/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/ms/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/nl/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/pt/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/ru/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/sv/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/tr/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/zh/translation.json +1 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/zh-tw/translation.json +1 -0
- package/src/shared/utils/MessageUtils.tsx +55 -0
- package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +1 -1
- package/src/shared/views/CometChatList/Header.tsx +57 -49
- package/src/shared/views/CometChatMediaRecorder/CometChatMediaRecorder.tsx +0 -1
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +4 -3
- package/src/shared/views/CometChatQuickReactions/QuickReactionsStyle.tsx +2 -2
- package/src/shared/views/CometChatReactionList/ReactionListStyle.tsx +3 -2
- package/src/shared/views/CometChatReactions/CometChatReactions.tsx +11 -5
- package/src/shared/views/CometChatReactions/style.ts +35 -8
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +46 -61
- package/src/theme/index.ts +1 -1
- package/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
2
2
|
import React, { JSX } from "react";
|
|
3
|
-
import { ColorValue, StyleProp, Text, TextStyle } from "react-native";
|
|
3
|
+
import { ColorValue, StyleProp, Text, TextStyle, View } from "react-native";
|
|
4
4
|
import { CometChatUIKit } from "../../CometChatUiKit";
|
|
5
5
|
import {
|
|
6
6
|
MentionsTargetElement,
|
|
@@ -25,6 +25,8 @@ const t = getCometChatTranslation();
|
|
|
25
25
|
type MentionsSubStyle = {
|
|
26
26
|
textStyle?: TextStyle;
|
|
27
27
|
selfTextStyle?: TextStyle;
|
|
28
|
+
backgroundColor?: ColorValue;
|
|
29
|
+
selfBackgroundColor?: ColorValue;
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
type MentionContext = "composer" | "conversation" | "incoming" | "outgoing";
|
|
@@ -71,7 +73,7 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
71
73
|
private incomingBubbleStyle: MentionsSubStyle;
|
|
72
74
|
private outgoingBubbleStyle: MentionsSubStyle;
|
|
73
75
|
private currentContext: MentionContext = "incoming";
|
|
74
|
-
private resolveStyle(isSelf: boolean): TextStyle {
|
|
76
|
+
private resolveStyle(isSelf: boolean): { textStyle: TextStyle; backgroundColor: ColorValue | undefined } {
|
|
75
77
|
let style: MentionsSubStyle;
|
|
76
78
|
switch (this.currentContext) {
|
|
77
79
|
case "composer":
|
|
@@ -86,7 +88,9 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
86
88
|
default:
|
|
87
89
|
style = this.incomingBubbleStyle;
|
|
88
90
|
}
|
|
89
|
-
|
|
91
|
+
const textStyle = isSelf ? (style.selfTextStyle ?? {}) : (style.textStyle ?? {});
|
|
92
|
+
const backgroundColor = isSelf ? style.selfBackgroundColor : style.backgroundColor;
|
|
93
|
+
return { textStyle, backgroundColor };
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
/**
|
|
@@ -132,22 +136,64 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
132
136
|
? loggedInUser
|
|
133
137
|
: (themeOrUser as CometChat.User | undefined);
|
|
134
138
|
|
|
135
|
-
|
|
139
|
+
// Incoming bubble style - purple/blue text with purple background
|
|
140
|
+
const incomingFallback: MentionsSubStyle = {
|
|
136
141
|
textStyle: { fontWeight: "700", fontSize: 14, lineHeight: 19.6, color: "#6852D6" },
|
|
137
142
|
selfTextStyle: { fontWeight: "700", fontSize: 14, lineHeight: 19.6, color: "#FFAB00" },
|
|
143
|
+
backgroundColor: "rgba(104, 82, 214, 0.15)", // Purple/blue matching text color
|
|
144
|
+
selfBackgroundColor: "rgba(255, 171, 0, 0.2)", // Yellow/warning for @all
|
|
138
145
|
};
|
|
139
146
|
|
|
140
|
-
|
|
147
|
+
// Outgoing bubble style - white text with white background
|
|
148
|
+
const outgoingFallback: MentionsSubStyle = {
|
|
149
|
+
textStyle: { fontWeight: "700", fontSize: 14, lineHeight: 19.6, color: "#FFFFFF" },
|
|
150
|
+
selfTextStyle: { fontWeight: "700", fontSize: 14, lineHeight: 19.6, color: "#FFAB00" },
|
|
151
|
+
backgroundColor: "rgba(255, 255, 255, 0.2)", // White matching text color
|
|
152
|
+
selfBackgroundColor: "rgba(255, 171, 0, 0.2)", // Yellow/warning for @all
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const incomingFromTheme = (c: ColorValue): MentionsSubStyle => {
|
|
141
156
|
const baseStyle = theme?.typography?.body?.bold || {};
|
|
142
157
|
return {
|
|
143
158
|
textStyle: { ...baseStyle, color: c },
|
|
144
159
|
selfTextStyle: { ...baseStyle, color: theme?.color?.warning || "#FFAB00" },
|
|
160
|
+
backgroundColor: "rgba(104, 82, 214, 0.15)", // Purple/blue matching primary color
|
|
161
|
+
selfBackgroundColor: "rgba(255, 171, 0, 0.2)", // Yellow/warning for @all
|
|
145
162
|
};
|
|
146
163
|
};
|
|
147
164
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
165
|
+
const outgoingFromTheme = (c: ColorValue): MentionsSubStyle => {
|
|
166
|
+
const baseStyle = theme?.typography?.body?.bold || {};
|
|
167
|
+
return {
|
|
168
|
+
textStyle: { ...baseStyle, color: c },
|
|
169
|
+
selfTextStyle: { ...baseStyle, color: theme?.color?.warning || "#FFAB00" },
|
|
170
|
+
backgroundColor: "rgba(255, 255, 255, 0.2)", // White matching outgoing text color
|
|
171
|
+
selfBackgroundColor: "rgba(255, 171, 0, 0.2)", // Yellow/warning for @all
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
// Composer-specific style with purple/blue background matching the text color
|
|
176
|
+
const composerFallback: MentionsSubStyle = {
|
|
177
|
+
textStyle: { fontWeight: "700", fontSize: 14, lineHeight: 19.6, color: "#6852D6" },
|
|
178
|
+
selfTextStyle: { fontWeight: "700", fontSize: 14, lineHeight: 19.6, color: "#FFAB00" },
|
|
179
|
+
backgroundColor: "rgba(104, 82, 214, 0.15)", // Purple/blue matching text color
|
|
180
|
+
selfBackgroundColor: "rgba(255, 171, 0, 0.2)", // Yellow/warning for @all
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const composerFromTheme = (): MentionsSubStyle => {
|
|
184
|
+
const baseStyle = theme?.typography?.body?.bold || {};
|
|
185
|
+
const primaryColor = theme?.color?.primary || "#6852D6";
|
|
186
|
+
return {
|
|
187
|
+
textStyle: { ...baseStyle, color: primaryColor },
|
|
188
|
+
selfTextStyle: { ...baseStyle, color: theme?.color?.warning || "#FFAB00" },
|
|
189
|
+
backgroundColor: "rgba(104, 82, 214, 0.15)", // Purple/blue background
|
|
190
|
+
selfBackgroundColor: "rgba(255, 171, 0, 0.2)", // Yellow/warning for @all
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
this.incomingBubbleStyle = theme ? incomingFromTheme(theme.color.receiveBubbleTextHighlight) : incomingFallback;
|
|
195
|
+
this.outgoingBubbleStyle = theme ? outgoingFromTheme(theme.color.sendBubbleTextHighlight) : outgoingFallback;
|
|
196
|
+
this.composerStyle = theme ? composerFromTheme() : composerFallback;
|
|
151
197
|
this.conversationStyle = this.incomingBubbleStyle;
|
|
152
198
|
}
|
|
153
199
|
|
|
@@ -584,23 +630,29 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
584
630
|
this.setContext(isOutgoing ? "outgoing" : "incoming");
|
|
585
631
|
}
|
|
586
632
|
|
|
587
|
-
const textStyle = this.resolveStyle(isSelf);
|
|
633
|
+
const { textStyle, backgroundColor } = this.resolveStyle(isSelf);
|
|
588
634
|
|
|
589
635
|
let onPressProp =
|
|
590
636
|
this.temp && !isAlias
|
|
591
637
|
? { onPress: (event: any) => this.onMentionClick(event, segment) }
|
|
592
638
|
: {}; // still suppress click for alias
|
|
593
639
|
|
|
640
|
+
const mentionContainerStyle = backgroundColor ? {
|
|
641
|
+
backgroundColor,
|
|
642
|
+
borderRadius: 4,
|
|
643
|
+
paddingHorizontal: 2,
|
|
644
|
+
} : {};
|
|
645
|
+
|
|
594
646
|
if (this.target === MentionsTargetElement.textbubble) {
|
|
595
647
|
return (
|
|
596
|
-
<Text suppressHighlighting={true} key={index} {...onPressProp} style={[textStyle]}>
|
|
648
|
+
<Text suppressHighlighting={true} key={index} {...onPressProp} style={[textStyle, mentionContainerStyle]}>
|
|
597
649
|
{userRegistry[segment]}
|
|
598
650
|
</Text>
|
|
599
651
|
);
|
|
600
652
|
}
|
|
601
653
|
|
|
602
654
|
return (
|
|
603
|
-
<Text suppressHighlighting={true} key={index} {...onPressProp} style={[textStyle]}>
|
|
655
|
+
<Text suppressHighlighting={true} key={index} {...onPressProp} style={[textStyle, mentionContainerStyle]}>
|
|
604
656
|
{userRegistry[segment]}
|
|
605
657
|
</Text>
|
|
606
658
|
);
|
|
@@ -610,11 +662,16 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
610
662
|
(it) => it.underlyingText === `<@all:${segment}>`
|
|
611
663
|
);
|
|
612
664
|
if (aliasItem) {
|
|
613
|
-
const styleResolved = this.resolveStyle(true);
|
|
665
|
+
const { textStyle: styleResolved, backgroundColor } = this.resolveStyle(true);
|
|
666
|
+
const mentionContainerStyle = backgroundColor ? {
|
|
667
|
+
backgroundColor,
|
|
668
|
+
borderRadius: 4,
|
|
669
|
+
paddingHorizontal: 2,
|
|
670
|
+
} : {};
|
|
614
671
|
// If context is 'conversation', render @all and description inline
|
|
615
672
|
if (this.currentContext === "conversation") {
|
|
616
673
|
return (
|
|
617
|
-
<Text suppressHighlighting={true} key={index} style={[styleResolved]}>
|
|
674
|
+
<Text suppressHighlighting={true} key={index} style={[styleResolved, mentionContainerStyle]}>
|
|
618
675
|
<Text style={[styleResolved, { fontWeight: "700" }]}>
|
|
619
676
|
@{aliasItem.promptText}
|
|
620
677
|
</Text>
|
|
@@ -626,7 +683,7 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
626
683
|
);
|
|
627
684
|
}
|
|
628
685
|
return (
|
|
629
|
-
<Text suppressHighlighting={true} key={index} style={[styleResolved]}>
|
|
686
|
+
<Text suppressHighlighting={true} key={index} style={[styleResolved, mentionContainerStyle]}>
|
|
630
687
|
{aliasItem.promptText}
|
|
631
688
|
</Text>
|
|
632
689
|
);
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION": "Möchten Sie diese Konversation löschen? Diese Konversation wird von all Ihren Geräten gelöscht.",
|
|
27
27
|
"GROUPS": "Gruppen",
|
|
28
28
|
"WRONG_FILE_TYPE":"Sie haben einen anderen Dateityp ausgewählt. Bitte wählen Sie die entsprechende Datei aus.",
|
|
29
|
+
"FILE_TYPE_NOT_ALLOWED": "Dieser Dateityp ist nicht erlaubt.",
|
|
29
30
|
"SHARED": "Geteilt",
|
|
30
31
|
"SOUND_MANAGER": "Soundmanager",
|
|
31
32
|
"THEME": "Thema",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"CONVERSATION_LIST": "Conversation List",
|
|
31
31
|
"MESSAGES": "Messages",
|
|
32
32
|
"WRONG_FILE_TYPE": "You selected a different type of file. Please choose the appropriate file.",
|
|
33
|
+
"FILE_TYPE_NOT_ALLOWED": "This file type is not allowed.",
|
|
33
34
|
"MESSAGE_HEADER": "Message Header",
|
|
34
35
|
"MESSAGE_LIST": "Message List",
|
|
35
36
|
"MESSAGE_COMPOSER": "Message Composer",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"CHATS": "Charlas",
|
|
25
25
|
"SEARCH_EMOJI": "Buscar emojis",
|
|
26
26
|
"WRONG_FILE_TYPE": "Has seleccionado otro tipo de archivo. Seleccione el archivo adecuado.",
|
|
27
|
+
"FILE_TYPE_NOT_ALLOWED": "Este tipo de archivo no está permitido.",
|
|
27
28
|
"WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION": "¿Quieres eliminar esta conversación? Esta conversación se eliminará de todos tus dispositivos.",
|
|
28
29
|
"GROUPS": "Grupos",
|
|
29
30
|
"SHARED": "Compartido",
|
|
@@ -443,6 +443,7 @@
|
|
|
443
443
|
"WEDNESDAY": "Mercredi",
|
|
444
444
|
"WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION": "Désirez-vous supprimer cette conversation ? Cette conversation sera supprimée de tous vos appareils.",
|
|
445
445
|
"WRONG_FILE_TYPE": "Vous avez sélectionné un autre type de fichier. Choisissez le fichier approprié.",
|
|
446
|
+
"FILE_TYPE_NOT_ALLOWED": "Ce type de fichier n'est pas autorisé.",
|
|
446
447
|
"WRONG_PASSWORD": "Entrez le mot de passe correct et réessayez",
|
|
447
448
|
"WRONG_TEXT": "On dirait que quelque chose a mal tourné.",
|
|
448
449
|
"WRONG_TEXT_TRY_AGAIN": "Veuillez réessayer.",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION": "क्या आप इस वार्तालाप को मिटाना चाहेंगे? यह वार्तालाप आपके सभी डिवाइस से हटा दिया जाएगा।",
|
|
27
27
|
"GROUPS": "ग्रुप्स",
|
|
28
28
|
"WRONG_FILE_TYPE": "आपने एक अलग प्रकार की फ़ाइल चुनी है। कृपया उपयुक्त फ़ाइल चुनें।",
|
|
29
|
+
"FILE_TYPE_NOT_ALLOWED": "इस फ़ाइल प्रकार की अनुमति नहीं है।",
|
|
29
30
|
"SHARED": "शेयर्ड",
|
|
30
31
|
"SOUND_MANAGER": "साउंड मैनेजर",
|
|
31
32
|
"THEME": "थीम",
|
|
@@ -443,6 +443,7 @@
|
|
|
443
443
|
"WEDNESDAY": "Szerda",
|
|
444
444
|
"WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION": "Szeretné törölni ezt a beszélgetést? Ez a beszélgetés törlődik az összes eszközéről.",
|
|
445
445
|
"WRONG_FILE_TYPE": "Másik típusú fájlt választott ki. Kérjük, válassza ki a megfelelő fájlt.",
|
|
446
|
+
"FILE_TYPE_NOT_ALLOWED": "Ez a fájltípus nem engedélyezett.",
|
|
446
447
|
"WRONG_PASSWORD": "Kérjük, adja meg a helyes jelszót, és próbálja újra",
|
|
447
448
|
"WRONG_TEXT": "Úgy tűnik, valami félrement.",
|
|
448
449
|
"WRONG_TEXT_TRY_AGAIN": "Kérjük, próbáld meg újra.",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"CONVERSATION_LIST": "Lista conversazioni",
|
|
31
31
|
"MESSAGES": "Messaggi",
|
|
32
32
|
"WRONG_FILE_TYPE": "Hai selezionato un tipo di file diverso. Scegli il file appropriato.",
|
|
33
|
+
"FILE_TYPE_NOT_ALLOWED": "Questo tipo di file non è consentito.",
|
|
33
34
|
"MESSAGE_HEADER": "Intestazione messaggio",
|
|
34
35
|
"MESSAGE_LIST": "Lista messaggi",
|
|
35
36
|
"MESSAGE_COMPOSER": "Compositore messaggi",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"CONVERSATION_LIST": "会話リスト",
|
|
31
31
|
"MESSAGES": "メッセージ",
|
|
32
32
|
"WRONG_FILE_TYPE": "異なるタイプのファイルを選択しました。適切なファイルを選択してください。",
|
|
33
|
+
"FILE_TYPE_NOT_ALLOWED": "このファイル形式は許可されていません。",
|
|
33
34
|
"MESSAGE_HEADER": "メッセージヘッダー",
|
|
34
35
|
"MESSAGE_LIST": "メッセージリスト",
|
|
35
36
|
"MESSAGE_COMPOSER": "メッセージ作成",
|
|
@@ -443,6 +443,7 @@
|
|
|
443
443
|
"WEDNESDAY": "Mercoledì",
|
|
444
444
|
"WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION": "Vuoi eliminare questa conversazione? Questa conversazione verrà eliminata da tutti i tuoi dispositivi.",
|
|
445
445
|
"WRONG_FILE_TYPE": "Hai selezionato un tipo di file diverso. Scegli il file appropriato.",
|
|
446
|
+
"FILE_TYPE_NOT_ALLOWED": "Šis failo tipas neleidžiamas.",
|
|
446
447
|
"WRONG_PASSWORD": "Inserisci la password corretta e riprova",
|
|
447
448
|
"WRONG_TEXT": "Atrodo, kažkas nutiko ne taip.",
|
|
448
449
|
"WRONG_TEXT_TRY_AGAIN": "Prašome bandyti dar kartą.",
|
|
@@ -443,6 +443,7 @@
|
|
|
443
443
|
"WEDNESDAY": "Rabu",
|
|
444
444
|
"WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION": "Adakah anda ingin memadamkan perbualan ini? Perbualan ini akan dipadamkan dari semua peranti anda.",
|
|
445
445
|
"WRONG_FILE_TYPE": "Anda memilih jenis fail yang berbeza. Sila pilih fail yang sesuai.",
|
|
446
|
+
"FILE_TYPE_NOT_ALLOWED": "Jenis fail ini tidak dibenarkan.",
|
|
446
447
|
"WRONG_PASSWORD": "Sila masukkan kata laluan yang betul dan cuba lagi",
|
|
447
448
|
"WRONG_TEXT": "Nampaknya ada sesuatu yang tidak kena.",
|
|
448
449
|
"WRONG_TEXT_TRY_AGAIN": "Sila cuba lagi.",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"CONVERSATION_LIST": "Gesprekkenlijst",
|
|
31
31
|
"MESSAGES": "Berichten",
|
|
32
32
|
"WRONG_FILE_TYPE": "Je hebt een ander bestandstype geselecteerd. Kies het juiste bestand.",
|
|
33
|
+
"FILE_TYPE_NOT_ALLOWED": "Dit bestandstype is niet toegestaan.",
|
|
33
34
|
"MESSAGE_HEADER": "Berichtkop",
|
|
34
35
|
"MESSAGE_LIST": "Berichtenlijst",
|
|
35
36
|
"MESSAGE_COMPOSER": "Berichtschrijver",
|
|
@@ -443,6 +443,7 @@
|
|
|
443
443
|
"WEDNESDAY": "Quarta-feira",
|
|
444
444
|
"WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION": "Você gostaria de excluir esta conversa? Essa conversa será excluída de todos os seus dispositivos.",
|
|
445
445
|
"WRONG_FILE_TYPE": "Você selecionou um tipo diferente de arquivo. Escolha o arquivo apropriado.",
|
|
446
|
+
"FILE_TYPE_NOT_ALLOWED": "Este tipo de arquivo não é permitido.",
|
|
446
447
|
"WRONG_PASSWORD": "Digite a senha correta e tente novamente",
|
|
447
448
|
"WRONG_TEXT": "Parece que algo deu errado.",
|
|
448
449
|
"WRONG_TEXT_TRY_AGAIN": "Por favor, tente novamente.",
|
|
@@ -443,6 +443,7 @@
|
|
|
443
443
|
"WEDNESDAY": "Среда",
|
|
444
444
|
"WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION": "Хотите удалить этот разговор? Этот разговор будет удален со всех ваших устройств.",
|
|
445
445
|
"WRONG_FILE_TYPE": "Вы выбрали другой тип файла. Выберите подходящий файл.",
|
|
446
|
+
"FILE_TYPE_NOT_ALLOWED": "Этот тип файла не разрешён.",
|
|
446
447
|
"WRONG_PASSWORD": "Пожалуйста, введите правильный пароль и попробуйте снова",
|
|
447
448
|
"WRONG_TEXT": "Похоже, что что-то пошло не так.",
|
|
448
449
|
"WRONG_TEXT_TRY_AGAIN": "Пожалуйста, попробуйте ещё раз.",
|
|
@@ -443,6 +443,7 @@
|
|
|
443
443
|
"WEDNESDAY": "onsdag",
|
|
444
444
|
"WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION": "Vill du ta bort den här konversationen? Den här konversationen kommer att raderas från alla dina enheter.",
|
|
445
445
|
"WRONG_FILE_TYPE": "Du har valt en annan typ av fil. Välj lämplig fil.",
|
|
446
|
+
"FILE_TYPE_NOT_ALLOWED": "Denna filtyp är inte tillåten.",
|
|
446
447
|
"WRONG_PASSWORD": "Ange rätt lösenord och försök igen",
|
|
447
448
|
"WRONG_TEXT": "Det verkar som att något gick fel.",
|
|
448
449
|
"WRONG_TEXT_TRY_AGAIN": "Vänligen försök igen.",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"CONVERSATION_LIST": "Konuşma Listesi",
|
|
31
31
|
"MESSAGES": "Mesajlar",
|
|
32
32
|
"WRONG_FILE_TYPE": "Farklı bir dosya türü seçtiniz. Lütfen uygun dosyayı seçin.",
|
|
33
|
+
"FILE_TYPE_NOT_ALLOWED": "Bu dosya türüne izin verilmiyor.",
|
|
33
34
|
"MESSAGE_HEADER": "Mesaj Başlığı",
|
|
34
35
|
"MESSAGE_LIST": "Mesaj Listesi",
|
|
35
36
|
"MESSAGE_COMPOSER": "Mesaj Oluşturucu",
|
|
@@ -443,6 +443,7 @@
|
|
|
443
443
|
"WEDNESDAY": "周三",
|
|
444
444
|
"WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION": "你想删除这个对话吗?此对话将从您的所有设备中删除。",
|
|
445
445
|
"WRONG_FILE_TYPE": "您选择了其他类型的文件。请选择相应的文件。",
|
|
446
|
+
"FILE_TYPE_NOT_ALLOWED": "不允许使用此文件类型。",
|
|
446
447
|
"WRONG_PASSWORD": "请输入正确的密码并重试",
|
|
447
448
|
"WRONG_TEXT": "看起来出了点问题.",
|
|
448
449
|
"WRONG_TEXT_TRY_AGAIN": "请再试一次.",
|
|
@@ -443,6 +443,7 @@
|
|
|
443
443
|
"WEDNESDAY": "星期三",
|
|
444
444
|
"WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION": "您想刪除此對話嗎?此對話將從您的所有設備中刪除。",
|
|
445
445
|
"WRONG_FILE_TYPE": "您選取了不同類型的檔案。請選擇適當的檔案。",
|
|
446
|
+
"FILE_TYPE_NOT_ALLOWED": "不允許使用此檔案類型。",
|
|
446
447
|
"WRONG_PASSWORD": "請輸入正確的密碼,然後再試一次",
|
|
447
448
|
"WRONG_TEXT": "看起來出了點問題.",
|
|
448
449
|
"WRONG_TEXT_TRY_AGAIN": "請再試一次.",
|
|
@@ -450,4 +450,59 @@ export const ModerationBottomView = ({
|
|
|
450
450
|
);
|
|
451
451
|
};
|
|
452
452
|
|
|
453
|
+
export const MimeErrorBottomView = ({
|
|
454
|
+
moderationStyle,
|
|
455
|
+
}: {
|
|
456
|
+
moderationStyle?: OutgoingBubbleStyles["moderationStyle"];
|
|
457
|
+
}) => {
|
|
458
|
+
const { t } = useCometChatTranslation();
|
|
459
|
+
const theme = useTheme();
|
|
460
|
+
|
|
461
|
+
const bubblePadH =
|
|
462
|
+
theme.messageListStyles.outgoingMessageBubbleStyles?.containerStyle?.paddingHorizontal ??
|
|
463
|
+
theme.spacing?.spacing?.s3 ?? 12;
|
|
464
|
+
|
|
465
|
+
const bubblePadB =
|
|
466
|
+
theme.messageListStyles.outgoingMessageBubbleStyles?.containerStyle?.paddingBottom ?? 0;
|
|
467
|
+
|
|
468
|
+
const bubbleRadius =
|
|
469
|
+
theme.messageListStyles.outgoingMessageBubbleStyles?.containerStyle?.borderRadius ?? 8;
|
|
470
|
+
|
|
471
|
+
const themeModerationStyle =
|
|
472
|
+
theme.messageListStyles.outgoingMessageBubbleStyles.moderationStyle || {};
|
|
473
|
+
|
|
474
|
+
const effective = deepMerge(themeModerationStyle, moderationStyle || {});
|
|
475
|
+
|
|
476
|
+
return (
|
|
477
|
+
<View
|
|
478
|
+
style={[
|
|
479
|
+
{
|
|
480
|
+
marginHorizontal: -bubblePadH,
|
|
481
|
+
marginBottom: -bubblePadB,
|
|
482
|
+
borderTopLeftRadius: 0,
|
|
483
|
+
borderTopRightRadius: 0,
|
|
484
|
+
borderBottomLeftRadius: bubbleRadius,
|
|
485
|
+
borderBottomRightRadius: bubbleRadius,
|
|
486
|
+
flexDirection: "row",
|
|
487
|
+
alignItems: "center",
|
|
488
|
+
},
|
|
489
|
+
effective?.containerStyle,
|
|
490
|
+
]}
|
|
491
|
+
>
|
|
492
|
+
<Icon
|
|
493
|
+
name="message-blocked"
|
|
494
|
+
color={effective?.iconTintColor}
|
|
495
|
+
containerStyle={{ paddingLeft: 12, paddingRight: 4, alignSelf: "stretch" }}
|
|
496
|
+
/>
|
|
497
|
+
<Text
|
|
498
|
+
style={[
|
|
499
|
+
effective?.textStyle,
|
|
500
|
+
]}
|
|
501
|
+
>
|
|
502
|
+
{t("FILE_TYPE_NOT_ALLOWED")}
|
|
503
|
+
</Text>
|
|
504
|
+
</View>
|
|
505
|
+
);
|
|
506
|
+
};
|
|
507
|
+
|
|
453
508
|
|
|
@@ -90,10 +90,10 @@ export const CometChatActionSheet = (props: CometChatActionSheetInterface) => {
|
|
|
90
90
|
<FlatList
|
|
91
91
|
key={"list"}
|
|
92
92
|
keyExtractor={(item) => item.id}
|
|
93
|
-
style={{ flex: 1 }}
|
|
94
93
|
data={actionList}
|
|
95
94
|
numColumns={1}
|
|
96
95
|
renderItem={_render}
|
|
96
|
+
contentContainerStyle={{ paddingBottom: 24 }}
|
|
97
97
|
/>
|
|
98
98
|
);
|
|
99
99
|
};
|
|
@@ -2,6 +2,7 @@ import React, { JSX, useRef } from "react";
|
|
|
2
2
|
import {
|
|
3
3
|
ImageSourcePropType,
|
|
4
4
|
ImageStyle,
|
|
5
|
+
Pressable,
|
|
5
6
|
StyleProp,
|
|
6
7
|
Text,
|
|
7
8
|
TextInput,
|
|
@@ -274,60 +275,67 @@ export default function Header({
|
|
|
274
275
|
<SearchView />
|
|
275
276
|
</View>
|
|
276
277
|
) : (
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
borderRadius: theme.spacing.radius.max,
|
|
282
|
-
paddingHorizontal: theme.spacing.spacing.s3,
|
|
283
|
-
paddingVertical: theme.spacing.spacing.s3,
|
|
284
|
-
marginTop: theme.spacing.spacing.s2,
|
|
285
|
-
flexDirection: 'row' as const,
|
|
286
|
-
alignItems: 'center' as const,
|
|
287
|
-
gap: theme.spacing.spacing.s2,
|
|
288
|
-
height: 48,
|
|
289
|
-
alignSelf: 'stretch',
|
|
290
|
-
},
|
|
291
|
-
searchStyle?.containerStyle,
|
|
292
|
-
]}
|
|
278
|
+
|
|
279
|
+
<Pressable
|
|
280
|
+
onPress={onSearchBarClicked}
|
|
281
|
+
disabled={!onSearchBarClicked}
|
|
293
282
|
>
|
|
294
|
-
<
|
|
295
|
-
|
|
296
|
-
size={searchStyle?.iconStyle?.width || 24}
|
|
297
|
-
height={searchStyle?.iconStyle?.height || 24}
|
|
298
|
-
width={searchStyle?.iconStyle?.width || 24}
|
|
299
|
-
color={searchStyle?.iconStyle?.tintColor || theme.color.iconSecondary}
|
|
300
|
-
icon={searchStyle?.icon}
|
|
301
|
-
imageStyle={searchStyle?.iconStyle}
|
|
302
|
-
/>
|
|
303
|
-
<TextInput
|
|
304
|
-
ref={inputRef}
|
|
305
|
-
placeholder={searchPlaceholderText}
|
|
306
|
-
placeholderTextColor={
|
|
307
|
-
searchStyle?.placehodlerTextStyle?.color || theme.color.textTertiary
|
|
308
|
-
}
|
|
309
|
-
onChangeText={searchHandler}
|
|
310
|
-
onFocus={onSearchBarClicked}
|
|
311
|
-
returnKeyType='search'
|
|
312
|
-
value={searchInput}
|
|
313
|
-
onSubmitEditing={() => {
|
|
314
|
-
onSubmitEditing?.();
|
|
315
|
-
inputRef.current?.focus();
|
|
316
|
-
}}
|
|
317
|
-
submitBehavior='submit'
|
|
318
|
-
numberOfLines={1}
|
|
283
|
+
<View
|
|
284
|
+
pointerEvents={onSearchBarClicked ? 'none' : 'auto'}
|
|
319
285
|
style={[
|
|
320
286
|
{
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
paddingVertical:
|
|
325
|
-
|
|
287
|
+
backgroundColor: theme.color.background3,
|
|
288
|
+
borderRadius: theme.spacing.radius.max,
|
|
289
|
+
paddingHorizontal: theme.spacing.spacing.s3,
|
|
290
|
+
paddingVertical: theme.spacing.spacing.s3,
|
|
291
|
+
marginTop: theme.spacing.spacing.s2,
|
|
292
|
+
flexDirection: 'row' as const,
|
|
293
|
+
alignItems: 'center' as const,
|
|
294
|
+
gap: theme.spacing.spacing.s2,
|
|
295
|
+
height: 48,
|
|
296
|
+
alignSelf: 'stretch',
|
|
326
297
|
},
|
|
327
|
-
searchStyle?.
|
|
298
|
+
searchStyle?.containerStyle,
|
|
328
299
|
]}
|
|
329
|
-
|
|
330
|
-
|
|
300
|
+
>
|
|
301
|
+
<Icon
|
|
302
|
+
name='search-fill'
|
|
303
|
+
size={searchStyle?.iconStyle?.width || 24}
|
|
304
|
+
height={searchStyle?.iconStyle?.height || 24}
|
|
305
|
+
width={searchStyle?.iconStyle?.width || 24}
|
|
306
|
+
color={searchStyle?.iconStyle?.tintColor || theme.color.iconSecondary}
|
|
307
|
+
icon={searchStyle?.icon}
|
|
308
|
+
imageStyle={searchStyle?.iconStyle}
|
|
309
|
+
/>
|
|
310
|
+
<TextInput
|
|
311
|
+
ref={inputRef}
|
|
312
|
+
placeholder={searchPlaceholderText}
|
|
313
|
+
placeholderTextColor={
|
|
314
|
+
searchStyle?.placehodlerTextStyle?.color || theme.color.textTertiary
|
|
315
|
+
}
|
|
316
|
+
onChangeText={searchHandler}
|
|
317
|
+
returnKeyType='search'
|
|
318
|
+
value={searchInput}
|
|
319
|
+
editable={!onSearchBarClicked}
|
|
320
|
+
onSubmitEditing={() => {
|
|
321
|
+
onSubmitEditing?.();
|
|
322
|
+
inputRef.current?.focus();
|
|
323
|
+
}}
|
|
324
|
+
submitBehavior='submit'
|
|
325
|
+
numberOfLines={1}
|
|
326
|
+
style={[
|
|
327
|
+
{
|
|
328
|
+
flex: 1,
|
|
329
|
+
color: theme.color.textPrimary,
|
|
330
|
+
fontSize: 16,
|
|
331
|
+
paddingVertical: 4,
|
|
332
|
+
...theme.typography.heading4.regular,
|
|
333
|
+
},
|
|
334
|
+
searchStyle?.textStyle,
|
|
335
|
+
]}
|
|
336
|
+
/>
|
|
337
|
+
</View>
|
|
338
|
+
</Pressable>
|
|
331
339
|
)}
|
|
332
340
|
</View>
|
|
333
341
|
)}
|
|
@@ -105,7 +105,7 @@ export interface CometChatMessageInputInterface {
|
|
|
105
105
|
*/
|
|
106
106
|
export const CometChatMessageInput = (props: CometChatMessageInputInterface) => {
|
|
107
107
|
const theme = useTheme();
|
|
108
|
-
const {t}= useCometChatTranslation()
|
|
108
|
+
const { t } = useCometChatTranslation()
|
|
109
109
|
const {
|
|
110
110
|
text = "",
|
|
111
111
|
placeHolderText = t("ENTER_YOUR_MESSAGE_HERE"),
|
|
@@ -133,14 +133,15 @@ export const CometChatMessageInput = (props: CometChatMessageInputInterface) =>
|
|
|
133
133
|
placeholder={placeHolderText}
|
|
134
134
|
onSelectionChange={onSelectionChange}
|
|
135
135
|
selection={selection}
|
|
136
|
-
value={text}
|
|
137
136
|
onFocus={() => {
|
|
138
137
|
CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.hidePanel, {
|
|
139
138
|
alignment: ViewAlignment.composerBottom,
|
|
140
139
|
child: () => null, // Hide the panel content.
|
|
141
140
|
});
|
|
142
141
|
}}
|
|
143
|
-
|
|
142
|
+
>
|
|
143
|
+
{text}
|
|
144
|
+
</TextInput>
|
|
144
145
|
<View style={style?.dividerStyle as ViewStyle} />
|
|
145
146
|
<View
|
|
146
147
|
style={{
|
|
@@ -18,8 +18,8 @@ export const getQuickReactionStyleLight = (
|
|
|
18
18
|
emojiContainerStyle: {
|
|
19
19
|
backgroundColor: color.background3,
|
|
20
20
|
borderRadius: spacing.radius.max,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
minHeight: 40,
|
|
22
|
+
minWidth: 40,
|
|
23
23
|
justifyContent: 'center',
|
|
24
24
|
alignItems: 'center',
|
|
25
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { JSX, useLayoutEffect } from "react";
|
|
2
|
-
import { Text, TouchableOpacity, View } from "react-native";
|
|
2
|
+
import { PixelRatio, Text, TouchableOpacity, View } from "react-native";
|
|
3
3
|
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
4
4
|
import { MessageBubbleAlignmentType } from "../../base/Types";
|
|
5
5
|
import { CometChatTheme } from "../../../theme/type";
|
|
@@ -129,19 +129,25 @@ const CometChatReactions = (props: CometChatReactionsInterface) => {
|
|
|
129
129
|
useLayoutEffect(() => {
|
|
130
130
|
reactionRef.current = messageObject?.getReactions()!;
|
|
131
131
|
let countEmoji = maxContentWidth ? 0 : 3;
|
|
132
|
+
|
|
133
|
+
// Scale width estimates by the system font scale so that when the user
|
|
134
|
+
// increases the device font/display size the layout calculation still
|
|
135
|
+
// fits reactions correctly and avoids cropping.
|
|
136
|
+
const fontScale = PixelRatio.getFontScale();
|
|
137
|
+
|
|
132
138
|
if (maxContentWidth) {
|
|
133
139
|
let remainingWidth = maxContentWidth;
|
|
134
140
|
for (let i = 0; i < reactionRef.current.length; i++) {
|
|
135
141
|
const currentReactionCount = reactionRef.current[i].getCount();
|
|
136
142
|
let widthToReduce = 0;
|
|
137
143
|
if (currentReactionCount < 10) {
|
|
138
|
-
widthToReduce = 45;
|
|
144
|
+
widthToReduce = 45 * fontScale;
|
|
139
145
|
} else if (currentReactionCount < 100) {
|
|
140
|
-
widthToReduce = 55;
|
|
146
|
+
widthToReduce = 55 * fontScale;
|
|
141
147
|
} else if (currentReactionCount < 1000) {
|
|
142
|
-
widthToReduce = 65;
|
|
148
|
+
widthToReduce = 65 * fontScale;
|
|
143
149
|
}
|
|
144
|
-
if (remainingWidth > 30 + widthToReduce) {
|
|
150
|
+
if (remainingWidth > 30 * fontScale + widthToReduce) {
|
|
145
151
|
remainingWidth = remainingWidth - widthToReduce;
|
|
146
152
|
countEmoji++;
|
|
147
153
|
continue;
|