@developer_tribe/react-native-comnyx 0.3.9 → 0.3.11

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 (27) hide show
  1. package/lib/commonjs/components/ChatList.js +166 -147
  2. package/lib/commonjs/components/ChatList.js.map +1 -1
  3. package/lib/commonjs/components/CustomerForm.js +175 -168
  4. package/lib/commonjs/components/CustomerForm.js.map +1 -1
  5. package/lib/commonjs/components/MessageItem.js +2 -1
  6. package/lib/commonjs/components/MessageItem.js.map +1 -1
  7. package/lib/commonjs/constants/translations.js +15 -15
  8. package/lib/commonjs/constants/translations.js.map +1 -1
  9. package/lib/module/components/ChatList.js +168 -149
  10. package/lib/module/components/ChatList.js.map +1 -1
  11. package/lib/module/components/CustomerForm.js +177 -170
  12. package/lib/module/components/CustomerForm.js.map +1 -1
  13. package/lib/module/components/MessageItem.js +2 -1
  14. package/lib/module/components/MessageItem.js.map +1 -1
  15. package/lib/module/constants/translations.js +15 -15
  16. package/lib/module/constants/translations.js.map +1 -1
  17. package/lib/typescript/commonjs/src/components/ChatList.d.ts.map +1 -1
  18. package/lib/typescript/commonjs/src/components/CustomerForm.d.ts.map +1 -1
  19. package/lib/typescript/commonjs/src/constants/translations.d.ts.map +1 -1
  20. package/lib/typescript/module/src/components/ChatList.d.ts.map +1 -1
  21. package/lib/typescript/module/src/components/CustomerForm.d.ts.map +1 -1
  22. package/lib/typescript/module/src/constants/translations.d.ts.map +1 -1
  23. package/package.json +1 -1
  24. package/src/components/ChatList.tsx +207 -176
  25. package/src/components/CustomerForm.tsx +202 -188
  26. package/src/components/MessageItem.tsx +1 -0
  27. package/src/constants/translations.ts +15 -24
@@ -5,6 +5,7 @@ import {
5
5
  Keyboard,
6
6
  Image,
7
7
  ScrollView,
8
+ StatusBar,
8
9
  } from 'react-native';
9
10
  import { useForm, Controller } from 'react-hook-form';
10
11
  import { useAppStore } from '../store';
@@ -95,209 +96,222 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
95
96
  };
96
97
 
