@developer_tribe/react-native-comnyx 0.3.2 → 0.3.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/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 +356 -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 +20 -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 +358 -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 +15 -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 +420 -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 +13 -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
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
View,
|
|
3
3
|
TextInput,
|
|
4
|
-
StyleSheet,
|
|
5
4
|
TouchableOpacity,
|
|
6
|
-
Modal,
|
|
7
|
-
FlatList,
|
|
8
5
|
Pressable,
|
|
9
6
|
Keyboard,
|
|
7
|
+
Image,
|
|
8
|
+
ScrollView,
|
|
10
9
|
} from 'react-native';
|
|
11
10
|
import { useForm, Controller } from 'react-hook-form';
|
|
12
11
|
import { useAppStore } from '../store';
|
|
@@ -14,8 +13,9 @@ import { createCustomer } from '../api';
|
|
|
14
13
|
import { AppText } from './AppText';
|
|
15
14
|
import { useLocalize } from '../hooks/useLocalize';
|
|
16
15
|
import { useThemeColors } from '../hooks/useThemeColors';
|
|
16
|
+
import CustomPopup from './CustomAlert';
|
|
17
17
|
import { useState } from 'react';
|
|
18
|
-
import {
|
|
18
|
+
import { ScaledSheet } from './ScaledSheet';
|
|
19
19
|
|
|
20
20
|
interface CustomerFormData {
|
|
21
21
|
name: string;
|
|
@@ -24,7 +24,15 @@ interface CustomerFormData {
|
|
|
24
24
|
phone: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
const closeIcon = require('../assets/x-close.png');
|
|
28
|
+
const infoIcon = require('../assets/info-circle.png');
|
|
29
|
+
|
|
30
|
+
interface InfoButtonProps {
|
|
31
|
+
title: string;
|
|
32
|
+
description: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function CustomerForm({ onBack }: { onBack: () => void }) {
|
|
28
36
|
const {
|
|
29
37
|
control,
|
|
30
38
|
handleSubmit,
|
|
@@ -32,14 +40,18 @@ export function CustomerForm() {
|
|
|
32
40
|
} = useForm<CustomerFormData>();
|
|
33
41
|
const themeColors = useThemeColors();
|
|
34
42
|
const localize = useLocalize();
|
|
35
|
-
const [isCountryModalVisible, setIsCountryModalVisible] = useState(false);
|
|
36
43
|
|
|
37
44
|
const inputStyle = {
|
|
38
45
|
...styles.input,
|
|
39
46
|
color: themeColors.text,
|
|
40
|
-
borderColor: themeColors.
|
|
47
|
+
borderColor: themeColors.gainsboro,
|
|
41
48
|
backgroundColor: themeColors.background,
|
|
42
49
|
};
|
|
50
|
+
const [popupVisible, setPopupVisible] = useState(false);
|
|
51
|
+
const [popupContent, setPopupContent] = useState({
|
|
52
|
+
title: '',
|
|
53
|
+
description: 'null',
|
|
54
|
+
});
|
|
43
55
|
|
|
44
56
|
const onSubmit = async (data: CustomerFormData) => {
|
|
45
57
|
try {
|
|
@@ -61,265 +73,273 @@ export function CustomerForm() {
|
|
|
61
73
|
}
|
|
62
74
|
};
|
|
63
75
|
|
|
76
|
+
const showErrorPopup = (title: string, description: string) => {
|
|
77
|
+
setPopupVisible(true);
|
|
78
|
+
setPopupContent({
|
|
79
|
+
title: title ?? 'customer.form.failed.name',
|
|
80
|
+
description: description ?? 'customer.form.failed.name.desc',
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
85
|
+
const InfoButton = ({ title, description }: InfoButtonProps) => {
|
|
86
|
+
return (
|
|
87
|
+
<TouchableOpacity
|
|
88
|
+
onPress={() => showErrorPopup(title, description)}
|
|
89
|
+
activeOpacity={1}
|
|
90
|
+
>
|
|
91
|
+
<Image source={infoIcon} style={styles.infoIcon} />
|
|
92
|
+
</TouchableOpacity>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
64
96
|
return (
|
|
65
97
|
<Pressable
|
|
66
98
|
style={[styles.container, { backgroundColor: themeColors.background }]}
|
|
67
99
|
onPress={Keyboard.dismiss}
|
|
68
100
|
>
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
</View>
|
|
79
|
-
<Controller
|
|
80
|
-
control={control}
|
|
81
|
-
rules={{
|
|
82
|
-
maxLength: {
|
|
83
|
-
value: 30,
|
|
84
|
-
message: localize('customer.form.validation.name.maxLength'),
|
|
85
|
-
},
|
|
86
|
-
}}
|
|
87
|
-
render={({ field: { onChange, value } }) => (
|
|
88
|
-
<TextInput
|
|
89
|
-
style={inputStyle}
|
|
90
|
-
placeholder={localize('customer.form.placeholder.name')}
|
|
91
|
-
placeholderTextColor="#6C757D"
|
|
92
|
-
value={value}
|
|
93
|
-
onChangeText={onChange}
|
|
94
|
-
/>
|
|
95
|
-
)}
|
|
96
|
-
name="name"
|
|
97
|
-
/>
|
|
98
|
-
{errors.name && (
|
|
99
|
-
<AppText
|
|
100
|
-
localization={errors.name.message ? undefined : 'customer.form.error'}
|
|
101
|
-
style={[styles.error, { color: themeColors.error }]}
|
|
101
|
+
<ScrollView
|
|
102
|
+
contentContainerStyle={styles.scrollContainer}
|
|
103
|
+
keyboardShouldPersistTaps="handled"
|
|
104
|
+
>
|
|
105
|
+
<View
|
|
106
|
+
style={[
|
|
107
|
+
styles.container,
|
|
108
|
+
{ backgroundColor: themeColors.background },
|
|
109
|
+
]}
|
|
102
110
|
>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
111
|
+
<TouchableOpacity
|
|
112
|
+
style={[
|
|
113
|
+
styles.iconContainer,
|
|
114
|
+
{ backgroundColor: themeColors.dark_background },
|
|
115
|
+
]}
|
|
116
|
+
onPress={onBack}
|
|
117
|
+
>
|
|
118
|
+
<Image
|
|
119
|
+
source={closeIcon}
|
|
120
|
+
style={[styles.closeIcon, { tintColor: themeColors.light_text }]}
|
|
121
|
+
/>
|
|
122
|
+
</TouchableOpacity>
|
|
123
|
+
<View
|
|
124
|
+
style={[
|
|
125
|
+
styles.headerContainer,
|
|
126
|
+
{ backgroundColor: themeColors.dark_background },
|
|
127
|
+
]}
|
|
128
|
+
>
|
|
129
|
+
<AppText
|
|
130
|
+
localization="customer.form.title"
|
|
131
|
+
style={[styles.headerText, { color: themeColors.gainsboro }]}
|
|
132
|
+
/>
|
|
133
|
+
<AppText
|
|
134
|
+
localization="customer.form.instructions"
|
|
135
|
+
style={[styles.headerText, { color: themeColors.light_text }]}
|
|
136
|
+
/>
|
|
137
|
+
</View>
|
|
138
|
+
<View style={styles.titleContainer}>
|
|
139
|
+
<AppText
|
|
118
140
|
style={[
|
|
119
|
-
styles.
|
|
141
|
+
styles.title,
|
|
120
142
|
{
|
|
121
|
-
|
|
122
|
-
backgroundColor: themeColors.background,
|
|
123
|
-
justifyContent: 'center',
|
|
143
|
+
color: themeColors.slate,
|
|
124
144
|
},
|
|
125
145
|
]}
|
|
126
|
-
onPress={() => setIsCountryModalVisible(true)}
|
|
127
146
|
>
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
147
|
+
{localize('customer.form.title')}
|
|
148
|
+
</AppText>
|
|
149
|
+
<Controller
|
|
150
|
+
control={control}
|
|
151
|
+
rules={{
|
|
152
|
+
maxLength: {
|
|
153
|
+
value: 30,
|
|
154
|
+
message: localize('customer.form.validation.name.maxLength'),
|
|
155
|
+
},
|
|
156
|
+
}}
|
|
157
|
+
render={({ field: { onChange, value } }) => (
|
|
158
|
+
<View
|
|
159
|
+
style={[
|
|
160
|
+
styles.inputContainer,
|
|
161
|
+
{ borderBottomColor: themeColors.gainsboro },
|
|
162
|
+
]}
|
|
163
|
+
>
|
|
164
|
+
<TextInput
|
|
165
|
+
style={inputStyle}
|
|
166
|
+
placeholder={localize('customer.form.placeholder.name')}
|
|
167
|
+
placeholderTextColor={themeColors.gainsboro}
|
|
168
|
+
value={value}
|
|
169
|
+
onChangeText={onChange}
|
|
170
|
+
/>
|
|
171
|
+
{errors.name && (
|
|
172
|
+
<InfoButton
|
|
173
|
+
title={'customer.form.failed.name'}
|
|
174
|
+
description={'customer.form.failed.name.desc'}
|
|
175
|
+
/>
|
|
176
|
+
)}
|
|
177
|
+
</View>
|
|
178
|
+
)}
|
|
179
|
+
name="name"
|
|
180
|
+
/>
|
|
181
|
+
<AppText
|
|
182
|
+
style={[
|
|
183
|
+
styles.title,
|
|
184
|
+
{
|
|
185
|
+
color: themeColors.slate,
|
|
186
|
+
},
|
|
187
|
+
]}
|
|
140
188
|
>
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
189
|
+
Email
|
|
190
|
+
</AppText>
|
|
191
|
+
<Controller
|
|
192
|
+
control={control}
|
|
193
|
+
rules={{
|
|
194
|
+
pattern: {
|
|
195
|
+
value: /^\S+@\S+$/i,
|
|
196
|
+
message: localize('customer.form.validation.email.pattern'),
|
|
197
|
+
},
|
|
198
|
+
}}
|
|
199
|
+
render={({ field: { onChange, value } }) => (
|
|
147
200
|
<View
|
|
148
201
|
style={[
|
|
149
|
-
styles.
|
|
150
|
-
{
|
|
202
|
+
styles.inputContainer,
|
|
203
|
+
{ borderBottomColor: themeColors.gainsboro },
|
|
151
204
|
]}
|
|
152
205
|
>
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
<Pressable
|
|
161
|
-
style={[
|
|
162
|
-
styles.countryItem,
|
|
163
|
-
{
|
|
164
|
-
backgroundColor:
|
|
165
|
-
value === item.code
|
|
166
|
-
? themeColors.primary
|
|
167
|
-
: themeColors.background,
|
|
168
|
-
borderBottomColor: themeColors.border,
|
|
169
|
-
},
|
|
170
|
-
]}
|
|
171
|
-
onPress={() => {
|
|
172
|
-
onChange(item.code);
|
|
173
|
-
setIsCountryModalVisible(false);
|
|
174
|
-
}}
|
|
175
|
-
>
|
|
176
|
-
<AppText
|
|
177
|
-
style={{
|
|
178
|
-
color:
|
|
179
|
-
value === item.code
|
|
180
|
-
? themeColors.background
|
|
181
|
-
: themeColors.text,
|
|
182
|
-
fontSize: 16,
|
|
183
|
-
}}
|
|
184
|
-
>
|
|
185
|
-
{item.name}
|
|
186
|
-
</AppText>
|
|
187
|
-
</Pressable>
|
|
188
|
-
)}
|
|
206
|
+
<TextInput
|
|
207
|
+
style={inputStyle}
|
|
208
|
+
placeholder={localize('customer.form.placeholder.email')}
|
|
209
|
+
placeholderTextColor={themeColors.gainsboro}
|
|
210
|
+
value={value}
|
|
211
|
+
onChangeText={onChange}
|
|
212
|
+
keyboardType="email-address"
|
|
189
213
|
/>
|
|
214
|
+
{errors.email && (
|
|
215
|
+
<InfoButton
|
|
216
|
+
title={'customer.form.failed.email'}
|
|
217
|
+
description={'customer.form.failed.email.desc'}
|
|
218
|
+
/>
|
|
219
|
+
)}
|
|
190
220
|
</View>
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
221
|
+
)}
|
|
222
|
+
name="email"
|
|
223
|
+
/>
|
|
224
|
+
<AppText
|
|
225
|
+
style={[
|
|
226
|
+
styles.title,
|
|
227
|
+
{
|
|
228
|
+
color: themeColors.slate,
|
|
229
|
+
},
|
|
230
|
+
]}
|
|
231
|
+
>
|
|
232
|
+
Phone
|
|
233
|
+
</AppText>
|
|
234
|
+
<Controller
|
|
235
|
+
control={control}
|
|
236
|
+
rules={{
|
|
237
|
+
validate: (value) => {
|
|
238
|
+
if (!value) return true;
|
|
239
|
+
return (
|
|
240
|
+
typeof value === 'string' ||
|
|
241
|
+
localize('customer.form.validation.phone.invalid')
|
|
242
|
+
);
|
|
243
|
+
},
|
|
244
|
+
}}
|
|
245
|
+
render={({ field: { onChange, value } }) => (
|
|
246
|
+
<View
|
|
247
|
+
style={[
|
|
248
|
+
styles.inputContainer,
|
|
249
|
+
{ borderBottomColor: themeColors.gainsboro },
|
|
250
|
+
]}
|
|
251
|
+
>
|
|
252
|
+
<TextInput
|
|
253
|
+
style={inputStyle}
|
|
254
|
+
placeholder={localize('customer.form.placeholder.phone')}
|
|
255
|
+
placeholderTextColor={themeColors.gainsboro}
|
|
256
|
+
value={value}
|
|
257
|
+
onChangeText={onChange}
|
|
258
|
+
keyboardType="phone-pad"
|
|
259
|
+
/>
|
|
260
|
+
{errors.phone && (
|
|
261
|
+
<InfoButton
|
|
262
|
+
title={'customer.form.failed.phone'}
|
|
263
|
+
description={'customer.form.failed.phone.desc'}
|
|
264
|
+
/>
|
|
265
|
+
)}
|
|
266
|
+
</View>
|
|
267
|
+
)}
|
|
268
|
+
name="phone"
|
|
269
|
+
/>
|
|
270
|
+
</View>
|
|
271
|
+
<TouchableOpacity
|
|
272
|
+
style={[
|
|
273
|
+
styles.button,
|
|
274
|
+
{ backgroundColor: themeColors.dark_background },
|
|
275
|
+
]}
|
|
276
|
+
onPress={handleSubmit(onSubmit)}
|
|
277
|
+
>
|
|
278
|
+
<AppText
|
|
279
|
+
localization="customer.form.submit"
|
|
280
|
+
style={[styles.buttonText, { color: themeColors.light_text }]}
|
|
281
|
+
/>
|
|
282
|
+
</TouchableOpacity>
|
|
283
|
+
</View>
|
|
284
|
+
</ScrollView>
|
|
285
|
+
<CustomPopup
|
|
286
|
+
isVisible={popupVisible}
|
|
287
|
+
onClose={() => setPopupVisible(false)}
|
|
288
|
+
title={popupContent.title}
|
|
289
|
+
description={popupContent.description}
|
|
290
|
+
onCancelButton={() => {
|
|
291
|
+
setPopupVisible(false);
|
|
292
|
+
setPopupContent({ title: '', description: '' });
|
|
215
293
|
}}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
style={inputStyle}
|
|
219
|
-
placeholder={localize('customer.form.placeholder.email')}
|
|
220
|
-
placeholderTextColor="#6C757D"
|
|
221
|
-
value={value}
|
|
222
|
-
onChangeText={onChange}
|
|
223
|
-
keyboardType="email-address"
|
|
224
|
-
/>
|
|
225
|
-
)}
|
|
226
|
-
name="email"
|
|
227
|
-
/>
|
|
228
|
-
{errors.email && (
|
|
229
|
-
<AppText
|
|
230
|
-
localization={
|
|
231
|
-
errors.email.message ? undefined : 'customer.form.error'
|
|
232
|
-
}
|
|
233
|
-
style={[styles.error, { color: themeColors.error }]}
|
|
234
|
-
>
|
|
235
|
-
{errors.email.message}
|
|
236
|
-
</AppText>
|
|
237
|
-
)}
|
|
238
|
-
|
|
239
|
-
<Controller
|
|
240
|
-
control={control}
|
|
241
|
-
rules={{
|
|
242
|
-
validate: (value) => {
|
|
243
|
-
if (!value) return true;
|
|
244
|
-
return (
|
|
245
|
-
typeof value === 'string' ||
|
|
246
|
-
localize('customer.form.validation.phone.invalid')
|
|
247
|
-
);
|
|
248
|
-
},
|
|
294
|
+
onResendButton={() => {
|
|
295
|
+
setPopupVisible(false);
|
|
249
296
|
}}
|
|
250
|
-
render={({ field: { onChange, value } }) => (
|
|
251
|
-
<TextInput
|
|
252
|
-
style={inputStyle}
|
|
253
|
-
placeholder={localize('customer.form.placeholder.phone')}
|
|
254
|
-
placeholderTextColor="#6C757D"
|
|
255
|
-
value={value}
|
|
256
|
-
onChangeText={onChange}
|
|
257
|
-
keyboardType="phone-pad"
|
|
258
|
-
/>
|
|
259
|
-
)}
|
|
260
|
-
name="phone"
|
|
261
297
|
/>
|
|
262
|
-
{errors.phone && (
|
|
263
|
-
<AppText
|
|
264
|
-
localization={
|
|
265
|
-
errors.phone.message ? undefined : 'customer.form.error'
|
|
266
|
-
}
|
|
267
|
-
style={[styles.error, { color: themeColors.error }]}
|
|
268
|
-
>
|
|
269
|
-
{errors.phone.message}
|
|
270
|
-
</AppText>
|
|
271
|
-
)}
|
|
272
|
-
<TouchableOpacity
|
|
273
|
-
style={[styles.button, { backgroundColor: themeColors.primary }]}
|
|
274
|
-
onPress={handleSubmit(onSubmit)}
|
|
275
|
-
>
|
|
276
|
-
<AppText
|
|
277
|
-
localization="customer.form.submit"
|
|
278
|
-
style={styles.buttonText}
|
|
279
|
-
/>
|
|
280
|
-
</TouchableOpacity>
|
|
281
298
|
</Pressable>
|
|
282
299
|
);
|
|
283
300
|
}
|
|
284
301
|
|
|
285
|
-
const styles =
|
|
302
|
+
const styles = ScaledSheet.create({
|
|
286
303
|
container: {
|
|
287
|
-
|
|
304
|
+
paddingBottom: '24@vs',
|
|
288
305
|
flex: 1,
|
|
289
|
-
justifyContent: '
|
|
306
|
+
justifyContent: 'space-between',
|
|
290
307
|
},
|
|
291
308
|
headerContainer: {
|
|
292
|
-
|
|
309
|
+
paddingHorizontal: '24@s',
|
|
310
|
+
marginBottom: '24@vs',
|
|
311
|
+
paddingBottom: '32@vs',
|
|
293
312
|
},
|
|
294
313
|
headerText: {
|
|
295
|
-
fontSize:
|
|
314
|
+
fontSize: '30@vs',
|
|
296
315
|
fontWeight: '600',
|
|
297
|
-
textAlign: '
|
|
316
|
+
textAlign: 'left',
|
|
298
317
|
},
|
|
299
318
|
input: {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
paddingHorizontal: 16,
|
|
304
|
-
fontSize: 16,
|
|
319
|
+
borderRadius: '12@s',
|
|
320
|
+
paddingHorizontal: '12@s',
|
|
321
|
+
fontSize: '16@vs',
|
|
305
322
|
backgroundColor: 'white',
|
|
306
|
-
|
|
323
|
+
paddingVertical: '8@vs',
|
|
324
|
+
width: '95%',
|
|
307
325
|
},
|
|
308
326
|
button: {
|
|
309
|
-
|
|
310
|
-
|
|
327
|
+
paddingHorizontal: '16@s',
|
|
328
|
+
paddingVertical: '16@vs',
|
|
329
|
+
borderRadius: '12@s',
|
|
311
330
|
alignItems: 'center',
|
|
312
|
-
marginTop: 24,
|
|
331
|
+
marginTop: '24@vs',
|
|
332
|
+
marginHorizontal: '20@s',
|
|
313
333
|
},
|
|
314
334
|
buttonText: {
|
|
315
335
|
color: 'white',
|
|
316
|
-
fontSize: 16,
|
|
336
|
+
fontSize: '16@vs',
|
|
317
337
|
fontWeight: '600',
|
|
318
338
|
},
|
|
319
339
|
error: {
|
|
320
|
-
fontSize: 14,
|
|
321
|
-
marginLeft: 16,
|
|
322
|
-
top: -16,
|
|
340
|
+
fontSize: '14@vs',
|
|
341
|
+
marginLeft: '16@s',
|
|
342
|
+
top: '-16@vs',
|
|
323
343
|
},
|
|
324
344
|
modalContainer: {
|
|
325
345
|
flex: 1,
|
|
@@ -329,11 +349,39 @@ const styles = StyleSheet.create({
|
|
|
329
349
|
modalContent: {
|
|
330
350
|
width: '90%',
|
|
331
351
|
height: '70%',
|
|
332
|
-
borderRadius: 12,
|
|
352
|
+
borderRadius: '12@s',
|
|
333
353
|
overflow: 'hidden',
|
|
334
354
|
},
|
|
335
355
|
countryItem: {
|
|
336
|
-
|
|
356
|
+
paddingHorizontal: '16@s',
|
|
357
|
+
paddingVertical: '16@vs',
|
|
358
|
+
borderBottomWidth: 1,
|
|
359
|
+
},
|
|
360
|
+
title: {
|
|
361
|
+
fontSize: '16@vs',
|
|
362
|
+
},
|
|
363
|
+
iconContainer: {
|
|
364
|
+
paddingHorizontal: '20@s',
|
|
365
|
+
paddingVertical: '10@vs',
|
|
366
|
+
},
|
|
367
|
+
inputContainer: {
|
|
368
|
+
flexDirection: 'row',
|
|
369
|
+
alignItems: 'center',
|
|
337
370
|
borderBottomWidth: 1,
|
|
371
|
+
marginBottom: '8@vs',
|
|
372
|
+
},
|
|
373
|
+
closeIcon: {
|
|
374
|
+
width: '24@vs',
|
|
375
|
+
height: '24@vs',
|
|
376
|
+
},
|
|
377
|
+
scrollContainer: {
|
|
378
|
+
flexGrow: 1,
|
|
379
|
+
justifyContent: 'space-between',
|
|
380
|
+
},
|
|
381
|
+
infoIcon: {
|
|
382
|
+
width: '24@vs',
|
|
383
|
+
height: '24@vs',
|
|
384
|
+
tintColor: 'red',
|
|
338
385
|
},
|
|
386
|
+
titleContainer: { marginHorizontal: '20@s', flex: 1 },
|
|
339
387
|
});
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { View,
|
|
1
|
+
import { View, Image } from 'react-native';
|
|
2
2
|
import { useThemeColors } from '../hooks/useThemeColors';
|
|
3
3
|
import { AppText } from './AppText';
|
|
4
|
+
import type { LocalizationKeys } from '../types/LocalizationKeys';
|
|
5
|
+
import { ScaledSheet } from './ScaledSheet';
|
|
6
|
+
|
|
7
|
+
const notificationIcon = require('../assets/message-notification-square.png');
|
|
4
8
|
|
|
5
9
|
export function EmptyList() {
|
|
6
10
|
const themeColors = useThemeColors();
|
|
@@ -9,24 +13,44 @@ export function EmptyList() {
|
|
|
9
13
|
<View
|
|
10
14
|
style={[styles.container, { backgroundColor: themeColors.background }]}
|
|
11
15
|
>
|
|
16
|
+
<Image
|
|
17
|
+
source={notificationIcon}
|
|
18
|
+
style={[styles.notificationIcon, { tintColor: themeColors.text }]}
|
|
19
|
+
/>
|
|
20
|
+
<AppText
|
|
21
|
+
localization={'chat.empty.title' as keyof LocalizationKeys}
|
|
22
|
+
style={[styles.title, { color: themeColors.text }]}
|
|
23
|
+
/>
|
|
12
24
|
<AppText
|
|
13
|
-
localization=
|
|
14
|
-
style={[styles.
|
|
25
|
+
localization={'chat.empty.description' as keyof LocalizationKeys}
|
|
26
|
+
style={[styles.description, { color: themeColors.text }]}
|
|
15
27
|
/>
|
|
16
28
|
</View>
|
|
17
29
|
);
|
|
18
30
|
}
|
|
19
31
|
|
|
20
|
-
const styles =
|
|
32
|
+
const styles = ScaledSheet.create({
|
|
21
33
|
container: {
|
|
22
34
|
flex: 1,
|
|
23
35
|
alignItems: 'center',
|
|
24
36
|
justifyContent: 'center',
|
|
25
|
-
|
|
37
|
+
paddingHorizontal: '20@s',
|
|
38
|
+
paddingVertical: '20@vs',
|
|
26
39
|
transform: [{ rotate: '180deg' }], //TODO: inverted list
|
|
40
|
+
gap: 15,
|
|
27
41
|
},
|
|
28
|
-
|
|
29
|
-
fontSize:
|
|
42
|
+
title: {
|
|
43
|
+
fontSize: '18@vs',
|
|
30
44
|
textAlign: 'center',
|
|
45
|
+
fontWeight: 600,
|
|
46
|
+
},
|
|
47
|
+
description: {
|
|
48
|
+
fontSize: '16@vs',
|
|
49
|
+
textAlign: 'center',
|
|
50
|
+
fontWeight: 400,
|
|
51
|
+
},
|
|
52
|
+
notificationIcon: {
|
|
53
|
+
width: '40@vs',
|
|
54
|
+
height: '40@vs',
|
|
31
55
|
},
|
|
32
56
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { TouchableOpacity, View
|
|
1
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
2
2
|
import { useThemeColors } from '../hooks/useThemeColors';
|
|
3
3
|
import { AppText } from './AppText';
|
|
4
|
+
import { ScaledSheet } from './ScaledSheet';
|
|
4
5
|
|
|
5
6
|
interface InitFailedProps {
|
|
6
7
|
setInitFailed: (value: boolean) => void;
|
|
@@ -26,21 +27,23 @@ export function InitFailed({ setInitFailed }: InitFailedProps) {
|
|
|
26
27
|
);
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
const styles =
|
|
30
|
+
const styles = ScaledSheet.create({
|
|
30
31
|
container: {
|
|
31
32
|
flex: 1,
|
|
32
33
|
alignItems: 'center',
|
|
33
34
|
justifyContent: 'center',
|
|
34
|
-
|
|
35
|
+
paddingHorizontal: '20@s',
|
|
36
|
+
paddingVertical: '20@vs',
|
|
35
37
|
},
|
|
36
38
|
retryButton: {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
paddingHorizontal: '15@s',
|
|
40
|
+
paddingVertical: '15@vs',
|
|
41
|
+
borderRadius: '8@s',
|
|
39
42
|
alignItems: 'center',
|
|
40
43
|
justifyContent: 'center',
|
|
41
44
|
},
|
|
42
45
|
retryText: {
|
|
43
|
-
fontSize: 16,
|
|
46
|
+
fontSize: '16@vs',
|
|
44
47
|
fontWeight: '500',
|
|
45
48
|
},
|
|
46
49
|
});
|