@developer_tribe/react-native-comnyx 0.7.2 → 0.7.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/android/build.gradle +12 -0
- package/android/generated/java/com/comnyx/NativeComnyxSpec.java +37 -0
- package/android/generated/jni/RNComnyxSpec-generated.cpp +11 -1
- package/android/generated/jni/RNComnyxSpec.h +7 -0
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +11 -0
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +52 -0
- package/ios/generated/RNComnyxSpec/RNComnyxSpec-generated.mm +39 -0
- package/ios/generated/RNComnyxSpec/RNComnyxSpec.h +63 -0
- package/ios/generated/RNComnyxSpecJSI-generated.cpp +28 -0
- package/ios/generated/RNComnyxSpecJSI.h +71 -0
- package/lib/commonjs/components/ChatList.js +106 -100
- package/lib/commonjs/components/ChatList.js.map +1 -1
- package/lib/commonjs/components/CustomerForm.js +179 -173
- package/lib/commonjs/components/CustomerForm.js.map +1 -1
- package/lib/commonjs/components/EmptyList.js +7 -5
- package/lib/commonjs/components/EmptyList.js.map +1 -1
- package/lib/module/components/ChatList.js +107 -101
- package/lib/module/components/ChatList.js.map +1 -1
- package/lib/module/components/CustomerForm.js +180 -174
- package/lib/module/components/CustomerForm.js.map +1 -1
- package/lib/module/components/EmptyList.js +8 -6
- package/lib/module/components/EmptyList.js.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/package.json +1 -1
- package/src/components/ChatList.tsx +123 -110
- package/src/components/CustomerForm.tsx +212 -194
- package/src/components/EmptyList.tsx +10 -3
- package/android/app/build/generated/source/codegen/RCTAppDependencyProvider.h +0 -25
- package/android/app/build/generated/source/codegen/RCTAppDependencyProvider.mm +0 -55
- package/android/app/build/generated/source/codegen/RCTModulesConformingToProtocolsProvider.h +0 -18
- package/android/app/build/generated/source/codegen/RCTModulesConformingToProtocolsProvider.mm +0 -33
- package/android/app/build/generated/source/codegen/RCTThirdPartyComponentsProvider.h +0 -16
- package/android/app/build/generated/source/codegen/RCTThirdPartyComponentsProvider.mm +0 -23
- package/android/app/build/generated/source/codegen/ReactAppDependencyProvider.podspec +0 -34
- package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeAsyncStorageModuleSpec.java +0 -59
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -36
- package/android/app/build/generated/source/codegen/jni/RNComnyxSpec-generated.cpp +0 -22
- package/android/app/build/generated/source/codegen/jni/RNComnyxSpec.h +0 -24
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +0 -17
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +0 -19
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/rnasyncstorage/rnasyncstorageJSI-generated.cpp +0 -72
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/rnasyncstorage/rnasyncstorageJSI.h +0 -116
- package/android/app/build/generated/source/codegen/jni/rnasyncstorage-generated.cpp +0 -62
- package/android/app/build/generated/source/codegen/jni/rnasyncstorage.h +0 -31
- package/android/generated/RCTAppDependencyProvider.h +0 -25
- package/android/generated/RCTAppDependencyProvider.mm +0 -55
- package/android/generated/RCTModulesConformingToProtocolsProvider.h +0 -18
- package/android/generated/RCTModulesConformingToProtocolsProvider.mm +0 -33
- package/android/generated/RCTThirdPartyComponentsProvider.h +0 -16
- package/android/generated/RCTThirdPartyComponentsProvider.mm +0 -23
- package/android/generated/ReactAppDependencyProvider.podspec +0 -34
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
TouchableOpacity,
|
|
9
9
|
Keyboard,
|
|
10
10
|
StatusBar,
|
|
11
|
+
KeyboardAvoidingView,
|
|
12
|
+
Platform,
|
|
11
13
|
} from 'react-native';
|
|
12
14
|
import { getCustomerConversation, sendCustomerMessage } from '../api';
|
|
13
15
|
import type { AppConversationMessage } from '../types/Conversation';
|
|
@@ -555,132 +557,143 @@ export function ChatList({
|
|
|
555
557
|
animated={false}
|
|
556
558
|
translucent
|
|
557
559
|
/>
|
|
558
|
-
<
|
|
559
|
-
|
|
560
|
+
<KeyboardAvoidingView
|
|
561
|
+
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
562
|
+
style={{ flex: 1 }}
|
|
560
563
|
>
|
|
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>
|
|
571
564
|
<View
|
|
572
565
|
style={[
|
|
573
|
-
styles.
|
|
574
|
-
{
|
|
575
|
-
backgroundColor: themeColors.background,
|
|
576
|
-
borderBottomColor: themeColors.lavender,
|
|
577
|
-
},
|
|
566
|
+
styles.container,
|
|
567
|
+
{ backgroundColor: themeColors.background },
|
|
578
568
|
]}
|
|
579
569
|
>
|
|
580
|
-
<
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
570
|
+
<TouchableOpacity
|
|
571
|
+
style={[styles.iconContainer]}
|
|
572
|
+
onPress={onBack}
|
|
573
|
+
activeOpacity={activeOpacity}
|
|
574
|
+
>
|
|
575
|
+
<Image
|
|
576
|
+
source={closeIcon}
|
|
577
|
+
style={[styles.closeIcon, { tintColor: themeColors.text }]}
|
|
578
|
+
/>
|
|
579
|
+
</TouchableOpacity>
|
|
585
580
|
<View
|
|
586
581
|
style={[
|
|
587
|
-
styles.
|
|
588
|
-
{
|
|
582
|
+
styles.headerContainer,
|
|
583
|
+
{
|
|
584
|
+
backgroundColor: themeColors.background,
|
|
585
|
+
borderBottomColor: themeColors.lavender,
|
|
586
|
+
},
|
|
589
587
|
]}
|
|
590
588
|
>
|
|
591
|
-
<Image
|
|
592
|
-
source={headphonesIcon}
|
|
593
|
-
style={[styles.headphonesIcon, { tintColor: themeColors.text }]}
|
|
594
|
-
/>
|
|
595
589
|
<AppText
|
|
596
|
-
localization="chat.
|
|
597
|
-
|
|
590
|
+
localization="chat.support-team"
|
|
591
|
+
weight={'600'}
|
|
592
|
+
style={[styles.header, { color: themeColors.text }]}
|
|
598
593
|
/>
|
|
599
594
|
<View
|
|
600
|
-
style={[
|
|
601
|
-
|
|
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>
|
|
602
612
|
</View>
|
|
603
|
-
</View>
|
|
604
613
|
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
{
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
index
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
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}
|
|
659
|
+
/>
|
|
660
|
+
</View>
|
|
661
|
+
{isScrollingUp && (
|
|
662
|
+
<TouchableOpacity
|
|
663
|
+
activeOpacity={activeOpacity}
|
|
664
|
+
style={[
|
|
665
|
+
styles.scrollDownButton,
|
|
666
|
+
{ backgroundColor: themeColors.ghost },
|
|
667
|
+
isKeyboardVisible && styles.scrollDownButtonWithKeyboard,
|
|
668
|
+
]}
|
|
669
|
+
onPress={() => scrollToBottom(true)}
|
|
670
|
+
>
|
|
671
|
+
<Image
|
|
672
|
+
source={require('../assets/down.png')}
|
|
673
|
+
style={[styles.scrollUpIcon, { tintColor: themeColors.text }]}
|
|
674
|
+
/>
|
|
675
|
+
</TouchableOpacity>
|
|
676
|
+
)}
|
|
677
|
+
<MessageInput
|
|
678
|
+
scrollToBottom={scrollToBottom}
|
|
679
|
+
selectedMessage={selectedMessage}
|
|
680
|
+
/>
|
|
681
|
+
<CustomPopup
|
|
682
|
+
isVisible={popupVisible}
|
|
683
|
+
onClose={() => setPopupVisible(false)}
|
|
684
|
+
title={'chat.list-failed-message.title'}
|
|
685
|
+
description={'chat.list-failed-message.description'}
|
|
686
|
+
onCancelButton={() => {
|
|
687
|
+
setPopupVisible(false);
|
|
688
|
+
}}
|
|
689
|
+
onResendButton={() => {
|
|
690
|
+
resendMessage();
|
|
691
|
+
setPopupVisible(false);
|
|
692
|
+
}}
|
|
693
|
+
buttonText={'chat.list-cancel' as keyof LocalizationKeys}
|
|
647
694
|
/>
|
|
648
695
|
</View>
|
|
649
|
-
|
|
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>
|
|
696
|
+
</KeyboardAvoidingView>
|
|
684
697
|
</>
|
|
685
698
|
);
|
|
686
699
|
}
|