97
98
  return (
98
- <TouchableOpacity
99
- style={[styles.container, { backgroundColor: themeColors.background }]}
100
- onPress={Keyboard.dismiss}
101
- activeOpacity={activeOpacity}
102
- >
103
- <ScrollView
104
- contentContainerStyle={styles.scrollContainer}
105
- keyboardShouldPersistTaps="handled"
99
+ <>
100
+ <StatusBar
101
+ barStyle={'dark-content'}
102
+ backgroundColor={themeColors.dark_background}
103
+ animated={false}
104
+ translucent
105
+ />
106
+ <TouchableOpacity
107
+ style={[styles.container, { backgroundColor: themeColors.background }]}
108
+ onPress={Keyboard.dismiss}
109
+ activeOpacity={1}
106
110
  >
107
- <View
108
- style={[
109
- styles.container,
110
- { backgroundColor: themeColors.background },
111
- ]}
111
+ <ScrollView
112
+ contentContainerStyle={styles.scrollContainer}
113
+ keyboardShouldPersistTaps="handled"
112
114
  >
113
- <TouchableOpacity
114
- activeOpacity={activeOpacity}
115
- style={[
116
- styles.iconContainer,
117
- { backgroundColor: themeColors.dark_background },
118
- ]}
119
- onPress={onBack}
120
- >
121
- <Image
122
- source={closeIcon}
123
- style={[styles.closeIcon, { tintColor: themeColors.light_text }]}
124
- />
125
- </TouchableOpacity>
126
115
  <View
127
116
  style={[
128
- styles.headerContainer,
129
- { backgroundColor: themeColors.dark_background },
117
+ styles.container,
118
+ { backgroundColor: themeColors.background },
130
119
  ]}
131
120
  >
132
- <AppText
133
- localization="customer.form.title"
134
- style={[styles.headerText, { color: themeColors.gainsboro }]}
135
- />
136
- <AppText
137
- localization="customer.form.instructions"
138
- style={[styles.headerText, { color: themeColors.light_text }]}
139
- />
140
- </View>
141
- <View style={styles.titleContainer}>
142
- <AppText
121
+ <TouchableOpacity
122
+ activeOpacity={activeOpacity}
143
123
  style={[
144
- styles.title,
145
- {
146
- color: themeColors.slate,
147
- },
124
+ styles.iconContainer,
125
+ { backgroundColor: themeColors.dark_background },
148
126
  ]}
127
+ onPress={onBack}
149
128
  >
150
- {localize('customer.form.name')}
151
- </AppText>
152
- <Controller
153
- control={control}
154
- rules={{
155
- maxLength: {
156
- value: 30,
157
- message: localize('customer.form.validation.name.maxLength'),
158
- },
159
- }}
160
- render={({ field: { onChange, value } }) => (
161
- <View
162
- style={[
163
- styles.inputContainer,
164
- { borderBottomColor: themeColors.ghost },
165
- ]}
166
- >
167
- <TextInput
168
- style={inputStyle}
169
- placeholder={localize('customer.form.placeholder.name')}
170
- placeholderTextColor={themeColors.gainsboro}
171
- value={value}
172
- onChangeText={onChange}
173
- />
174
- {errors.name && (
175
- <InfoButton
176
- title={'customer.form.failed.name'}
177
- description={'customer.form.failed.name.desc'}
178
- />
179
- )}
180
- </View>
181
- )}
182
- name="name"
183
- />
184
- <AppText
129
+ <Image
130
+ source={closeIcon}
131
+ style={[
132
+ styles.closeIcon,
133
+ { tintColor: themeColors.light_text },
134
+ ]}
135
+ />
136
+ </TouchableOpacity>
137
+ <View
185
138
  style={[
186
- styles.title,
187
- {
188
- color: themeColors.slate,
189
- },
139
+ styles.headerContainer,
140
+ { backgroundColor: themeColors.dark_background },
190
141
  ]}
191
142
  >
192
- Email
193
- </AppText>
194
- <Controller
195
- control={control}
196
- rules={{
197
- pattern: {
198
- value: /^\S+@\S+$/i,
199
- message: localize('customer.form.validation.email.pattern'),
200
- },
201
- }}
202
- render={({ field: { onChange, value } }) => (
203
- <View
204
- style={[
205
- styles.inputContainer,
206
- { borderBottomColor: themeColors.ghost },
207
- ]}
208
- >
209
- <TextInput
210
- style={inputStyle}
211
- placeholder={localize('customer.form.placeholder.email')}
212
- placeholderTextColor={themeColors.gainsboro}
213
- value={value}
214
- onChangeText={onChange}
215
- keyboardType="email-address"
216
- />
217
- {errors.email && (
218
- <InfoButton
219
- title={'customer.form.failed.email'}
220
- description={'customer.form.failed.email.desc'}
143
+ <AppText
144
+ localization="customer.form.title"
145
+ style={[styles.headerText, { color: themeColors.gainsboro }]}
146
+ />
147
+ <AppText
148
+ localization="customer.form.instructions"
149
+ style={[styles.headerText, { color: themeColors.light_text }]}
150
+ />
151
+ </View>
152
+ <View style={styles.titleContainer}>
153
+ <AppText
154
+ style={[
155
+ styles.title,
156
+ {
157
+ color: themeColors.slate,
158
+ },
159
+ ]}
160
+ >
161
+ {localize('customer.form.name')}
162
+ </AppText>
163
+ <Controller
164
+ control={control}
165
+ rules={{
166
+ maxLength: {
167
+ value: 30,
168
+ message: localize(
169
+ 'customer.form.validation.name.maxLength'
170
+ ),
171
+ },
172
+ }}
173
+ render={({ field: { onChange, value } }) => (
174
+ <View
175
+ style={[
176
+ styles.inputContainer,
177
+ { borderBottomColor: themeColors.ghost },
178
+ ]}
179
+ >
180
+ <TextInput
181
+ style={inputStyle}
182
+ placeholder={localize('customer.form.placeholder.name')}
183
+ placeholderTextColor={themeColors.gainsboro}
184
+ value={value}
185
+ onChangeText={onChange}
221
186
  />
222
- )}
223
- </View>
224
- )}
225
- name="email"
226
- />
227
- <AppText
228
- style={[
229
- styles.title,
230
- {
231
- color: themeColors.slate,
232
- },
233
- ]}
234
- >
235
- Phone
236
- </AppText>
237
- <Controller
238
- control={control}
239
- rules={{
240
- validate: (value) => {
241
- if (!value) return true;
242
- return (
243
- typeof value === 'string' ||
244
- localize('customer.form.validation.phone.invalid')
245
- );
246
- },
247
- }}
248
- render={({ field: { onChange, value } }) => (
249
- <View
250
- style={[
251
- styles.inputContainer,
252
- { borderBottomColor: themeColors.ghost },
253
- ]}
254
- >
255
- <TextInput
256
- style={inputStyle}
257
- placeholder={localize('customer.form.placeholder.phone')}
258
- placeholderTextColor={themeColors.gainsboro}
259
- value={value}
260
- onChangeText={onChange}
261
- keyboardType="phone-pad"
262
- />
263
- {errors.phone && (
264
- <InfoButton
265
- title={'customer.form.failed.phone'}
266
- description={'customer.form.failed.phone.desc'}
187
+ {errors.name && (
188
+ <InfoButton
189
+ title={'customer.form.failed.name'}
190
+ description={'customer.form.failed.name.desc'}
191
+ />
192
+ )}
193
+ </View>
194
+ )}
195
+ name="name"
196
+ />
197
+ <AppText
198
+ style={[
199
+ styles.title,
200
+ {
201
+ color: themeColors.slate,
202
+ },
203
+ ]}
204
+ >
205
+ Email
206
+ </AppText>
207
+ <Controller
208
+ control={control}
209
+ rules={{
210
+ pattern: {
211
+ value: /^\S+@\S+$/i,
212
+ message: localize('customer.form.validation.email.pattern'),
213
+ },
214
+ }}
215
+ render={({ field: { onChange, value } }) => (
216
+ <View
217
+ style={[
218
+ styles.inputContainer,
219
+ { borderBottomColor: themeColors.ghost },
220
+ ]}
221
+ >
222
+ <TextInput
223
+ style={inputStyle}
224
+ placeholder={localize('customer.form.placeholder.email')}
225
+ placeholderTextColor={themeColors.gainsboro}
226
+ value={value}
227
+ onChangeText={onChange}
228
+ keyboardType="email-address"
229
+ />
230
+ {errors.email && (
231
+ <InfoButton
232
+ title={'customer.form.failed.email'}
233
+ description={'customer.form.failed.email.desc'}
234
+ />
235
+ )}
236
+ </View>
237
+ )}
238
+ name="email"
239
+ />
240
+ <AppText
241
+ style={[
242
+ styles.title,
243
+ {
244
+ color: themeColors.slate,
245
+ },
246
+ ]}
247
+ >
248
+ Phone
249
+ </AppText>
250
+ <Controller
251
+ control={control}
252
+ rules={{
253
+ validate: (value) => {
254
+ if (!value) return true;
255
+ return (
256
+ typeof value === 'string' ||
257
+ localize('customer.form.validation.phone.invalid')
258
+ );
259
+ },
260
+ }}
261
+ render={({ field: { onChange, value } }) => (
262
+ <View
263
+ style={[
264
+ styles.inputContainer,
265
+ { borderBottomColor: themeColors.ghost },
266
+ ]}
267
+ >
268
+ <TextInput
269
+ style={inputStyle}
270
+ placeholder={localize('customer.form.placeholder.phone')}
271
+ placeholderTextColor={themeColors.gainsboro}
272
+ value={value}
273
+ onChangeText={onChange}
274
+ keyboardType="phone-pad"
267
275
  />
268
- )}
269
- </View>
270
- )}
271
- name="phone"
272
- />
276
+ {errors.phone && (
277
+ <InfoButton
278
+ title={'customer.form.failed.phone'}
279
+ description={'customer.form.failed.phone.desc'}
280
+ />
281
+ )}
282
+ </View>
283
+ )}
284
+ name="phone"
285
+ />
286
+ </View>
273
287
  </View>
274
- <TouchableOpacity
275
- activeOpacity={activeOpacity}
276
- style={[
277
- styles.button,
278
- { backgroundColor: themeColors.dark_background },
279
- ]}
280
- onPress={handleSubmit(onSubmit)}
281
- >
282
- <AppText
283
- localization="customer.form.submit"
284
- style={[styles.buttonText, { color: themeColors.light_text }]}
285
- />
286
- </TouchableOpacity>
287
- </View>
288
- </ScrollView>
289
- <CustomPopup
290
- isVisible={popupVisible}
291
- onClose={() => setPopupVisible(false)}
292
- title={popupContent.title}
293
- description={popupContent.description}
294
- onCancelButton={() => {
295
- setPopupVisible(false);
296
- setPopupContent({ title: '', description: '' });
297
- }}
298
- buttonText={'customer.form.cancel' as keyof LocalizationKeys}
299
- />
300
- </TouchableOpacity>
288
+ </ScrollView>
289
+ <TouchableOpacity
290
+ activeOpacity={activeOpacity}
291
+ style={[
292
+ styles.button,
293
+ { backgroundColor: themeColors.dark_background },
294
+ ]}
295
+ onPress={handleSubmit(onSubmit)}
296
+ >
297
+ <AppText
298
+ localization="customer.form.submit"
299
+ style={[styles.buttonText, { color: themeColors.light_text }]}
300
+ />
301
+ </TouchableOpacity>
302
+ <CustomPopup
303
+ isVisible={popupVisible}
304
+ onClose={() => setPopupVisible(false)}
305
+ title={popupContent.title}
306
+ description={popupContent.description}
307
+ onCancelButton={() => {
308
+ setPopupVisible(false);
309
+ setPopupContent({ title: '', description: '' });
310
+ }}
311
+ buttonText={'customer.form.cancel' as keyof LocalizationKeys}
312
+ />
313
+ </TouchableOpacity>
314
+ </>
301
315
  );
