@developer_tribe/react-native-comnyx 0.7.2 → 0.7.3

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.
Files changed (52) hide show
  1. package/android/generated/java/com/comnyx/NativeComnyxSpec.java +37 -0
  2. package/android/generated/jni/RNComnyxSpec-generated.cpp +11 -1
  3. package/android/generated/jni/RNComnyxSpec.h +7 -0
  4. package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +11 -0
  5. package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +52 -0
  6. package/ios/generated/RNComnyxSpec/RNComnyxSpec-generated.mm +39 -0
  7. package/ios/generated/RNComnyxSpec/RNComnyxSpec.h +63 -0
  8. package/ios/generated/RNComnyxSpecJSI-generated.cpp +28 -0
  9. package/ios/generated/RNComnyxSpecJSI.h +71 -0
  10. package/lib/commonjs/components/ChatList.js +106 -100
  11. package/lib/commonjs/components/ChatList.js.map +1 -1
  12. package/lib/commonjs/components/CustomerForm.js +179 -173
  13. package/lib/commonjs/components/CustomerForm.js.map +1 -1
  14. package/lib/commonjs/components/EmptyList.js +7 -5
  15. package/lib/commonjs/components/EmptyList.js.map +1 -1
  16. package/lib/module/components/ChatList.js +107 -101
  17. package/lib/module/components/ChatList.js.map +1 -1
  18. package/lib/module/components/CustomerForm.js +180 -174
  19. package/lib/module/components/CustomerForm.js.map +1 -1
  20. package/lib/module/components/EmptyList.js +8 -6
  21. package/lib/module/components/EmptyList.js.map +1 -1
  22. package/lib/typescript/src/components/ChatList.d.ts.map +1 -1
  23. package/lib/typescript/src/components/CustomerForm.d.ts.map +1 -1
  24. package/lib/typescript/src/components/EmptyList.d.ts.map +1 -1
  25. package/package.json +1 -1
  26. package/src/components/ChatList.tsx +123 -110
  27. package/src/components/CustomerForm.tsx +212 -194
  28. package/src/components/EmptyList.tsx +10 -3
  29. package/android/app/build/generated/source/codegen/RCTAppDependencyProvider.h +0 -25
  30. package/android/app/build/generated/source/codegen/RCTAppDependencyProvider.mm +0 -55
  31. package/android/app/build/generated/source/codegen/RCTModulesConformingToProtocolsProvider.h +0 -18
  32. package/android/app/build/generated/source/codegen/RCTModulesConformingToProtocolsProvider.mm +0 -33
  33. package/android/app/build/generated/source/codegen/RCTThirdPartyComponentsProvider.h +0 -16
  34. package/android/app/build/generated/source/codegen/RCTThirdPartyComponentsProvider.mm +0 -23
  35. package/android/app/build/generated/source/codegen/ReactAppDependencyProvider.podspec +0 -34
  36. package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeAsyncStorageModuleSpec.java +0 -59
  37. package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -36
  38. package/android/app/build/generated/source/codegen/jni/RNComnyxSpec-generated.cpp +0 -22
  39. package/android/app/build/generated/source/codegen/jni/RNComnyxSpec.h +0 -24
  40. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +0 -17
  41. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +0 -19
  42. package/android/app/build/generated/source/codegen/jni/react/renderer/components/rnasyncstorage/rnasyncstorageJSI-generated.cpp +0 -72
  43. package/android/app/build/generated/source/codegen/jni/react/renderer/components/rnasyncstorage/rnasyncstorageJSI.h +0 -116
  44. package/android/app/build/generated/source/codegen/jni/rnasyncstorage-generated.cpp +0 -62
  45. package/android/app/build/generated/source/codegen/jni/rnasyncstorage.h +0 -31
  46. package/android/generated/RCTAppDependencyProvider.h +0 -25
  47. package/android/generated/RCTAppDependencyProvider.mm +0 -55
  48. package/android/generated/RCTModulesConformingToProtocolsProvider.h +0 -18
  49. package/android/generated/RCTModulesConformingToProtocolsProvider.mm +0 -33
  50. package/android/generated/RCTThirdPartyComponentsProvider.h +0 -16
  51. package/android/generated/RCTThirdPartyComponentsProvider.mm +0 -23
  52. 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
- <View
559
- style={[styles.container, { backgroundColor: themeColors.background }]}
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.headerContainer,
574
- {
575
- backgroundColor: themeColors.background,
576
- borderBottomColor: themeColors.lavender,
577
- },
566
+ styles.container,
567
+ { backgroundColor: themeColors.background },
578
568
  ]}
579
569
  >
580
- <AppText
581
- localization="chat.support-team"
582
- weight={'600'}
583
- style={[styles.header, { color: themeColors.text }]}
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.headerText,
588
- { backgroundColor: themeColors.background },
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.live"
597
- style={[styles.liveChat, { color: themeColors.text }]}
590
+ localization="chat.support-team"
591
+ weight={'600'}
592
+ style={[styles.header, { color: themeColors.text }]}
598
593
  />
599
594
  <View
600
- style={[styles.dot, { backgroundColor: themeColors.green }]}
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
- <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}
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
- {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>
696
+ </KeyboardAvoidingView>
684
697
  </>
685
698
  );
686
699
  }