@developer_tribe/react-native-comnyx 0.7.6 → 0.9.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.
- package/android/build.gradle +12 -6
- 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/jni/RNComnyxSpec-generated.cpp +1 -11
- package/android/generated/jni/RNComnyxSpec.h +0 -7
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +0 -11
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +0 -52
- package/android/src/main/java/com/comnyx/ComnyxModule.kt +75 -7
- package/android/src/main/java/com/comnyx/ComnyxPackage.kt +0 -3
- package/android/src/main/java/com/comnyx/src/messaging/firebase/FirebaseMessagingService.kt +1 -9
- package/android/src/main/java/com/comnyx/src/messaging/notifications/NotificationsService.kt +105 -8
- package/ios/Comnyx.m +2 -2
- package/ios/Comnyx.swift +83 -20
- 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 +0 -23
- package/ios/generated/RNComnyxSpec/RNComnyxSpec.h +0 -25
- package/ios/generated/RNComnyxSpecJSI-generated.cpp +0 -11
- package/ios/generated/RNComnyxSpecJSI.h +0 -52
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/lib/commonjs/NativeComnyx.js.map +1 -1
- package/lib/commonjs/api/api.js +4 -0
- package/lib/commonjs/api/api.js.map +1 -1
- package/lib/commonjs/components/ChatList.js +100 -106
- package/lib/commonjs/components/ChatList.js.map +1 -1
- package/lib/commonjs/components/CustomerForm.js +173 -179
- package/lib/commonjs/components/CustomerForm.js.map +1 -1
- package/lib/commonjs/components/EmptyList.js +5 -7
- package/lib/commonjs/components/EmptyList.js.map +1 -1
- package/lib/commonjs/constants/translations.js +145 -29
- package/lib/commonjs/constants/translations.js.map +1 -1
- package/lib/commonjs/hooks/useLocalize.js +7 -0
- package/lib/commonjs/hooks/useLocalize.js.map +1 -1
- package/lib/commonjs/notifications/index.js +2 -1
- package/lib/commonjs/notifications/index.js.map +1 -1
- package/lib/commonjs/notifications/initializeNotifications.js +137 -0
- package/lib/commonjs/notifications/initializeNotifications.js.map +1 -0
- package/lib/commonjs/register/login.js +1 -1
- package/lib/commonjs/register/login.js.map +1 -1
- package/lib/commonjs/store/store.js +14 -1
- package/lib/commonjs/store/store.js.map +1 -1
- package/lib/module/NativeComnyx.js.map +1 -1
- package/lib/module/api/api.js +3 -0
- package/lib/module/api/api.js.map +1 -1
- package/lib/module/components/ChatList.js +101 -107
- package/lib/module/components/ChatList.js.map +1 -1
- package/lib/module/components/CustomerForm.js +174 -180
- package/lib/module/components/CustomerForm.js.map +1 -1
- package/lib/module/components/EmptyList.js +6 -8
- package/lib/module/components/EmptyList.js.map +1 -1
- package/lib/module/constants/translations.js +145 -29
- package/lib/module/constants/translations.js.map +1 -1
- package/lib/module/hooks/useLocalize.js +6 -0
- package/lib/module/hooks/useLocalize.js.map +1 -1
- package/lib/module/notifications/index.js +2 -1
- package/lib/module/notifications/index.js.map +1 -1
- package/lib/module/notifications/initializeNotifications.js +133 -0
- package/lib/module/notifications/initializeNotifications.js.map +1 -0
- package/lib/module/register/login.js +1 -1
- package/lib/module/register/login.js.map +1 -1
- package/lib/module/store/store.js +14 -1
- package/lib/module/store/store.js.map +1 -1
- package/lib/typescript/src/NativeComnyx.d.ts +6 -1
- package/lib/typescript/src/NativeComnyx.d.ts.map +1 -1
- package/lib/typescript/src/api/api.d.ts +1 -0
- package/lib/typescript/src/api/api.d.ts.map +1 -1
- package/lib/typescript/src/components/ChatList.d.ts.map +1 -1
- package/lib/typescript/src/components/CustomerForm.d.ts.map +1 -1
- package/lib/typescript/src/components/EmptyList.d.ts.map +1 -1
- package/lib/typescript/src/constants/translations.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useLocalize.d.ts +1 -0
- package/lib/typescript/src/hooks/useLocalize.d.ts.map +1 -1
- package/lib/typescript/src/notifications/index.d.ts +63 -4
- package/lib/typescript/src/notifications/index.d.ts.map +1 -1
- package/lib/typescript/src/notifications/initializeNotifications.d.ts +7 -0
- package/lib/typescript/src/notifications/initializeNotifications.d.ts.map +1 -0
- package/lib/typescript/src/store/store.d.ts +4 -0
- package/lib/typescript/src/store/store.d.ts.map +1 -1
- package/lib/typescript/src/types/Customer.d.ts +5 -0
- package/lib/typescript/src/types/Customer.d.ts.map +1 -1
- package/lib/typescript/src/types/LocalizationKeys.d.ts +4 -0
- package/lib/typescript/src/types/LocalizationKeys.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/NativeComnyx.ts +6 -1
- package/src/api/api.ts +4 -0
- package/src/components/ChatList.tsx +110 -123
- package/src/components/CustomerForm.tsx +194 -212
- package/src/components/EmptyList.tsx +3 -10
- package/src/constants/translations.ts +145 -0
- package/src/hooks/useLocalize.ts +6 -0
- package/src/notifications/index.ts +69 -5
- package/src/notifications/initializeNotifications.ts +180 -0
- package/src/register/login.ts +1 -1
- package/src/store/store.ts +13 -0
- package/src/types/Customer.ts +5 -0
- package/src/types/LocalizationKeys.ts +4 -0
- package/android/generated/java/com/comnyx/NativeComnyxSpec.java +0 -37
- package/lib/typescript/setup-jest.d.ts +0 -1
- package/lib/typescript/setup-jest.d.ts.map +0 -1
|
@@ -8,8 +8,6 @@ import {
|
|
|
8
8
|
TouchableOpacity,
|
|
9
9
|
Keyboard,
|
|
10
10
|
StatusBar,
|
|
11
|
-
KeyboardAvoidingView,
|
|
12
|
-
Platform,
|
|
13
11
|
} from 'react-native';
|
|
14
12
|
import { getCustomerConversation, sendCustomerMessage } from '../api';
|
|
15
13
|
import type { AppConversationMessage } from '../types/Conversation';
|
|
@@ -557,143 +555,132 @@ export function ChatList({
|
|
|
557
555
|
animated={false}
|
|
558
556
|
translucent
|
|
559
557
|
/>
|
|
560
|
-
<
|
|
561
|
-
|
|
562
|
-
style={{ flex: 1 }}
|
|
558
|
+
<View
|
|
559
|
+
style={[styles.container, { backgroundColor: themeColors.background }]}
|
|
563
560
|
>
|
|
561
|
+
<TouchableOpacity
|
|
562
|
+
style={[styles.iconContainer]}
|
|
563
|
+
onPress={onBack}
|
|
564
|
+
activeOpacity={activeOpacity}
|
|
565
|
+
>
|
|
566
|
+
<Image
|
|
567
|
+
source={closeIcon}
|
|
568
|
+
style={[styles.closeIcon, { tintColor: themeColors.text }]}
|
|
569
|
+
/>
|
|
570
|
+
</TouchableOpacity>
|
|
564
571
|
<View
|
|
565
572
|
style={[
|
|
566
|
-
styles.
|
|
567
|
-
{
|
|
573
|
+
styles.headerContainer,
|
|
574
|
+
{
|
|
575
|
+
backgroundColor: themeColors.background,
|
|
576
|
+
borderBottomColor: themeColors.lavender,
|
|
577
|
+
},
|
|
568
578
|
]}
|
|
569
579
|
>
|
|
570
|
-
<
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
<Image
|
|
576
|
-
source={closeIcon}
|
|
577
|
-
style={[styles.closeIcon, { tintColor: themeColors.text }]}
|
|
578
|
-
/>
|
|
579
|
-
</TouchableOpacity>
|
|
580
|
+
<AppText
|
|
581
|
+
localization="chat.support-team"
|
|
582
|
+
weight={'600'}
|
|
583
|
+
style={[styles.header, { color: themeColors.text }]}
|
|
584
|
+
/>
|
|
580
585
|
<View
|
|
581
586
|
style={[
|
|
582
|
-
styles.
|
|
583
|
-
{
|
|
584
|
-
backgroundColor: themeColors.background,
|
|
585
|
-
borderBottomColor: themeColors.lavender,
|
|
586
|
-
},
|
|
587
|
+
styles.headerText,
|
|
588
|
+
{ backgroundColor: themeColors.background },
|
|
587
589
|
]}
|
|
588
590
|
>
|
|
591
|
+
<Image
|
|
592
|
+
source={headphonesIcon}
|
|
593
|
+
style={[styles.headphonesIcon, { tintColor: themeColors.text }]}
|
|
594
|
+
/>
|
|
589
595
|
<AppText
|
|
590
|
-
localization="chat.
|
|
591
|
-
|
|
592
|
-
style={[styles.header, { color: themeColors.text }]}
|
|
596
|
+
localization="chat.live"
|
|
597
|
+
style={[styles.liveChat, { color: themeColors.text }]}
|
|
593
598
|
/>
|
|
594
599
|
<View
|
|
595
|
-
style={[
|
|
596
|
-
styles.headerText,
|
|
597
|
-
{ backgroundColor: themeColors.background },
|
|
598
|
-
]}
|
|
599
|
-
>
|
|
600
|
-
<Image
|
|
601
|
-
source={headphonesIcon}
|
|
602
|
-
style={[styles.headphonesIcon, { tintColor: themeColors.text }]}
|
|
603
|
-
/>
|
|
604
|
-
<AppText
|
|
605
|
-
localization="chat.live"
|
|
606
|
-
style={[styles.liveChat, { color: themeColors.text }]}
|
|
607
|
-
/>
|
|
608
|
-
<View
|
|
609
|
-
style={[styles.dot, { backgroundColor: themeColors.green }]}
|
|
610
|
-
/>
|
|
611
|
-
</View>
|
|
612
|
-
</View>
|
|
613
|
-
|
|
614
|
-
<View style={styles.listContainer}>
|
|
615
|
-
<AppText
|
|
616
|
-
style={[
|
|
617
|
-
styles.dateText,
|
|
618
|
-
{
|
|
619
|
-
color: themeColors.slate,
|
|
620
|
-
backgroundColor: themeColors.ghost,
|
|
621
|
-
},
|
|
622
|
-
]}
|
|
623
|
-
>
|
|
624
|
-
{currentSection}
|
|
625
|
-
</AppText>
|
|
626
|
-
|
|
627
|
-
<SectionList
|
|
628
|
-
ref={ref}
|
|
629
|
-
sections={sections}
|
|
630
|
-
inverted
|
|
631
|
-
renderItem={renderItem}
|
|
632
|
-
contentContainerStyle={[
|
|
633
|
-
styles.contentContainer,
|
|
634
|
-
{ backgroundColor: themeColors.background },
|
|
635
|
-
]}
|
|
636
|
-
style={styles.list}
|
|
637
|
-
ListEmptyComponent={
|
|
638
|
-
!loading && (!sections || sections.length === 0) ? (
|
|
639
|
-
<EmptyList />
|
|
640
|
-
) : null
|
|
641
|
-
}
|
|
642
|
-
ListFooterComponent={loading ? <LoadingItem /> : null}
|
|
643
|
-
keyExtractor={(item: AppConversationMessage) =>
|
|
644
|
-
item.id + '-' + item.created_at
|
|
645
|
-
}
|
|
646
|
-
removeClippedSubviews={false}
|
|
647
|
-
maxToRenderPerBatch={20}
|
|
648
|
-
windowSize={21}
|
|
649
|
-
initialNumToRender={MESSAGES_PER_PAGE}
|
|
650
|
-
getItemLayout={(_: any, index: number) => ({
|
|
651
|
-
length: MESSAGE_MIN_HEIGHT + 10,
|
|
652
|
-
offset: (MESSAGE_MIN_HEIGHT + 10) * index,
|
|
653
|
-
index,
|
|
654
|
-
})}
|
|
655
|
-
onScroll={handleScroll}
|
|
656
|
-
scrollEventThrottle={1}
|
|
657
|
-
stickySectionHeadersEnabled={false}
|
|
658
|
-
showsVerticalScrollIndicator={false}
|
|
600
|
+
style={[styles.dot, { backgroundColor: themeColors.green }]}
|
|
659
601
|
/>
|
|
660
602
|
</View>
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
}
|
|
693
|
-
|
|
603
|
+
</View>
|
|
604
|
+
|
|
605
|
+
<View style={styles.listContainer}>
|
|
606
|
+
<AppText
|
|
607
|
+
style={[
|
|
608
|
+
styles.dateText,
|
|
609
|
+
{ color: themeColors.slate, backgroundColor: themeColors.ghost },
|
|
610
|
+
]}
|
|
611
|
+
>
|
|
612
|
+
{currentSection}
|
|
613
|
+
</AppText>
|
|
614
|
+
|
|
615
|
+
<SectionList
|
|
616
|
+
ref={ref}
|
|
617
|
+
sections={sections}
|
|
618
|
+
inverted
|
|
619
|
+
renderItem={renderItem}
|
|
620
|
+
contentContainerStyle={[
|
|
621
|
+
styles.contentContainer,
|
|
622
|
+
{ backgroundColor: themeColors.background },
|
|
623
|
+
]}
|
|
624
|
+
style={styles.list}
|
|
625
|
+
ListEmptyComponent={
|
|
626
|
+
!loading && (!sections || sections.length === 0) ? (
|
|
627
|
+
<EmptyList />
|
|
628
|
+
) : null
|
|
629
|
+
}
|
|
630
|
+
ListFooterComponent={loading ? <LoadingItem /> : null}
|
|
631
|
+
keyExtractor={(item: AppConversationMessage) =>
|
|
632
|
+
item.id + '-' + item.created_at
|
|
633
|
+
}
|
|
634
|
+
removeClippedSubviews={false}
|
|
635
|
+
maxToRenderPerBatch={20}
|
|
636
|
+
windowSize={21}
|
|
637
|
+
initialNumToRender={MESSAGES_PER_PAGE}
|
|
638
|
+
getItemLayout={(_: any, index: number) => ({
|
|
639
|
+
length: MESSAGE_MIN_HEIGHT + 10,
|
|
640
|
+
offset: (MESSAGE_MIN_HEIGHT + 10) * index,
|
|
641
|
+
index,
|
|
642
|
+
})}
|
|
643
|
+
onScroll={handleScroll}
|
|
644
|
+
scrollEventThrottle={1}
|
|
645
|
+
stickySectionHeadersEnabled={false}
|
|
646
|
+
showsVerticalScrollIndicator={false}
|
|
694
647
|
/>
|
|
695
648
|
</View>
|
|
696
|
-
|
|
649
|
+
{isScrollingUp && (
|
|
650
|
+
<TouchableOpacity
|
|
651
|
+
activeOpacity={activeOpacity}
|
|
652
|
+
style={[
|
|
653
|
+
styles.scrollDownButton,
|
|
654
|
+
{ backgroundColor: themeColors.ghost },
|
|
655
|
+
isKeyboardVisible && styles.scrollDownButtonWithKeyboard,
|
|
656
|
+
]}
|
|
657
|
+
onPress={() => scrollToBottom(true)}
|
|
658
|
+
>
|
|
659
|
+
<Image
|
|
660
|
+
source={require('../assets/down.png')}
|
|
661
|
+
style={[styles.scrollUpIcon, { tintColor: themeColors.text }]}
|
|
662
|
+
/>
|
|
663
|
+
</TouchableOpacity>
|
|
664
|
+
)}
|
|
665
|
+
<MessageInput
|
|
666
|
+
scrollToBottom={scrollToBottom}
|
|
667
|
+
selectedMessage={selectedMessage}
|
|
668
|
+
/>
|
|
669
|
+
<CustomPopup
|
|
670
|
+
isVisible={popupVisible}
|
|
671
|
+
onClose={() => setPopupVisible(false)}
|
|
672
|
+
title={'chat.list-failed-message.title'}
|
|
673
|
+
description={'chat.list-failed-message.description'}
|
|
674
|
+
onCancelButton={() => {
|
|
675
|
+
setPopupVisible(false);
|
|
676
|
+
}}
|
|
677
|
+
onResendButton={() => {
|
|
678
|
+
resendMessage();
|
|
679
|
+
setPopupVisible(false);
|
|
680
|
+
}}
|
|
681
|
+
buttonText={'chat.list-cancel' as keyof LocalizationKeys}
|
|
682
|
+
/>
|
|
683
|
+
</View>
|
|
697
684
|
</>
|
|
698
685
|
);
|
|
699
686
|
}
|