302
316
  }
303
317
 
@@ -176,6 +176,7 @@ const styles = ScaledSheet.create({
176
176
  maxWidth: '80%',
177
177
  minHeight: 60,
178
178
  minWidth: 100,
179
+ marginVertical: '5@vs',
179
180
  },
180
181
  leftMessage: {
181
182
  alignSelf: 'flex-start',
@@ -10,8 +10,7 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
10
10
  'customer.form.country': 'Country',
11
11
  'customer.form.submit': 'Contact Now',
12
12
  'customer.form.error': 'Please fill in all required fields',
13
- 'customer.form.instructions':
14
- 'Complete the form below to receive personalized service',
13
+ 'customer.form.instructions': 'How Can We Help You?',
15
14
  'customer.form.error.country': 'Country is required',
16
15
  'customer.form.error.email': 'Valid email is required',
17
16
  'customer.form.error.phone': 'Phone is required',
@@ -57,9 +56,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
57
56
  'customer.form.country': 'Ülke',
58
57
  'customer.form.submit': 'Şimdi İletişime Geç',
59
58
  'customer.form.error': 'Lütfen tüm zorunlu alanları doldurun',
60
- 'customer.form.instructions':
61
- 'Kişiselleştirilmiş hizmet almak için aşağıdaki formu doldurun',
62
- 'customer.form.error.country': 'Ülke alanı zorunludur',
59
+ 'customer.form.instructions': 'Size Nasıl Yardımcı Olabiliriz?',
60
+ 'customer.form.error.country': 'Ülke zorunludur',
63
61
  'customer.form.error.email': 'Geçerli bir e-posta adresi gerekli',
64
62
  'customer.form.error.phone': 'Telefon alanı zorunludur',
65
63
  'customer.form.placeholder.name': 'Adınızı girin',
@@ -104,9 +102,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
104
102
  'customer.form.country': 'País',
105
103
  'customer.form.submit': 'Contactar Ahora',
106
104
  'customer.form.error': 'Por favor complete todos los campos requeridos',
107
- 'customer.form.instructions':
108
- 'Complete el formulario a continuación para recibir un servicio personalizado',
109
- 'customer.form.error.country': 'El país es requerido',
105
+ 'customer.form.instructions': '¿Cómo Podemos Ayudarte?',
106
+ 'customer.form.error.country': 'País es obligatorio',
110
107
  'customer.form.error.email': 'Se requiere un correo electrónico válido',
111
108
  'customer.form.error.phone': 'El teléfono es requerido',
112
109
  'customer.form.placeholder.name': 'Ingrese su nombre',
@@ -153,9 +150,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
153
150
  'customer.form.country': 'Pays',
154
151
  'customer.form.submit': 'Contacter Maintenant',
155
152
  'customer.form.error': 'Veuillez remplir tous les champs obligatoires',
156
- 'customer.form.instructions':
157
- 'Complétez le formulaire ci-dessous pour recevoir un service personnalisé',
158
- 'customer.form.error.country': 'Le pays est requis',
153
+ 'customer.form.instructions': 'Comment Pouvons-Nous Vous Aider?',
154
+ 'customer.form.error.country': 'Le pays est obligatoire',
159
155
  'customer.form.error.email': 'Un email valide est requis',
160
156
  'customer.form.error.phone': 'Le téléphone est requis',
161
157
  'customer.form.placeholder.name': 'Entrez votre nom',
@@ -203,8 +199,7 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
203
199
  'customer.form.country': 'Land',
204
200
  'customer.form.submit': 'Jetzt Kontaktieren',
205
201
  'customer.form.error': 'Bitte füllen Sie alle erforderlichen Felder aus',
206
- 'customer.form.instructions':
207
- 'Füllen Sie das folgende Formular aus, um einen personalisierten Service zu erhalten',
202
+ 'customer.form.instructions': 'Wie Können Wir Ihnen Helfen?',
208
203
  'customer.form.error.country': 'Land ist erforderlich',
209
204
  'customer.form.error.email': 'Eine gültige E-Mail-Adresse ist erforderlich',
210
205
  'customer.form.error.phone': 'Telefon ist erforderlich',
@@ -254,8 +249,7 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
254
249
  'customer.form.country': 'Paese',
255
250
  'customer.form.submit': 'Contatta Ora',
256
251
  'customer.form.error': 'Si prega di compilare tutti i campi obbligatori',
257
- 'customer.form.instructions':
258
- 'Completa il modulo sottostante per ricevere un servizio personalizzato',
252
+ 'customer.form.instructions': 'Come Possiamo Aiutarti?',
259
253
  'customer.form.error.country': 'Il paese è obbligatorio',
260
254
  'customer.form.error.email': "È richiesta un'email valida",
261
255
  'customer.form.error.phone': 'Il telefono è obbligatorio',
@@ -302,9 +296,8 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
302
296
  'customer.form.country': 'País',
303
297
  'customer.form.submit': 'Contactar Agora',
304
298
  'customer.form.error': 'Por favor, preencha todos os campos obrigatórios',
305
- 'customer.form.instructions':
306
- 'Complete o formulário abaixo para receber um serviço personalizado',
307
- 'customer.form.error.country': 'O país é obrigatório',
299
+ 'customer.form.instructions': 'Como Podemos Ajudar Você?',
300
+ 'customer.form.error.country': 'País é obrigatório',
308
301
  'customer.form.error.email': 'Um email válido é obrigatório',
309
302
  'customer.form.error.phone': 'O telefone é obrigatório',
310
303
  'customer.form.placeholder.name': 'Digite seu nome',
@@ -327,7 +320,7 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
327
320
  'customer.form.validation.name.maxLength':
328
321
  'O nome deve ter menos de 30 caracteres',
329
322
  'chat.empty.title': 'Você não tem mensagens.',
330
- 'chat.empty.description': 'As mensagens da equipe serão exibidas aqui.',
323
+ 'chat.empty.description': 'As mensaggi da equipe serão exibidas aqui.',
331
324
  'chat.live': 'Chat ao Vivo',
332
325
  'chat.support-team': 'Equipe de Suporte',
333
326
  'customer.form.resend': 'Reenviar',
@@ -352,8 +345,7 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
352
345
  'customer.form.country': 'Страна',
353
346
  'customer.form.submit': 'Связаться Сейчас',
354
347
  'customer.form.error': 'Пожалуйста, заполните все обязательные поля',
355
- 'customer.form.instructions':
356
- 'Заполните форму ниже, чтобы получить персонализированное обслуживание',
348
+ 'customer.form.instructions': 'Как Мы Можем Вам Помочь?',
357
349
  'customer.form.error.country': 'Страна обязательна',
358
350
  'customer.form.error.email': 'Требуется действительный email',
359
351
  'customer.form.error.phone': 'Телефон обязателен',
@@ -402,8 +394,7 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
402
394
  'customer.form.country': '国',
403
395
  'customer.form.submit': '今すぐ連絡する',
404
396
  'customer.form.error': '必須項目をすべて入力してください',
405
- 'customer.form.instructions':
406
- 'パーソナライズされたサービスを受けるには、以下のフォームに記入してください',
397
+ 'customer.form.instructions': 'どのようにお手伝いできますか?',
407
398
  'customer.form.error.country': '国は必須です',
408
399
  'customer.form.error.email': '有効なメールアドレスが必要です',
409
400
  'customer.form.error.phone': '電話番号は必須です',
@@ -449,7 +440,7 @@ export const LocalizationList: Record<LanguageCode, LocalizationKeys> = {
449
440
  'customer.form.country': '国家',
450
441
  'customer.form.submit': '立即联系',
451
442
  'customer.form.error': '请填写所有必填字段',
452
- 'customer.form.instructions': '填写以下表格以获取个性化服务',
443
+ 'customer.form.instructions': '我们能为您做什么?',
453
444
  'customer.form.error.country': '国家为必填项',
454
445
  'customer.form.error.email': '需要有效的电子邮件',
455
446
  'customer.form.error.phone': '电话为必填项',