ordering-ui-react-native 0.11.15 → 0.11.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.11.15",
3
+ "version": "0.11.16",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -469,12 +469,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
469
469
  {
470
470
  (
471
471
  parseInt(order?.status) === 1 ||
472
- parseInt(order?.status) === 2 ||
473
- parseInt(order?.status) === 5 ||
474
- parseInt(order?.status) === 6 ||
475
- parseInt(order?.status) === 10 ||
476
472
  parseInt(order?.status) === 11 ||
477
- parseInt(order?.status) === 12
473
+ parseInt(order?.status) === 15
478
474
  ) && !order.review && !isReviewed && (
479
475
  <OButton
480
476
  onClick={() => handleClickOrderReview(order)}
@@ -1,9 +1,9 @@
1
1
  import React, { createRef, useEffect, useRef, useState } from 'react';
2
- import { View, Pressable, StyleSheet, Keyboard, TextStyle } from 'react-native';
2
+ import { View, Pressable, StyleSheet, Keyboard, TextStyle, Linking, TouchableOpacity, Platform } from 'react-native';
3
3
  import { useForm, Controller } from 'react-hook-form';
4
4
  import Spinner from 'react-native-loading-spinner-overlay';
5
5
  import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'
6
-
6
+ import CheckBox from '@react-native-community/checkbox';
7
7
  import { PhoneInputNumber } from '../PhoneInputNumber'
8
8
  import { FacebookLogin } from '../FacebookLogin'
9
9
 
@@ -99,7 +99,11 @@ const SignupFormUI = (props: SignupParams) => {
99
99
  flexDirection: 'row',
100
100
  justifyContent: 'space-between',
101
101
  marginBottom: 30
102
- }
102
+ },
103
+ checkBoxStyle: {
104
+ width: 25,
105
+ height: 25,
106
+ }
103
107
  });
104
108
  const showInputPhoneNumber = validationFields?.fields?.checkout?.cellphone?.enabled ?? false
105
109
 
