@developer_tribe/react-native-comnyx 0.3.2 → 0.3.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.
- package/lib/commonjs/App.js +8 -3
- package/lib/commonjs/App.js.map +1 -1
- package/lib/commonjs/assets/arrow-right.png +0 -0
- package/lib/commonjs/assets/headphones-01.png +0 -0
- package/lib/commonjs/assets/iconamoon_clock-fill.png +0 -0
- package/lib/commonjs/assets/info-circle.png +0 -0
- package/lib/commonjs/assets/message-notification-square.png +0 -0
- package/lib/commonjs/assets/x-close.png +0 -0
- package/lib/commonjs/components/ChatList.js +355 -50
- package/lib/commonjs/components/ChatList.js.map +1 -1
- package/lib/commonjs/components/CustomAlert.js +132 -0
- package/lib/commonjs/components/CustomAlert.js.map +1 -0
- package/lib/commonjs/components/CustomerForm.js +252 -198
- package/lib/commonjs/components/CustomerForm.js.map +1 -1
- package/lib/commonjs/components/EmptyList.js +36 -11
- package/lib/commonjs/components/EmptyList.js.map +1 -1
- package/lib/commonjs/components/InitFailed.js +8 -5
- package/lib/commonjs/components/InitFailed.js.map +1 -1
- package/lib/commonjs/components/MessageInput.js +49 -16
- package/lib/commonjs/components/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageItem.js +133 -42
- package/lib/commonjs/components/MessageItem.js.map +1 -1
- package/lib/commonjs/components/ScaledSheet.js +67 -0
- package/lib/commonjs/components/ScaledSheet.js.map +1 -0
- package/lib/commonjs/components/SizeMatter.js +27 -0
- package/lib/commonjs/components/SizeMatter.js.map +1 -0
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/store.js +15 -9
- package/lib/commonjs/store.js.map +1 -1
- package/lib/commonjs/types/Theme.js +20 -2
- package/lib/commonjs/types/Theme.js.map +1 -1
- package/lib/commonjs/utils/deepMap.js +38 -0
- package/lib/commonjs/utils/deepMap.js.map +1 -0
- package/lib/commonjs/utils/formatDate.js +16 -0
- package/lib/commonjs/utils/formatDate.js.map +1 -0
- package/lib/commonjs/utils/scalingUtils.js +33 -0
- package/lib/commonjs/utils/scalingUtils.js.map +1 -0
- package/lib/commonjs/viewabilityConfig.js +11 -0
- package/lib/commonjs/viewabilityConfig.js.map +1 -0
- package/lib/module/App.js +8 -3
- package/lib/module/App.js.map +1 -1
- package/lib/module/assets/arrow-right.png +0 -0
- package/lib/module/assets/headphones-01.png +0 -0
- package/lib/module/assets/iconamoon_clock-fill.png +0 -0
- package/lib/module/assets/info-circle.png +0 -0
- package/lib/module/assets/message-notification-square.png +0 -0
- package/lib/module/assets/x-close.png +0 -0
- package/lib/module/components/ChatList.js +357 -54
- package/lib/module/components/ChatList.js.map +1 -1
- package/lib/module/components/CustomAlert.js +127 -0
- package/lib/module/components/CustomAlert.js.map +1 -0
- package/lib/module/components/CustomerForm.js +253 -200
- package/lib/module/components/CustomerForm.js.map +1 -1
- package/lib/module/components/EmptyList.js +38 -13
- package/lib/module/components/EmptyList.js.map +1 -1
- package/lib/module/components/InitFailed.js +9 -6
- package/lib/module/components/InitFailed.js.map +1 -1
- package/lib/module/components/MessageInput.js +50 -17
- package/lib/module/components/MessageInput.js.map +1 -1
- package/lib/module/components/MessageItem.js +134 -44
- package/lib/module/components/MessageItem.js.map +1 -1
- package/lib/module/components/ScaledSheet.js +62 -0
- package/lib/module/components/ScaledSheet.js.map +1 -0
- package/lib/module/components/SizeMatter.js +23 -0
- package/lib/module/components/SizeMatter.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/store.js +15 -9
- package/lib/module/store.js.map +1 -1
- package/lib/module/types/Theme.js +20 -2
- package/lib/module/types/Theme.js.map +1 -1
- package/lib/module/utils/deepMap.js +34 -0
- package/lib/module/utils/deepMap.js.map +1 -0
- package/lib/module/utils/formatDate.js +11 -0
- package/lib/module/utils/formatDate.js.map +1 -0
- package/lib/module/utils/scalingUtils.js +25 -0
- package/lib/module/utils/scalingUtils.js.map +1 -0
- package/lib/module/viewabilityConfig.js +7 -0
- package/lib/module/viewabilityConfig.js.map +1 -0
- package/lib/typescript/commonjs/src/App.d.ts +2 -1
- package/lib/typescript/commonjs/src/App.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/ChatList.d.ts +3 -1
- package/lib/typescript/commonjs/src/components/ChatList.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/CustomAlert.d.ts +15 -0
- package/lib/typescript/commonjs/src/components/CustomAlert.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/CustomerForm.d.ts +3 -1
- package/lib/typescript/commonjs/src/components/CustomerForm.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/EmptyList.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/InitFailed.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/MessageInput.d.ts +1 -0
- package/lib/typescript/commonjs/src/components/MessageInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/MessageItem.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/MessageItem.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/ScaledSheet.d.ts +2 -0
- package/lib/typescript/commonjs/src/components/ScaledSheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/SizeMatter.d.ts +7 -0
- package/lib/typescript/commonjs/src/components/SizeMatter.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/store.d.ts +6 -0
- package/lib/typescript/commonjs/src/store.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/Conversation.d.ts +2 -0
- package/lib/typescript/commonjs/src/types/Conversation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/Theme.d.ts +9 -0
- package/lib/typescript/commonjs/src/types/Theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/deepMap.d.ts +7 -0
- package/lib/typescript/commonjs/src/utils/deepMap.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/formatDate.d.ts +2 -0
- package/lib/typescript/commonjs/src/utils/formatDate.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/scalingUtils.d.ts +10 -0
- package/lib/typescript/commonjs/src/utils/scalingUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/viewabilityConfig.d.ts +5 -0
- package/lib/typescript/commonjs/src/viewabilityConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/App.d.ts +2 -1
- package/lib/typescript/module/src/App.d.ts.map +1 -1
- package/lib/typescript/module/src/components/ChatList.d.ts +3 -1
- package/lib/typescript/module/src/components/ChatList.d.ts.map +1 -1
- package/lib/typescript/module/src/components/CustomAlert.d.ts +15 -0
- package/lib/typescript/module/src/components/CustomAlert.d.ts.map +1 -0
- package/lib/typescript/module/src/components/CustomerForm.d.ts +3 -1
- package/lib/typescript/module/src/components/CustomerForm.d.ts.map +1 -1
- package/lib/typescript/module/src/components/EmptyList.d.ts.map +1 -1
- package/lib/typescript/module/src/components/InitFailed.d.ts.map +1 -1
- package/lib/typescript/module/src/components/MessageInput.d.ts +1 -0
- package/lib/typescript/module/src/components/MessageInput.d.ts.map +1 -1
- package/lib/typescript/module/src/components/MessageItem.d.ts +2 -1
- package/lib/typescript/module/src/components/MessageItem.d.ts.map +1 -1
- package/lib/typescript/module/src/components/ScaledSheet.d.ts +2 -0
- package/lib/typescript/module/src/components/ScaledSheet.d.ts.map +1 -0
- package/lib/typescript/module/src/components/SizeMatter.d.ts +7 -0
- package/lib/typescript/module/src/components/SizeMatter.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +1 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/store.d.ts +6 -0
- package/lib/typescript/module/src/store.d.ts.map +1 -1
- package/lib/typescript/module/src/types/Conversation.d.ts +2 -0
- package/lib/typescript/module/src/types/Conversation.d.ts.map +1 -1
- package/lib/typescript/module/src/types/Theme.d.ts +9 -0
- package/lib/typescript/module/src/types/Theme.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/deepMap.d.ts +7 -0
- package/lib/typescript/module/src/utils/deepMap.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/formatDate.d.ts +2 -0
- package/lib/typescript/module/src/utils/formatDate.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/scalingUtils.d.ts +10 -0
- package/lib/typescript/module/src/utils/scalingUtils.d.ts.map +1 -0
- package/lib/typescript/module/src/viewabilityConfig.d.ts +5 -0
- package/lib/typescript/module/src/viewabilityConfig.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/App.tsx +4 -2
- package/src/assets/arrow-right.png +0 -0
- package/src/assets/headphones-01.png +0 -0
- package/src/assets/iconamoon_clock-fill.png +0 -0
- package/src/assets/info-circle.png +0 -0
- package/src/assets/message-notification-square.png +0 -0
- package/src/assets/x-close.png +0 -0
- package/src/components/ChatList.tsx +413 -60
- package/src/components/CustomAlert.tsx +132 -0
- package/src/components/CustomerForm.tsx +272 -224
- package/src/components/EmptyList.tsx +31 -7
- package/src/components/InitFailed.tsx +9 -6
- package/src/components/MessageInput.tsx +86 -49
- package/src/components/MessageItem.tsx +181 -58
- package/src/components/ScaledSheet.ts +93 -0
- package/src/components/SizeMatter.tsx +22 -0
- package/src/index.tsx +1 -0
- package/src/store.ts +13 -3
- package/src/types/Conversation.ts +2 -0
- package/src/types/Theme.ts +27 -0
- package/src/utils/deepMap.ts +47 -0
- package/src/utils/formatDate.ts +8 -0
- package/src/utils/scalingUtils.ts +27 -0
- package/src/viewabilityConfig.ts +4 -0
- package/lib/commonjs/assets/double-check.png +0 -0
- package/lib/commonjs/assets/send.png +0 -0
- package/lib/module/assets/double-check.png +0 -0
- package/lib/module/assets/send.png +0 -0
- package/src/assets/double-check.png +0 -0
- package/src/assets/send.png +0 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal, View, Image, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { useThemeColors } from '../hooks/useThemeColors';
|
|
4
|
+
import { AppText } from './AppText';
|
|
5
|
+
import type { LocalizationKeys } from '../types/LocalizationKeys';
|
|
6
|
+
import { ScaledSheet } from './ScaledSheet';
|
|
7
|
+
|
|
8
|
+
interface CustomPopupProps {
|
|
9
|
+
isVisible: boolean;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
title: string;
|
|
12
|
+
buttonText?: keyof LocalizationKeys;
|
|
13
|
+
description?: string;
|
|
14
|
+
onCancelButton?: () => void;
|
|
15
|
+
onResendButton?: () => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const infoIcon = require('../assets/info-circle.png');
|
|
19
|
+
|
|
20
|
+
function CustomPopup({
|
|
21
|
+
isVisible,
|
|
22
|
+
onClose,
|
|
23
|
+
title,
|
|
24
|
+
description,
|
|
25
|
+
onCancelButton,
|
|
26
|
+
onResendButton,
|
|
27
|
+
buttonText,
|
|
28
|
+
}: CustomPopupProps) {
|
|
29
|
+
const themeColors = useThemeColors();
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Modal visible={isVisible} transparent={true} onRequestClose={onClose}>
|
|
33
|
+
<View style={styles.overlay}>
|
|
34
|
+
<View
|
|
35
|
+
style={[styles.popup, { backgroundColor: themeColors.background }]}
|
|
36
|
+
>
|
|
37
|
+
<Image source={infoIcon} height={64} width={64} />
|
|
38
|
+
<AppText style={styles.title}>{title}</AppText>
|
|
39
|
+
<AppText style={[styles.description, { color: themeColors.navy }]}>
|
|
40
|
+
{description}
|
|
41
|
+
</AppText>
|
|
42
|
+
{onResendButton && (
|
|
43
|
+
<TouchableOpacity
|
|
44
|
+
style={[
|
|
45
|
+
styles.buttonUp,
|
|
46
|
+
{ backgroundColor: themeColors.dark_background },
|
|
47
|
+
]}
|
|
48
|
+
onPress={onResendButton}
|
|
49
|
+
>
|
|
50
|
+
<AppText
|
|
51
|
+
localization={'customer.form.resend' as keyof LocalizationKeys}
|
|
52
|
+
style={[styles.buttonText, { color: themeColors.light_text }]}
|
|
53
|
+
/>
|
|
54
|
+
</TouchableOpacity>
|
|
55
|
+
)}
|
|
56
|
+
<TouchableOpacity
|
|
57
|
+
style={[
|
|
58
|
+
styles.buttonDown,
|
|
59
|
+
{ borderColor: themeColors.dark_background },
|
|
60
|
+
]}
|
|
61
|
+
onPress={onCancelButton}
|
|
62
|
+
>
|
|
63
|
+
<AppText
|
|
64
|
+
localization={buttonText as keyof LocalizationKeys}
|
|
65
|
+
style={[styles.buttonText, { color: themeColors.text }]}
|
|
66
|
+
/>
|
|
67
|
+
</TouchableOpacity>
|
|
68
|
+
</View>
|
|
69
|
+
</View>
|
|
70
|
+
</Modal>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const styles = ScaledSheet.create({
|
|
75
|
+
overlay: {
|
|
76
|
+
flex: 1,
|
|
77
|
+
justifyContent: 'center',
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
backgroundColor: 'rgba(0, 0, 0, 0.60)',
|
|
80
|
+
},
|
|
81
|
+
popup: {
|
|
82
|
+
width: '80%',
|
|
83
|
+
borderRadius: '20@s',
|
|
84
|
+
overflow: 'hidden',
|
|
85
|
+
alignItems: 'center',
|
|
86
|
+
paddingVertical: '20@vs',
|
|
87
|
+
},
|
|
88
|
+
title: {
|
|
89
|
+
marginVertical: '16@vs',
|
|
90
|
+
fontWeight: 700,
|
|
91
|
+
fontSize: '16@vs',
|
|
92
|
+
},
|
|
93
|
+
description: {
|
|
94
|
+
marginBottom: '16@vs',
|
|
95
|
+
alignItems: 'center',
|
|
96
|
+
textAlign: 'center',
|
|
97
|
+
width: '85%',
|
|
98
|
+
fontWeight: 500,
|
|
99
|
+
fontSize: '16@vs',
|
|
100
|
+
},
|
|
101
|
+
buttonText: {
|
|
102
|
+
color: 'white',
|
|
103
|
+
fontSize: '16@vs',
|
|
104
|
+
fontWeight: '600',
|
|
105
|
+
},
|
|
106
|
+
buttonContainer: {
|
|
107
|
+
flexDirection: 'column',
|
|
108
|
+
width: '90%',
|
|
109
|
+
justifyContent: 'center',
|
|
110
|
+
alignItems: 'center',
|
|
111
|
+
},
|
|
112
|
+
buttonUp: {
|
|
113
|
+
borderRadius: '12@s',
|
|
114
|
+
width: '256@s',
|
|
115
|
+
height: '56@vs',
|
|
116
|
+
marginBottom: '16@vs',
|
|
117
|
+
alignItems: 'center',
|
|
118
|
+
justifyContent: 'center',
|
|
119
|
+
},
|
|
120
|
+
buttonDown: {
|
|
121
|
+
backgroundColor: 'transparent',
|
|
122
|
+
borderRadius: '12@s',
|
|
123
|
+
width: '256@s',
|
|
124
|
+
height: '56@vs',
|
|
125
|
+
alignItems: 'center',
|
|
126
|
+
justifyContent: 'center',
|
|
127
|
+
marginBottom: '12@vs',
|
|
128
|
+
borderWidth: 1,
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
export default React.memo(CustomPopup);
|