@developer_tribe/react-native-comnyx 0.12.15 → 0.13.2
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/android/generated/RCTAppDependencyProvider.h +25 -0
- package/android/generated/RCTAppDependencyProvider.mm +55 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/android/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/android/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/android/generated/ReactAppDependencyProvider.podspec +34 -0
- package/android/generated/java/com/comnyx/NativeComnyxSpec.java +46 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNComnyxSpec-generated.cpp +44 -0
- package/android/generated/jni/RNComnyxSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +38 -0
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +89 -0
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/ios/generated/RNComnyxSpec/RNComnyxSpec-generated.mm +53 -0
- package/ios/generated/RNComnyxSpec/RNComnyxSpec.h +67 -0
- package/ios/generated/RNComnyxSpecJSI-generated.cpp +38 -0
- package/ios/generated/RNComnyxSpecJSI.h +89 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/lib/commonjs/components/ChatList.js +53 -125
- package/lib/commonjs/components/ChatList.js.map +1 -1
- package/lib/commonjs/constants/translations.js +58 -0
- package/lib/commonjs/constants/translations.js.map +1 -1
- package/lib/commonjs/hooks/usePolling.js.map +1 -1
- package/lib/commonjs/register/Accumulator.js.map +1 -1
- package/lib/commonjs/store/store.js +2 -3
- package/lib/commonjs/store/store.js.map +1 -1
- package/lib/commonjs/utils/formatDate.js +30 -9
- package/lib/commonjs/utils/formatDate.js.map +1 -1
- package/lib/commonjs/utils/mmkvStorage.js +40 -0
- package/lib/commonjs/utils/mmkvStorage.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/components/ChatList.js +54 -126
- package/lib/module/components/ChatList.js.map +1 -1
- package/lib/module/constants/translations.js +58 -0
- package/lib/module/constants/translations.js.map +1 -1
- package/lib/module/hooks/usePolling.js.map +1 -1
- package/lib/module/register/Accumulator.js.map +1 -1
- package/lib/module/store/store.js +2 -2
- package/lib/module/store/store.js.map +1 -1
- package/lib/module/utils/formatDate.js +28 -8
- package/lib/module/utils/formatDate.js.map +1 -1
- package/lib/module/utils/mmkvStorage.js +36 -0
- package/lib/module/utils/mmkvStorage.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/src/NativeComnyx.d.ts +1 -1
- package/lib/typescript/src/NativeComnyx.d.ts.map +1 -1
- package/lib/typescript/src/api/conversations.d.ts +1 -1
- package/lib/typescript/src/api/conversations.d.ts.map +1 -1
- package/lib/typescript/src/components/AppText.d.ts +1 -1
- package/lib/typescript/src/components/AppText.d.ts.map +1 -1
- package/lib/typescript/src/components/ChatList.d.ts.map +1 -1
- package/lib/typescript/src/constants/translations.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useListenNativeTokenForDebug.d.ts +1 -1
- package/lib/typescript/src/hooks/useListenNativeTokenForDebug.d.ts.map +1 -1
- package/lib/typescript/src/register/Accumulator.d.ts +1 -1
- package/lib/typescript/src/register/Accumulator.d.ts.map +1 -1
- package/lib/typescript/src/store/store.d.ts.map +1 -1
- package/lib/typescript/src/types/LocalizationKeys.d.ts +2 -0
- package/lib/typescript/src/types/LocalizationKeys.d.ts.map +1 -1
- package/lib/typescript/src/utils/formatDate.d.ts +1 -0
- package/lib/typescript/src/utils/formatDate.d.ts.map +1 -1
- package/lib/typescript/src/utils/mmkvStorage.d.ts +3 -0
- package/lib/typescript/src/utils/mmkvStorage.d.ts.map +1 -0
- package/lib/typescript/src/version.d.ts +1 -1
- package/lib/typescript/src/version.d.ts.map +1 -1
- package/package.json +19 -10
- package/src/components/ChatList.tsx +101 -174
- package/src/constants/translations.ts +58 -0
- package/src/hooks/usePolling.ts +1 -1
- package/src/register/Accumulator.ts +1 -1
- package/src/store/store.ts +2 -2
- package/src/types/LocalizationKeys.ts +2 -0
- package/src/utils/formatDate.ts +46 -9
- package/src/utils/mmkvStorage.ts +37 -0
- package/src/version.ts +1 -1
- package/lib/typescript/jest.config.d.ts +0 -4
- package/lib/typescript/jest.config.d.ts.map +0 -1
|
@@ -36,6 +36,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
36
36
|
'chat.empty.description': "The team's message will be displayed here.",
|
|
37
37
|
'chat.live': 'Live Chat',
|
|
38
38
|
'chat.support-team': 'Support Team',
|
|
39
|
+
'chat.date.today': 'Today',
|
|
40
|
+
'chat.date.yesterday': 'Yesterday',
|
|
39
41
|
'customer.form.resend': 'Resend',
|
|
40
42
|
'chat.list-failed-message.title': 'Failed to send',
|
|
41
43
|
'chat.list-failed-message.description':
|
|
@@ -89,6 +91,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
89
91
|
'chat.empty.description': 'Ekibin mesajları burada görüntülenecek.',
|
|
90
92
|
'chat.live': 'Canlı Sohbet',
|
|
91
93
|
'chat.support-team': 'Destek Ekibi',
|
|
94
|
+
'chat.date.today': 'Bugün',
|
|
95
|
+
'chat.date.yesterday': 'Dün',
|
|
92
96
|
'customer.form.resend': 'Yeniden Gönder',
|
|
93
97
|
'chat.list-failed-message.title': 'Gönderilemedi',
|
|
94
98
|
'chat.list-failed-message.description':
|
|
@@ -142,6 +146,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
142
146
|
'chat.empty.description': 'Los mensajes del equipo se mostrarán aquí.',
|
|
143
147
|
'chat.live': 'Chat en Vivo',
|
|
144
148
|
'chat.support-team': 'Equipo de Soporte',
|
|
149
|
+
'chat.date.today': 'Hoy',
|
|
150
|
+
'chat.date.yesterday': 'Ayer',
|
|
145
151
|
'customer.form.resend': 'Reenviar',
|
|
146
152
|
'chat.list-failed-message.title': 'Error al enviar',
|
|
147
153
|
'chat.list-failed-message.description':
|
|
@@ -199,6 +205,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
199
205
|
'chat.empty.description': "Les messages de l'équipe seront affichés ici.",
|
|
200
206
|
'chat.live': 'Chat en Direct',
|
|
201
207
|
'chat.support-team': 'Équipe de Support',
|
|
208
|
+
'chat.date.today': "Aujourd'hui",
|
|
209
|
+
'chat.date.yesterday': 'Hier',
|
|
202
210
|
'customer.form.resend': 'Renvoyer',
|
|
203
211
|
'chat.list-failed-message.title': "Échec de l'envoi",
|
|
204
212
|
'chat.list-failed-message.description':
|
|
@@ -256,6 +264,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
256
264
|
'Die Nachrichten des Teams werden hier angezeigt.',
|
|
257
265
|
'chat.live': 'Live-Chat',
|
|
258
266
|
'chat.support-team': 'Support-Team',
|
|
267
|
+
'chat.date.today': 'Heute',
|
|
268
|
+
'chat.date.yesterday': 'Gestern',
|
|
259
269
|
'customer.form.resend': 'Erneut senden',
|
|
260
270
|
'chat.list-failed-message.title': 'Senden fehlgeschlagen',
|
|
261
271
|
'chat.list-failed-message.description':
|
|
@@ -310,6 +320,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
310
320
|
'chat.empty.description': 'I messaggi del team saranno visualizzati qui.',
|
|
311
321
|
'chat.live': 'Chat dal Vivo',
|
|
312
322
|
'chat.support-team': 'Team di Supporto',
|
|
323
|
+
'chat.date.today': 'Oggi',
|
|
324
|
+
'chat.date.yesterday': 'Ieri',
|
|
313
325
|
'customer.form.resend': 'Rinvia',
|
|
314
326
|
'chat.list-failed-message.title': 'Invio fallito',
|
|
315
327
|
'chat.list-failed-message.description':
|
|
@@ -366,6 +378,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
366
378
|
'chat.empty.description': 'As mensaggi da equipe serão exibidas aqui.',
|
|
367
379
|
'chat.live': 'Chat ao Vivo',
|
|
368
380
|
'chat.support-team': 'Equipe de Suporte',
|
|
381
|
+
'chat.date.today': 'Hoje',
|
|
382
|
+
'chat.date.yesterday': 'Ontem',
|
|
369
383
|
'customer.form.resend': 'Reenviar',
|
|
370
384
|
'chat.list-failed-message.title': 'Falha ao enviar',
|
|
371
385
|
'chat.list-failed-message.description':
|
|
@@ -423,6 +437,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
423
437
|
'chat.empty.description': 'Сообщения команды будут отображаться здесь.',
|
|
424
438
|
'chat.live': 'Живой Чат',
|
|
425
439
|
'chat.support-team': 'Служба Поддержки',
|
|
440
|
+
'chat.date.today': 'Сегодня',
|
|
441
|
+
'chat.date.yesterday': 'Вчера',
|
|
426
442
|
'customer.form.resend': 'Отправить повторно',
|
|
427
443
|
'chat.list-failed-message.title': 'Не удалось отправить',
|
|
428
444
|
'chat.list-failed-message.description':
|
|
@@ -477,6 +493,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
477
493
|
'chat.empty.description': 'チームからのメッセージがここに表示されます。',
|
|
478
494
|
'chat.live': 'ライブチャット',
|
|
479
495
|
'chat.support-team': 'サポートチーム',
|
|
496
|
+
'chat.date.today': '今日',
|
|
497
|
+
'chat.date.yesterday': '昨日',
|
|
480
498
|
'customer.form.resend': '再送信',
|
|
481
499
|
'chat.list-failed-message.title': '送信に失敗しました',
|
|
482
500
|
'chat.list-failed-message.description':
|
|
@@ -526,6 +544,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
526
544
|
'chat.empty.description': '团队的消息将显示在这里。',
|
|
527
545
|
'chat.live': '在线聊天',
|
|
528
546
|
'chat.support-team': '支持团队',
|
|
547
|
+
'chat.date.today': '今天',
|
|
548
|
+
'chat.date.yesterday': '昨天',
|
|
529
549
|
'customer.form.resend': '重新发送',
|
|
530
550
|
'chat.list-failed-message.title': '发送失败',
|
|
531
551
|
'chat.list-failed-message.description': '消息无法发送。请重试。',
|
|
@@ -576,6 +596,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
576
596
|
'chat.empty.description': 'ستظهر رسائل الفريق هنا.',
|
|
577
597
|
'chat.live': 'دردشة مباشرة',
|
|
578
598
|
'chat.support-team': 'فريق الدعم',
|
|
599
|
+
'chat.date.today': 'اليوم',
|
|
600
|
+
'chat.date.yesterday': 'أمس',
|
|
579
601
|
'customer.form.resend': 'إعادة الإرسال',
|
|
580
602
|
'chat.list-failed-message.title': 'فشل الإرسال',
|
|
581
603
|
'chat.list-failed-message.description':
|
|
@@ -628,6 +650,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
628
650
|
'chat.empty.description': 'Mesej pasukan akan dipaparkan di sini.',
|
|
629
651
|
'chat.live': 'Sembang Langsung',
|
|
630
652
|
'chat.support-team': 'Pasukan Sokongan',
|
|
653
|
+
'chat.date.today': 'Hari ini',
|
|
654
|
+
'chat.date.yesterday': 'Kemarin',
|
|
631
655
|
'customer.form.resend': 'Hantar Semula',
|
|
632
656
|
'chat.list-failed-message.title': 'Gagal menghantar',
|
|
633
657
|
'chat.list-failed-message.description':
|
|
@@ -679,6 +703,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
679
703
|
'chat.empty.description': 'Tin nhắn của nhóm sẽ hiển thị ở đây.',
|
|
680
704
|
'chat.live': 'Trò chuyện trực tiếp',
|
|
681
705
|
'chat.support-team': 'Đội hỗ trợ',
|
|
706
|
+
'chat.date.today': 'Hôm nay',
|
|
707
|
+
'chat.date.yesterday': 'Hôm qua',
|
|
682
708
|
'customer.form.resend': 'Gửi lại',
|
|
683
709
|
'chat.list-failed-message.title': 'Gửi thất bại',
|
|
684
710
|
'chat.list-failed-message.description':
|
|
@@ -732,6 +758,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
732
758
|
'chat.empty.description': 'Teamets meddelanden visas här.',
|
|
733
759
|
'chat.live': 'Direktchatt',
|
|
734
760
|
'chat.support-team': 'Supportteam',
|
|
761
|
+
'chat.date.today': 'Idag',
|
|
762
|
+
'chat.date.yesterday': 'Igår',
|
|
735
763
|
'customer.form.resend': 'Skicka igen',
|
|
736
764
|
'chat.list-failed-message.title': 'Misslyckades att skicka',
|
|
737
765
|
'chat.list-failed-message.description':
|
|
@@ -781,6 +809,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
781
809
|
'chat.empty.description': '팀의 메시지가 여기에 표시됩니다.',
|
|
782
810
|
'chat.live': '라이브 채팅',
|
|
783
811
|
'chat.support-team': '지원 팀',
|
|
812
|
+
'chat.date.today': '오늘',
|
|
813
|
+
'chat.date.yesterday': '어제',
|
|
784
814
|
'customer.form.resend': '다시 보내기',
|
|
785
815
|
'chat.list-failed-message.title': '전송 실패',
|
|
786
816
|
'chat.list-failed-message.description':
|
|
@@ -835,6 +865,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
835
865
|
'chat.empty.description': 'टीम के संदेश यहाँ दिखाए जाएंगे।',
|
|
836
866
|
'chat.live': 'जिव चैट',
|
|
837
867
|
'chat.support-team': 'सपोर्ट टीम',
|
|
868
|
+
'chat.date.today': 'आज',
|
|
869
|
+
'chat.date.yesterday': 'कल',
|
|
838
870
|
'customer.form.resend': 'पुनः भेजें',
|
|
839
871
|
'chat.list-failed-message.title': 'भेजने में विफल',
|
|
840
872
|
'chat.list-failed-message.description':
|
|
@@ -888,6 +920,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
888
920
|
'chat.empty.description': 'Berichten van het team worden hier weergegeven.',
|
|
889
921
|
'chat.live': 'Live Chat',
|
|
890
922
|
'chat.support-team': 'Supportteam',
|
|
923
|
+
'chat.date.today': 'Vandaag',
|
|
924
|
+
'chat.date.yesterday': 'Gisteren',
|
|
891
925
|
'customer.form.resend': 'Opnieuw verzenden',
|
|
892
926
|
'chat.list-failed-message.title': 'Verzenden mislukt',
|
|
893
927
|
'chat.list-failed-message.description':
|
|
@@ -938,6 +972,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
938
972
|
'chat.empty.description': 'הודעות הצוות יופיעו כאן.',
|
|
939
973
|
'chat.live': 'צ׳אט חי',
|
|
940
974
|
'chat.support-team': 'צוות תמיכה',
|
|
975
|
+
'chat.date.today': 'היום',
|
|
976
|
+
'chat.date.yesterday': 'אתמול',
|
|
941
977
|
'customer.form.resend': 'שלח שוב',
|
|
942
978
|
'chat.list-failed-message.title': 'שליחה נכשלה',
|
|
943
979
|
'chat.list-failed-message.description': 'הודעה לא נשלחה. אנא נסה שוב.',
|
|
@@ -991,6 +1027,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
991
1027
|
'chat.empty.description': 'Команда повідомлень зʼявиться тут.',
|
|
992
1028
|
'chat.live': 'Онлайн чат',
|
|
993
1029
|
'chat.support-team': 'Команда підтримки',
|
|
1030
|
+
'chat.date.today': 'Сьогодні',
|
|
1031
|
+
'chat.date.yesterday': 'Вчора',
|
|
994
1032
|
'customer.form.resend': 'Надіслати знову',
|
|
995
1033
|
'chat.list-failed-message.title': 'Не вдалося надіслати',
|
|
996
1034
|
'chat.list-failed-message.description':
|
|
@@ -1046,6 +1084,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
1046
1084
|
'chat.empty.description': 'Együttes üzenetei itt láthatók.',
|
|
1047
1085
|
'chat.live': 'Élő csevegés',
|
|
1048
1086
|
'chat.support-team': 'Támogató csapat',
|
|
1087
|
+
'chat.date.today': 'Ma',
|
|
1088
|
+
'chat.date.yesterday': 'Tegnap',
|
|
1049
1089
|
'customer.form.resend': 'Újraküldés',
|
|
1050
1090
|
'chat.list-failed-message.title': 'Küldés sikertelen',
|
|
1051
1091
|
'chat.list-failed-message.description':
|
|
@@ -1101,6 +1141,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
1101
1141
|
'chat.empty.description': 'Mesajele echipei vor fi afișate aici.',
|
|
1102
1142
|
'chat.live': 'Chat live',
|
|
1103
1143
|
'chat.support-team': 'Echipa de suport',
|
|
1144
|
+
'chat.date.today': 'Astăzi',
|
|
1145
|
+
'chat.date.yesterday': 'Ieri',
|
|
1104
1146
|
'customer.form.resend': 'Trimite din nou',
|
|
1105
1147
|
'chat.list-failed-message.title': 'Trimitere eșuată',
|
|
1106
1148
|
'chat.list-failed-message.description':
|
|
@@ -1154,6 +1196,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
1154
1196
|
'chat.empty.description': 'Mesej pasukan akan dipaparkan di sini.',
|
|
1155
1197
|
'chat.live': 'Sembang Langsung',
|
|
1156
1198
|
'chat.support-team': 'Pasukan Sokongan',
|
|
1199
|
+
'chat.date.today': 'Hari ini',
|
|
1200
|
+
'chat.date.yesterday': 'Semalam',
|
|
1157
1201
|
'customer.form.resend': 'Hantar Semula',
|
|
1158
1202
|
'chat.list-failed-message.title': 'Gagal menghantar',
|
|
1159
1203
|
'chat.list-failed-message.description':
|
|
@@ -1206,6 +1250,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
1206
1250
|
'chat.empty.description': 'Komanda mesajları burada görünəcək.',
|
|
1207
1251
|
'chat.live': 'Canlı Çat',
|
|
1208
1252
|
'chat.support-team': 'Dəstək Komandası',
|
|
1253
|
+
'chat.date.today': 'Bu gün',
|
|
1254
|
+
'chat.date.yesterday': 'Dünən',
|
|
1209
1255
|
'customer.form.resend': 'Təkrar Göndər',
|
|
1210
1256
|
'chat.list-failed-message.title': 'Göndərmə uğursuz oldu',
|
|
1211
1257
|
'chat.list-failed-message.description':
|
|
@@ -1258,6 +1304,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
1258
1304
|
'chat.empty.description': 'Poruke tima će se pojaviti ovdje.',
|
|
1259
1305
|
'chat.live': 'Live Chat',
|
|
1260
1306
|
'chat.support-team': 'Tim za podršku',
|
|
1307
|
+
'chat.date.today': 'Danas',
|
|
1308
|
+
'chat.date.yesterday': 'Jučer',
|
|
1261
1309
|
'customer.form.resend': 'Pošalji ponovo',
|
|
1262
1310
|
'chat.list-failed-message.title': 'Slanje nije uspjelo',
|
|
1263
1311
|
'chat.list-failed-message.description':
|
|
@@ -1311,6 +1359,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
1311
1359
|
'chat.empty.description': 'Команданың хабарламалары осында көрсетіледі.',
|
|
1312
1360
|
'chat.live': 'Тікелей чат',
|
|
1313
1361
|
'chat.support-team': 'Қолдау тобы',
|
|
1362
|
+
'chat.date.today': 'Бүгін',
|
|
1363
|
+
'chat.date.yesterday': 'Кеше',
|
|
1314
1364
|
'customer.form.resend': 'Қайта жіберу',
|
|
1315
1365
|
'chat.list-failed-message.title': 'Жіберілмеді',
|
|
1316
1366
|
'chat.list-failed-message.description':
|
|
@@ -1364,6 +1414,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
1364
1414
|
'chat.empty.description': 'Spanboodskappe sal hier verskyn.',
|
|
1365
1415
|
'chat.live': 'Regstreekse Klets',
|
|
1366
1416
|
'chat.support-team': 'Ondersteuningspan',
|
|
1417
|
+
'chat.date.today': 'Vandag',
|
|
1418
|
+
'chat.date.yesterday': 'Gister',
|
|
1367
1419
|
'customer.form.resend': 'Stuur Oor',
|
|
1368
1420
|
'chat.list-failed-message.title': 'Stuur het misluk',
|
|
1369
1421
|
'chat.list-failed-message.description':
|
|
@@ -1416,6 +1468,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
1416
1468
|
'chat.empty.description': 'Ìrántí ẹgbẹ́ yóò hàn níbí.',
|
|
1417
1469
|
'chat.live': 'Jíròrò Láìpẹ́',
|
|
1418
1470
|
'chat.support-team': 'Ẹgbẹ́ Atilẹ́yin',
|
|
1471
|
+
'chat.date.today': 'Lónìí',
|
|
1472
|
+
'chat.date.yesterday': 'Àná',
|
|
1419
1473
|
'customer.form.resend': 'Ránṣé̀ Padà',
|
|
1420
1474
|
'chat.list-failed-message.title': 'Ránṣé̀ kò rọrùn',
|
|
1421
1475
|
'chat.list-failed-message.description': 'A kòlẹ̀ ránṣé̀. Jọ̀wọ́, tún gbìyànjú.',
|
|
@@ -1467,6 +1521,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
1467
1521
|
'chat.empty.description': 'Holdets beskeder vises her.',
|
|
1468
1522
|
'chat.live': 'Live Chat',
|
|
1469
1523
|
'chat.support-team': 'Supportteam',
|
|
1524
|
+
'chat.date.today': 'I dag',
|
|
1525
|
+
'chat.date.yesterday': 'I går',
|
|
1470
1526
|
'customer.form.resend': 'Send igen',
|
|
1471
1527
|
'chat.list-failed-message.title': 'Afsendelse mislykkedes',
|
|
1472
1528
|
'chat.list-failed-message.description':
|
|
@@ -1519,6 +1575,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
|
|
|
1519
1575
|
'chat.empty.description': 'Wiadomości zespołu pojawią się tutaj.',
|
|
1520
1576
|
'chat.live': 'Czat na żywo',
|
|
1521
1577
|
'chat.support-team': 'Zespół wsparcia',
|
|
1578
|
+
'chat.date.today': 'Dziś',
|
|
1579
|
+
'chat.date.yesterday': 'Wczoraj',
|
|
1522
1580
|
'customer.form.resend': 'Wyślij ponownie',
|
|
1523
1581
|
'chat.list-failed-message.title': 'Nie udało się wysłać',
|
|
1524
1582
|
'chat.list-failed-message.description':
|
package/src/hooks/usePolling.ts
CHANGED
|
@@ -13,7 +13,7 @@ export function usePolling() {
|
|
|
13
13
|
const lastMessage = data ? data[data.length - 1] : null;
|
|
14
14
|
useEffect(() => {
|
|
15
15
|
const created_at = lastMessage?.created_at;
|
|
16
|
-
let interval:
|
|
16
|
+
let interval: ReturnType<typeof setInterval> | null = null;
|
|
17
17
|
if (customer && created_at) {
|
|
18
18
|
interval = setInterval(() => {
|
|
19
19
|
getNewCustomerConversation(customer?.external_id, created_at, {
|
|
@@ -4,7 +4,7 @@ const ACCUMULATOR_DEBOUNCE_TIME_IN_MS = 3000;
|
|
|
4
4
|
|
|
5
5
|
export class Accumulator {
|
|
6
6
|
private registerData: CreateCustomerRequest | null = null;
|
|
7
|
-
private __select_time:
|
|
7
|
+
private __select_time: ReturnType<typeof setTimeout> | undefined = undefined;
|
|
8
8
|
private listener: ((data: CreateCustomerRequest) => Promise<void>) | null =
|
|
9
9
|
null;
|
|
10
10
|
private _isListenerCalledOnce: boolean = false;
|
package/src/store/store.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { createJSONStorage, persist } from 'zustand/middleware';
|
|
|
2
2
|
import { shallow } from 'zustand/shallow';
|
|
3
3
|
import { createWithEqualityFn } from 'zustand/traditional';
|
|
4
4
|
import type { StateCreator } from 'zustand';
|
|
5
|
-
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
6
5
|
import type { AppConversationMessage } from '../types/Conversation';
|
|
7
6
|
import type { LanguageCode } from '../types/Language';
|
|
8
7
|
import type { Customer } from '../types/Customer';
|
|
9
8
|
import type { LocalizationKeys } from '../types/LocalizationKeys';
|
|
9
|
+
import { mmkvStorage } from '../utils/mmkvStorage';
|
|
10
10
|
|
|
11
11
|
interface AppStoreState {
|
|
12
12
|
baseHeight: number;
|
|
@@ -115,7 +115,7 @@ export const storeCreator: StateCreator<AppStoreState> = (set, get) => ({
|
|
|
115
115
|
export const useAppStore = createWithEqualityFn<AppStoreState>()(
|
|
116
116
|
persist(storeCreator, {
|
|
117
117
|
name: 'commonyx_appStore-12',
|
|
118
|
-
storage: createJSONStorage(() =>
|
|
118
|
+
storage: createJSONStorage(() => mmkvStorage),
|
|
119
119
|
skipHydration: false,
|
|
120
120
|
partialize: (state) => ({
|
|
121
121
|
customer: state.customer,
|
|
@@ -27,6 +27,8 @@ export type LocalizationKeys = {
|
|
|
27
27
|
'chat.empty.description': string;
|
|
28
28
|
'chat.live': string;
|
|
29
29
|
'chat.support-team': string;
|
|
30
|
+
'chat.date.today': string;
|
|
31
|
+
'chat.date.yesterday': string;
|
|
30
32
|
'customer.form.resend': string;
|
|
31
33
|
'chat.list-failed-message.title': string;
|
|
32
34
|
'chat.list-failed-message.description': string;
|
package/src/utils/formatDate.ts
CHANGED
|
@@ -1,13 +1,50 @@
|
|
|
1
|
+
import { LocalizationList } from '../constants/translations';
|
|
2
|
+
import type { LanguageCode } from '../types/Language';
|
|
3
|
+
|
|
4
|
+
const MS_PER_DAY = 24 * 60 * 60 * 1000;
|
|
5
|
+
|
|
6
|
+
const toStartOfDay = (value: Date) =>
|
|
7
|
+
new Date(value.getFullYear(), value.getMonth(), value.getDate());
|
|
8
|
+
|
|
9
|
+
export const getDateKey = (date?: Date | null): string => {
|
|
10
|
+
if (!date) {
|
|
11
|
+
return '';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const year = date.getFullYear();
|
|
15
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
16
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
17
|
+
|
|
18
|
+
return `${year}-${month}-${day}`;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const resolveLocalization = (language: string) =>
|
|
22
|
+
LocalizationList[language as LanguageCode] ?? LocalizationList.en;
|
|
23
|
+
|
|
1
24
|
export const formatDate = (language: string, date?: Date | null): string => {
|
|
2
|
-
if (!date)
|
|
3
|
-
|
|
4
|
-
try {
|
|
5
|
-
return date.toLocaleDateString(language, {
|
|
6
|
-
weekday: 'short',
|
|
7
|
-
month: 'short',
|
|
8
|
-
day: 'numeric',
|
|
9
|
-
});
|
|
10
|
-
} catch (error) {
|
|
25
|
+
if (!date) {
|
|
11
26
|
return '';
|
|
12
27
|
}
|
|
28
|
+
|
|
29
|
+
const localization = resolveLocalization(language);
|
|
30
|
+
const today = toStartOfDay(new Date());
|
|
31
|
+
const targetDate = toStartOfDay(date);
|
|
32
|
+
|
|
33
|
+
const diffInDays = Math.round(
|
|
34
|
+
(today.getTime() - targetDate.getTime()) / MS_PER_DAY
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
if (diffInDays === 0) {
|
|
38
|
+
return localization['chat.date.today'] ?? 'Today';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (diffInDays === 1) {
|
|
42
|
+
return localization['chat.date.yesterday'] ?? 'Yesterday';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const day = String(targetDate.getDate()).padStart(2, '0');
|
|
46
|
+
const month = String(targetDate.getMonth() + 1).padStart(2, '0');
|
|
47
|
+
const year = targetDate.getFullYear();
|
|
48
|
+
|
|
49
|
+
return `${day}.${month}.${year}`;
|
|
13
50
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MMKV } from 'react-native-mmkv';
|
|
2
|
+
import type { StateStorage } from 'zustand/middleware';
|
|
3
|
+
|
|
4
|
+
let storage: MMKV | null = null;
|
|
5
|
+
|
|
6
|
+
const getStorage = (): MMKV => {
|
|
7
|
+
if (!storage) {
|
|
8
|
+
storage = new MMKV();
|
|
9
|
+
}
|
|
10
|
+
return storage;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const mmkvStorage: StateStorage = {
|
|
14
|
+
getItem: (name: string): string | null => {
|
|
15
|
+
try {
|
|
16
|
+
const value = getStorage().getString(name);
|
|
17
|
+
return value ?? null;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
console.warn('MMKV getItem error:', error);
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
setItem: (name: string, value: string): void => {
|
|
24
|
+
try {
|
|
25
|
+
getStorage().set(name, value);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.warn('MMKV setItem error:', error);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
removeItem: (name: string): void => {
|
|
31
|
+
try {
|
|
32
|
+
getStorage().delete(name);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.warn('MMKV removeItem error:', error);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
};
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated. Do not edit manually.
|
|
2
|
-
export const VERSION = '0.
|
|
2
|
+
export const VERSION = '0.13.2';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../../jest.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,oBAkBjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|