@@ -259,6 +263,15 @@ const SignupFormUI = (props: SignupParams) => {
259
263
  onChange(value.toLowerCase().replace(/[&,()%";:ç?<>{}\\[\]\s]/g, ''))
260
264
  }
261
265
 
266
+ const handleOpenTermsUrl = async (url: any) => {
267
+ const supported = await Linking.canOpenURL(url);
268
+ if (supported) {
269
+ await Linking.openURL(url);
270
+ } else {
271
+ showToast(ToastType.Error, t('VALIDATION_ERROR_ACTIVE_URL', 'The _attribute_ is not a valid URL.').replace('_attribute_', t('URL', 'URL')))
272
+ }
273
+ }
274
+
262
275
  useEffect(() => {
263
276
  if (!formState.loading && formState.result?.error) {
264
277
  formState.result?.result && showToast(
@@ -509,6 +522,42 @@ const SignupFormUI = (props: SignupParams) => {
509
522
  <Spinner visible />
510
523
  )}
511
524
 
525
+ {configs?.terms_and_conditions?.value === 'true' && (
526
+ <View style={{ flexDirection: 'row', alignItems: 'center', marginTop: 10 }}>
527
+ <Controller
528
+ control={control}
529
+ render={({ onChange, value }: any) => (
530
+ <CheckBox
531
+ value={value}
532
+ onValueChange={newValue => {
533
+ onChange(newValue)
534
+ }}
535
+ boxType={'square'}
536
+ tintColors={{
537
+ true: theme.colors.primary,
538
+ false: theme.colors.disabled
539
+ }}
540
+ tintColor={theme.colors.disabled}
541
+ onCheckColor={theme.colors.primary}
542
+ onTintColor={theme.colors.primary}
543
+ style={Platform.OS === 'ios' && registerStyles.checkBoxStyle}
544
+ />
545
+ )}
546
+ name='termsAccept'
547
+ rules={{
548
+ required: t('VALIDATION_ERROR_ACCEPTED', 'The _attribute_ must be accepted.').replace('_attribute_', t('TERMS_AND_CONDITIONS', 'Terms & Conditions'))
549
+ }}
550
+ defaultValue={false}
551
+ />
552
+ <OText style={{ ...theme.labels.middle, paddingHorizontal: 5 }}>{t('TERMS_AND_CONDITIONS_TEXT', 'I’m agree with')}</OText>
553
+ <TouchableOpacity
554
+ onPress={() => handleOpenTermsUrl(configs?.terms_and_conditions_url?.value)}
555
+ >
556
+ <OText style={{ ...theme.labels.middle }} color={theme.colors.primary}>{t('TERMS_AND_CONDITIONS', 'Terms & Conditions')}</OText>
557
+ </TouchableOpacity>
558
+ </View>
559
+ )}
560
+
512
561
  {signupTab === 'cellphone' && useSignupByEmail && useSignupByCellphone ? (
513
562
  <OButton
514
563
  onClick={handleSubmit(onSubmit)}
@@ -1,5 +1,5 @@
1
1
  import React, { createRef, useEffect, useRef, useState } from 'react';
2
- import { View, Pressable, StyleSheet, Keyboard } from 'react-native';
2
+ import { View, Pressable, StyleSheet, Keyboard, Linking, Platform } from 'react-native';
3
3
  import { useForm, Controller } from 'react-hook-form';
4
4
  import Spinner from 'react-native-loading-spinner-overlay';
5
5
 
@@ -31,6 +31,7 @@ import NavBar from '../NavBar'
31
31
  import { VerifyPhone } from '../VerifyPhone';
32
32
 
33
33
  import { OText, OButton, OInput, OModal } from '../shared';
34
+ import CheckBox from '@react-native-community/checkbox';
34
35
  import { SignupParams } from '../../types';
35
36
  import { sortInputFields } from '../../utils';
36
37
  import { useTheme } from 'styled-components/native';
@@ -90,7 +91,11 @@ const SignupFormUI = (props: SignupParams) => {
90
91
  paddingBottom: 20 + bottom,
91
92
  borderTopWidth: 1,
92
93
  borderTopColor: theme.colors.secundary
93
- }
94
+ },
95
+ checkBoxStyle: {
96
+ width: 20,
97
+ height: 20,
98
+ }
94
99
  });
95
100
 
96
101
  const showInputPhoneNumber = validationFields?.fields?.checkout?.cellphone?.enabled ?? false
@@ -249,6 +254,16 @@ const SignupFormUI = (props: SignupParams) => {
249
254
  onChange(value.toLowerCase().replace(/[&,()%";:ç?<>{}\\[\]\s]/g, ''))
250
255
  }
251
256
 
257
+ const handleOpenTermsUrl = async (url: any) => {
258
+ const supported = await Linking.canOpenURL(url);
259
+
260
+ if (supported) {
261
+ await Linking.openURL(url);
262
+ } else {
263
+ showToast(ToastType.Error, t('VALIDATION_ERROR_ACTIVE_URL', 'The _attribute_ is not a valid URL.').replace('_attribute_', t('URL', 'URL')))
264
+ }
265
+ }
266
+
252
267
  useEffect(() => {
253
268
  if (!formState.loading && formState.result?.error) {
254
269
  formState.result?.result && showToast(
@@ -394,6 +409,46 @@ const SignupFormUI = (props: SignupParams) => {
394
409
  </View>
395
410
  )}
396
411
 
412
+ {configs?.terms_and_conditions?.value === 'true' && (
413
+ <View style={{ flexDirection: 'row', alignItems: 'center', marginBottom: 20 }}>
414
+ <Controller
415
+ control={control}
416
+ render={({ onChange, value }: any) => (
417
+ <CheckBox
418
+ value={value}
419
+ onValueChange={newValue => {
420
+ onChange(newValue)
421
+ }}
422
+ boxType={'square'}
423
+ tintColors={{
424
+ true: theme.colors.primary,
425
+ false: theme.colors.disabled
426
+ }}
427
+ tintColor={theme.colors.disabled}
428
+ onCheckColor={theme.colors.primary}
429
+ onTintColor={theme.colors.primary}
430
+ style={Platform.OS === 'ios' && style.checkBoxStyle}
431
+ />
432
+ )}
433
+ name='termsAccept'
434
+ rules={{
435
+ required: t('VALIDATION_ERROR_ACCEPTED', 'The _attribute_ must be accepted.').replace('_attribute_', t('TERMS_AND_CONDITIONS', 'Terms & Conditions'))
436
+ }}
437
+ defaultValue={false}
438
+ />
439
+ <OText style={{ ...theme.labels.normal, paddingHorizontal: 5 }}>{t('TERMS_AND_CONDITIONS_TEXT', 'I’m agree with')}</OText>
440
+ <OButton
441
+ imgRightSrc={null}
442
+ text={t('TERMS_AND_CONDITIONS', 'Terms & Conditions')}
443
+ bgColor='#FFF'
444
+ borderColor='#FFF'
445
+ style={{ paddingLeft: 0, paddingRight: 0, height: 30, shadowColor: '#FFF' }}
446
+ textStyle={{ color: theme.colors.primary, marginLeft: 0, marginRight: 0 }}
447
+ onClick={() => handleOpenTermsUrl(configs?.terms_and_conditions_url?.value)}
448
+ />
449
+ </View>
450
+ )}
451
+
397
452
  {signupTab !== 'cellphone' && (
398
453
  <View style={{ minHeight: 42, marginBottom: 16 }}>
399
454
  <Controller
@@ -16,7 +16,7 @@ import {
16
16
  DivideView,
17
17
  MediaWrapper,
18
18
  } from './styles';
19
- import { StyleSheet, View } from 'react-native';
19
+ import { Platform, StyleSheet, View } from 'react-native';
20
20
  import { BusinessInformationParams } from '../../types';
21
21
  import { GoogleMap } from '../GoogleMap';
22
22
  import { WebView } from 'react-native-webview';
@@ -116,7 +116,7 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
116
116
  lineHeight={21}
117
117
  mBottom={16}
118
118
  size={14}
119
- weight={'600'}
119
+ weight={Platform.OS === 'android' ? 'bold' : '600'}
120
120
  style={{ flexBasis: '20%' }}>
121
121
  {daysOfWeek[i].toUpperCase()}
122
122
  </OText>
@@ -25,6 +25,7 @@ import {
25
25
  import { FloatingButton } from '../FloatingButton'
26
26
  import { ProductForm } from '../ProductForm'
27
27
  import { UpsellingProducts } from '../UpsellingProducts'
28
+
28
29
  const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
29
30
  const {
30
31
  navigation,
@@ -139,7 +140,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
139
140
  imgRightSrc={null}
140
141
  style={styles.btnBackArrow}
141
142
  onClick={() => navigation?.canGoBack() && navigation.goBack()}
142
- imgLeftStyle={{ tintColor: theme.colors.textNormal }}
143
+ imgLeftStyle={{ tintColor: theme.colors.textNormal, width: 16 }}
143
144
  />
144
145
  {/* <AddressInput
145
146
  onPress={() => auth
@@ -31,6 +31,7 @@ const CartUI = (props: any) => {
31
31
  removeProduct,
32
32
  handleCartOpen,
33
33
  setIsCartsLoading,
34
+ hideUpselling
34
35
  // isFromCart
35
36
  } = props
36
37
 
@@ -248,6 +249,7 @@ const CartUI = (props: any) => {
248
249
  canOpenUpselling={canOpenUpselling}
249
250
  setCanOpenUpselling={setCanOpenUpselling}
250
251
  handleCloseUpsellingPage={() => { }}
252
+ isFromCart
251
253
  />
252
254
  )}
253
255
  </CContainer>
@@ -34,6 +34,7 @@ export const CartContent = (props: any) => {
34
34
  onNavigationRedirect={props.onNavigationRedirect}
35
35
  isCartsLoading={isCartsLoading}
36
36
  setIsCartsLoading={setIsCartsLoading}
37
+ hideUpselling
37
38
  />
38
39
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40, marginTop: 20 }} />
39
40
  </>
@@ -36,7 +36,7 @@ const DriverTipsUI = (props: any) => {
36
36
 
37
37
  const style = StyleSheet.create({
38
38
  circle: {
39
- borderRadius: 20
39
+ borderRadius: 30
40
40
  },
41
41
  inputStyle: {
42
42
  flex: 1,
@@ -74,7 +74,7 @@ const DriverTipsUI = (props: any) => {
74
74
  style={style.circle}
75
75
  isActive={option === optionSelected}
76
76
  >
77
- <OText size={18} color={option === optionSelected ? '#FFF' : '#000'}>
77
+ <OText size={13} color={option === optionSelected ? '#FFF' : theme.colors.textSecondary}>
78
78
  {`${isFixedPrice ? parsePrice(option) : `${option}%`}`}
79
79
  </OText>
80
80
  </DTCard>
@@ -13,7 +13,7 @@ export const DTWrapperTips = styled.View`
13
13
  display: flex;
14
14
  flex-direction: row;
15
15
  width: 100%;
16
- justify-content: space-evenly;
16
+ justify-content: space-between;
17
17
  align-items: center;
18
18
  flex-wrap: wrap;
19
19
  `
@@ -22,11 +22,12 @@ export const DTCard = styled.View`
22
22
  display: flex;
23
23
  justify-content: center;
24
24
  align-items: center;
25
- padding: 10px;
26
- border: 1px solid ${(props: any) => props.theme.colors.primary};
25
+ border: 1px solid ${(props: any) => props.isActive ? props.theme.colors.primary : props.theme.colors.border};
27
26
  text-transform: capitalize;
28
- min-height: 60px;
29
- min-width: 60px;
27
+ min-height: 48px;
28
+ min-width: 48px;
29
+ max-width: 48px;
30
+ max-height: 48px;
30
31
  margin-right: 10px;
31
32
  margin-top: 10px;
32
33
 
@@ -4,7 +4,7 @@ import { useTheme } from 'styled-components/native';
4
4
  import { Platform, StyleSheet, View } from 'react-native'
5
5
 
6
6
  import RNPickerSelect from 'react-native-picker-select'
7
- import { Container } from './styles'
7
+ import { Container, DummyContainer } from './styles'
8
8
  import { LanguageSelectorParams } from '../../types'
9
9
  import { OIcon } from '../shared'
10
10
 
@@ -63,7 +63,7 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
63
63
 
64
64
  return (
65
65
  <Container>
66
- {languagesState?.languages && (
66
+ {languagesState?.languages ? (
67
67
  <>
68
68
  {iconColor && <OIcon src={theme.images.general.language} color={iconColor} style={{ marginEnd: 14 }} width={16} />}
69
69
  <RNPickerSelect
@@ -77,7 +77,7 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
77
77
  disabled={orderState.loading}
78
78
  />
79
79
  </>
80
- )}
80
+ ) : <DummyContainer />}
81
81
  </Container>
82
82
  )
83
83
  }
@@ -5,3 +5,6 @@ export const Container = styled.View`
5
5
  justify-content: flex-start;
6
6
  flex-direction: row;
7
7
  `
8
+ export const DummyContainer = styled.View`
9
+ height: 40px;
10
+ `
@@ -337,7 +337,7 @@ const LoginFormUI = (props: LoginParams) => {
337
337
  <OInput
338
338
  isSecured={!passwordSee ? true : false}
339
339
  placeholder={t('PASSWORD', 'Password')}
340
- style={loginStyle.inputStyle}
340
+ style={{...loginStyle.inputStyle, marginBottom: 14}}
341
341
  icon={theme.images.general.lock}
342
342
  iconCustomRight={
343
343
  !passwordSee ? (
@@ -373,6 +373,13 @@ const LoginFormUI = (props: LoginParams) => {
373
373
  }}
374
374
  defaultValue=""
375
375
  />
376
+ {onNavigationRedirect && forgotButtonText && (
377
+ <TouchableOpacity onPress={() => onNavigationRedirect('Forgot')}>
378
+ <OText size={14} mBottom={18}>
379
+ {forgotButtonText}
380
+ </OText>
381
+ </TouchableOpacity>
382
+ )}
376
383
  <OButton
377
384
  onClick={handleSubmit(onSubmit)}
378
385
  text={loginButtonText}
@@ -386,13 +393,6 @@ const LoginFormUI = (props: LoginParams) => {
386
393
  </FormInput>
387
394
  )}
388
395
 
389
- {onNavigationRedirect && forgotButtonText && (
390
- <TouchableOpacity onPress={() => onNavigationRedirect('Forgot')}>
391
- <OText size={16} mBottom={18}>
392
- {forgotButtonText}
393
- </OText>
394
- </TouchableOpacity>
395
- )}
396
396
 
397
397
  {useLoginByCellphone &&
398
398
  loginTab === 'cellphone' &&
@@ -36,9 +36,6 @@ const MessagesUI = (props: MessagesParams) => {
36
36
 
37
37
  const [formattedMessages, setFormattedMessages] = useState<Array<any>>([])
38
38
  const [isKeyboardShow, setIsKeyboardShow] = useState(false)
39
- const previousStatus = [1, 2, 5, 6, 10, 11, 12, 16, 17]
40
- const chatDisabled = previousStatus.includes(order?.status)
41
-
42
39
  const { height } = useWindowDimensions();
43
40
  const { top, bottom } = useSafeAreaInsets();
44
41
 
@@ -239,52 +236,36 @@ const MessagesUI = (props: MessagesParams) => {
239
236
  )
240
237
 
241
238
  const renderComposer = (props: typeof ComposerProps) => (
242
- chatDisabled ? (
243
- <View
244
- style={{
245
- width: '100%',
246
- flexDirection: 'column',
247
- alignItems: 'center'
248
- }}
249
- >
250
- <MaterialCommunityIcon
251
- name='close-octagon-outline'
252
- size={24}
253
- />
254
- <OText size={14}>{t('NOT_SEND_MESSAGES', 'You can\'t send messages because the order has ended')}</OText>
255
- </View>
256
- ) : (
257
- <View style={{
258
- flexDirection: 'row', width: '80%', alignItems: 'center', backgroundColor: theme.colors.backgroundGray100,
259
- borderRadius: 7.6,
260
- }}>
261
- <Composer
262
- {...props}
263
- textInputStyle={{
264
- height: 32,
265
- minHeight: 32,
266
- alignItems: 'center',
267
- justifyContent: 'center',
268
- paddingHorizontal: 12,
269
- borderColor: '#DBDCDB',
270
- color: '#010300',
271
- }}
272
- textInputProps={{
273
- value: message,
274
- onSubmitEditing: onSubmit,
275
- returnKeyType: message ? 'send' : 'done',
276
- blurOnSubmit: true,
277
- multiline: false,
278
- numberOfLines: 1,
279
- autoCorrect: false,
280
- autoCompleteType: 'off',
281
- enablesReturnKeyAutomatically: false
282
- }}
283
- placeholder={t('WRITE_MESSAGE', 'Write message...')}
284
- />
285
- <RenderActions {...props} />
286
- </View>
287
- )
239
+ <View style={{
240
+ flexDirection: 'row', width: '80%', alignItems: 'center', backgroundColor: theme.colors.backgroundGray100,
241
+ borderRadius: 7.6,
242
+ }}>
243
+ <Composer
244
+ {...props}
245
+ textInputStyle={{
246
+ height: 32,
247
+ minHeight: 32,
248
+ alignItems: 'center',
249
+ justifyContent: 'center',
250
+ paddingHorizontal: 12,
251
+ borderColor: '#DBDCDB',
252
+ color: '#010300',
253
+ }}
254
+ textInputProps={{
255
+ value: message,
256
+ onSubmitEditing: onSubmit,
257
+ returnKeyType: message ? 'send' : 'done',
258
+ blurOnSubmit: true,
259
+ multiline: false,
260
+ numberOfLines: 1,
261
+ autoCorrect: false,
262
+ autoCompleteType: 'off',
263
+ enablesReturnKeyAutomatically: false
264
+ }}
265
+ placeholder={t('WRITE_MESSAGE', 'Write message...')}
266
+ />
267
+ <RenderActions {...props} />
268
+ </View>
288
269
  )
289
270
 
290
271
  const renderSend = (props: any) => (
@@ -1,4 +1,4 @@
1
- import React, { useEffect } from 'react'
1
+ import React, { useEffect, useState } from 'react'
2
2
  import {
3
3
  OrderTypeControl,
4
4
  useLanguage,
@@ -26,6 +26,7 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
26
26
  const [orderState] = useOrder();
27
27
  const [, t] = useLanguage();
28
28
  const _orderTypes = orderTypes.filter((type: any) => configTypes?.includes(type.value));
29
+ const [isChanging, setChanging] = useState(false);
29
30
 
30
31
  const items = _orderTypes.map((type) => {
31
32
  return {
@@ -40,9 +41,14 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
40
41
  const handleChangeOrderTypeCallback = (orderType: number) => {
41
42
  if (!orderState.loading) {
42
43
  handleChangeOrderType(orderType)
44
+ setChanging(true);
43
45
  }
44
46
  }
45
47
 
48
+ useEffect(() => {
49
+ if (isChanging) goToBack();
50
+ }, [orderState?.options])
51
+
46
52
  return (
47
53
  <Wrapper>
48
54
  <NavBar
@@ -81,7 +81,7 @@ export const SearchBar = (props: any) => {
81
81
  icon={theme.images.general.search}
82
82
  iconStyle={{ width: 12 }}
83
83
  returnKeyType='done'
84
- inputStyle={inputStyle}
84
+ inputStyle={{padding: 0, paddingTop: Platform.OS == 'android' ? 2 : 0, ...inputStyle}}
85
85
  />
86
86
  {isCancelButtonShow && (
87
87
  <OButton
@@ -1,9 +1,9 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { View, Pressable, StyleSheet } from 'react-native';
2
+ import { View, Pressable, StyleSheet, Linking, Platform } from 'react-native';
3
3
  import { useForm, Controller } from 'react-hook-form';
4
4
  import Spinner from 'react-native-loading-spinner-overlay';
5
5
  import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
6
-
6
+ import CheckBox from '@react-native-community/checkbox';
7
7
  import { PhoneInputNumber } from '../PhoneInputNumber';
8
8
  import { FacebookLogin } from '../FacebookLogin';
9
9
 
@@ -90,6 +90,10 @@ const SignupFormUI = (props: SignupParams) => {
90
90
  flexGrow: 1,
91
91
  marginBottom: 7,
92
92
  },
93
+ checkBoxStyle: {
94
+ width: 25,
95
+ height: 25,
96
+ }
93
97
  });
94
98
 
95
99
  const showInputPhoneNumber =
@@ -272,6 +276,16 @@ const SignupFormUI = (props: SignupParams) => {
272
276
  onChange(value.toLowerCase().replace(/[&,()%";:ç?<>{}\\[\]\s]/g, ''));
273
277
  };
274
278
 
279
+ const handleOpenTermsUrl = async (url: any) => {
280
+ const supported = await Linking.canOpenURL(url);
281
+
282
+ if (supported) {
283
+ await Linking.openURL(url);
284
+ } else {
285
+ showToast(ToastType.Error, t('VALIDATION_ERROR_ACTIVE_URL', 'The _attribute_ is not a valid URL.').replace('_attribute_', t('URL', 'URL')))
286
+ }
287
+ }
288
+
275
289
  useEffect(() => {
276
290
  if (!formState.loading && formState.result?.error) {
277
291
  formState.result?.result &&
@@ -453,6 +467,46 @@ const SignupFormUI = (props: SignupParams) => {
453
467
  </View>
454
468
  )}
455
469
 
470
+ {configs?.terms_and_conditions?.value === 'true' && (
471
+ <View style={{ flexDirection: 'row', alignItems: 'center', marginBottom: 20 }}>
472
+ <Controller
473
+ control={control}
474
+ render={({ onChange, value }: any) => (
475
+ <CheckBox
476
+ value={value}
477
+ onValueChange={newValue => {
478
+ onChange(newValue)
479
+ }}
480
+ boxType={'square'}
481
+ tintColors={{
482
+ true: theme.colors.primary,
483
+ false: theme.colors.disabled
484
+ }}
485
+ tintColor={theme.colors.disabled}
486
+ onCheckColor={theme.colors.primary}
487
+ onTintColor={theme.colors.primary}
488
+ style={Platform.OS === 'ios' && style.checkBoxStyle}
489
+ />
490
+ )}
491
+ name='termsAccept'
492
+ rules={{
493
+ required: t('VALIDATION_ERROR_ACCEPTED', 'The _attribute_ must be accepted.').replace('_attribute_', t('TERMS_AND_CONDITIONS', 'Terms & Conditions'))
494
+ }}
495
+ defaultValue={false}
496
+ />
497
+ <OText style={{ fontSize: 14, paddingHorizontal: 5 }}>{t('TERMS_AND_CONDITIONS_TEXT', 'I’m agree with')}</OText>
498
+ <OButton
499
+ imgRightSrc={null}
500
+ text={t('TERMS_AND_CONDITIONS', 'Terms & Conditions')}
501
+ bgColor='#FFF'
502
+ borderColor='#FFF'
503
+ style={{ paddingLeft: 0, paddingRight: 0, height: 30, shadowColor: '#FFF' }}
504
+ textStyle={{ color: theme.colors.primary, marginLeft: 0, marginRight: 0 }}
505
+ onClick={() => handleOpenTermsUrl(configs?.terms_and_conditions_url?.value)}
506
+ />
507
+ </View>
508
+ )}
509
+
456
510
  {signupTab !== 'cellphone' && (
457
511
  <Controller
458
512
  control={control}
@@ -535,11 +589,25 @@ const SignupFormUI = (props: SignupParams) => {
535
589
  textStyle={{ color: 'white' }}
536
590
  imgRightSrc={null}
537
591
  isDisabled={formState.loading || validationFields.loading}
538
- style={{ borderRadius: 7.6, marginTop: 6 }}
592
+ style={{ borderRadius: 7.6, marginTop: 6,shadowOpacity: 0 }}
539
593
  />
540
594
  )}
541
595
  </FormInput>
542
596
 
597
+ {
598
+ onNavigationRedirect && loginButtonText && (
599
+ <View style={style.wrappText}>
600
+ <OText size={14} style={{ marginRight: 5 }}>
601
+ {t('MOBILE_FRONT_ALREADY_HAVE_AN_ACCOUNT', 'Already have an account?')}
602
+ </OText>
603
+ <Pressable onPress={() => onNavigationRedirect('Login')}>
604
+ <OText size={14} color={theme.colors.primary}>
605
+ {loginButtonText}
606
+ </OText>
607
+ </Pressable>
608
+ </View>
609
+ )
610
+ }
543
611
  <View
544
612
  style={{
545
613
  flexDirection: 'row',
@@ -579,20 +647,6 @@ const SignupFormUI = (props: SignupParams) => {
579
647
  </SocialButtons>
580
648
  </ButtonsWrapper>
581
649
 
582
- {/* {
583
- onNavigationRedirect && loginButtonText && (
584
- <View style={style.wrappText}>
585
- <OText size={18} style={{ marginRight: 5 }}>
586
- {t('MOBILE_FRONT_ALREADY_HAVE_AN_ACCOUNT', 'Already have an account?')}
587
- </OText>
588
- <Pressable onPress={() => onNavigationRedirect('Login')}>
589
- <OText size={18} color={theme.colors.primary}>
590
- {loginButtonText}
591
- </OText>
592
- </Pressable>
593
- </View>
594
- )
595
- } */}
596
650
 
597
651
  {/* {
598
652
  configs && Object.keys(configs).length > 0 && (
@@ -106,8 +106,7 @@ const StripeElementsFormUI = (props: any) => {
106
106
  !!card?.last4 &&
107
107
  !!card?.expiryMonth &&
108
108
  !!card?.expiryYear &&
109
- !!card?.brand &&
110
- !!card?.postalCode
109
+ !!card?.brand
111
110
  )
112
111
  }
113
112
  }, [card])
@@ -118,12 +117,13 @@ const StripeElementsFormUI = (props: any) => {
118
117
  <View style={{ flex: 1 }}>
119
118
  <StripeProvider publishableKey={publicKey}>
120
119
  <CardField
121
- postalCodeEnabled={true}
120
+ postalCodeEnabled={false}
122
121
  cardStyle={{
123
122
  backgroundColor: '#FFFFFF',
124
123
  textColor: '#000000',
124
+ fontSize: 17,
125
125
  styles: {
126
-
126
+
127
127
  }
128
128
  }}
129
129
  style={{
@@ -132,7 +132,7 @@ const StripeElementsFormUI = (props: any) => {
132
132
  marginVertical: 50,
133
133
  borderWidth: 1,
134
134
  borderColor: theme.colors.border,
135
- borderRadius: 7.6
135
+ borderRadius: 7.6,
136
136
  }}
137
137
  onCardChange={(cardDetails: any) => setCard(cardDetails)}
138
138
  />
@@ -1,7 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import Spinner from 'react-native-loading-spinner-overlay';
3
- import MaterialComIcon from 'react-native-vector-icons/MaterialCommunityIcons'
4
- import { Platform, SafeAreaView, StyleSheet, TouchableOpacity, View } from 'react-native'
2
+ import { Platform, StyleSheet, View } from 'react-native'
5
3
  import {
6
4
  UpsellingPage as UpsellingPageController,
7
5
  useUtils,
@@ -23,7 +21,6 @@ import {
23
21
  import { ProductForm } from '../ProductForm';
24
22
  import { OrderSummary } from '../OrderSummary';
25
23
  import { ScrollView } from 'react-native-gesture-handler';
26
- import NavBar from '../NavBar';
27
24
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
28
25
 
29
26
  const UpsellingProductsUI = (props: UpsellingProductsParams) => {
@@ -36,7 +33,8 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
36
33
  handleCloseUpsellingPage,
37
34
  openUpselling,
38
35
  canOpenUpselling,
39
- setCanOpenUpselling
36
+ setCanOpenUpselling,
37
+ isFromCart
40
38
  } = props
41
39
 
42
40
  const theme = useTheme();
@@ -76,7 +74,11 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
76
74
  useEffect(() => {
77
75
  if (!isCustomMode) {
78
76
  if (!upsellingProducts.loading) {
79
- setCanOpenUpselling && setCanOpenUpselling(true)
77
+ if (upsellingProducts?.products?.length && !isFromCart) {
78
+ setCanOpenUpselling && setCanOpenUpselling(true)
79
+ } else {
80
+ handleUpsellingPage && handleUpsellingPage()
81
+ }
80
82
  }
81
83
  // if ((!upsellingProducts?.products?.length && !upsellingProducts.loading && !canOpenUpselling && openUpselling) ||
82
84
  // (!upsellingProducts?.products?.length && !upsellingProducts.loading && openUpselling)) {
@@ -85,6 +87,10 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
85
87
  }
86
88
  }, [upsellingProducts.loading, upsellingProducts?.products.length])
87
89
 
90
+ useEffect(() => {
91
+ if (!cart?.validate && cart?.products?.length == 0) handleCloseUpsellingPage()
92
+ }, [cart])
93
+
88
94
  const handleFormProduct = (product: any) => {
89
95
  setActualProduct(product)
90
96
  setModalIsOpen(true)
@@ -149,6 +155,7 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
149
155
  title={''}
150
156
  open={openUpselling}
151
157
  onClose={() => handleUpsellingPage()}
158
+ isStatusBar
152
159
  >
153
160
  <TopBar style={{ paddingTop: Platform.OS == 'ios' ? 10 : 30 }}>
154
161
  <TopActions onPress={() => handleCloseUpsellingPage()}>
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { Modal, TouchableWithoutFeedback, Dimensions, StyleSheet, View, Text } from 'react-native'
2
+ import { Modal, TouchableWithoutFeedback, Dimensions, StyleSheet, View, Text, Platform, StatusBar } from 'react-native'
3
3
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
4
4
  const deviceHeight = Dimensions.get('window').height
5
5
 
@@ -8,13 +8,15 @@ interface Props {
8
8
  title?: string;
9
9
  children?: any;
10
10
  onClose?: any;
11
+ isStatusBar?: boolean;
11
12
  }
12
13
  const OBottomPopup = (props: Props) => {
13
14
  const {
14
15
  open,
15
16
  title,
16
17
  onClose,
17
- children
18
+ children,
19
+ isStatusBar
18
20
  } = props
19
21
  const { top, bottom } = useSafeAreaInsets();
20
22
  return (
@@ -25,6 +27,7 @@ const OBottomPopup = (props: Props) => {
25
27
  onRequestClose={() => onClose()}
26
28
  presentationStyle={'fullScreen'}
27
29
  >
30
+ {isStatusBar && <StatusBar translucent={false} />}
28
31
  <View style={styles.container}>
29
32
  <TouchableWithoutFeedback
30
33
  style={styles.touchableOutsideStyle}
@@ -127,7 +127,7 @@ const styles = StyleSheet.create({
127
127
  backgroundColor: 'transparent',
128
128
  width: 35,
129
129
  height: 35,
130
- marginStart: -4,
130
+ marginStart: -9,
131
131
  marginTop: 12,
132
132
  alignItems: 'center',
133
133
  justifyContent: 'center',
@@ -387,6 +387,7 @@ export interface UpsellingProductsParams {
387
387
  setCanOpenUpselling?: (value: any) => void;
388
388
  cart?: any;
389
389
  handleCloseUpsellingPage: () => void;
390
+ isFromCart?: boolean;
390
391
  }
391
392
 
392
393
  export interface GoogleMapsParams {