ordering-ui-react-native 0.12.37 → 0.12.41

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 (47) hide show
  1. package/package.json +1 -1
  2. package/src/components/AddressForm/index.tsx +5 -5
  3. package/src/components/FacebookLogin/index.tsx +2 -2
  4. package/src/components/LoginForm/index.tsx +1 -1
  5. package/src/components/PaymentOptions/index.tsx +5 -5
  6. package/src/components/SignupForm/index.tsx +2 -2
  7. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +3 -3
  8. package/themes/business/src/components/LoginForm/index.tsx +1 -1
  9. package/themes/business/src/components/OrderDetails/Delivery.tsx +64 -62
  10. package/themes/business/src/components/SearchBar/index.tsx +1 -1
  11. package/themes/business/src/components/SignupForm/index.tsx +2 -2
  12. package/themes/business/src/types/index.tsx +3 -3
  13. package/themes/doordash/src/components/AddressForm/index.tsx +5 -5
  14. package/themes/doordash/src/components/FacebookLogin/index.tsx +2 -2
  15. package/themes/doordash/src/components/LoginForm/index.tsx +1 -1
  16. package/themes/doordash/src/components/PaymentOptions/index.tsx +5 -5
  17. package/themes/doordash/src/components/SignupForm/index.tsx +2 -2
  18. package/themes/franchises/src/components/AddressForm/index.tsx +5 -5
  19. package/themes/franchises/src/components/FacebookLogin/index.tsx +2 -2
  20. package/themes/franchises/src/components/LoginForm/index.tsx +1 -1
  21. package/themes/franchises/src/components/PaymentOptions/index.tsx +3 -3
  22. package/themes/franchises/src/components/SignupForm/index.tsx +2 -2
  23. package/themes/instacart/src/components/AddressForm/index.tsx +5 -5
  24. package/themes/instacart/src/components/FacebookLogin/index.tsx +2 -2
  25. package/themes/instacart/src/components/LoginForm/index.tsx +1 -1
  26. package/themes/instacart/src/components/PaymentOptions/index.tsx +4 -4
  27. package/themes/instacart/src/components/SignupForm/index.tsx +2 -2
  28. package/themes/original/src/components/AddressForm/index.tsx +5 -5
  29. package/themes/original/src/components/FacebookLogin/index.tsx +2 -2
  30. package/themes/original/src/components/LoginForm/index.tsx +1 -1
  31. package/themes/original/src/components/PaymentOptions/index.tsx +5 -5
  32. package/themes/original/src/components/SignupForm/index.tsx +2 -2
  33. package/themes/single-business/src/components/AddressForm/index.tsx +5 -5
  34. package/themes/single-business/src/components/AppleLogin/index.tsx +2 -2
  35. package/themes/single-business/src/components/FacebookLogin/index.tsx +2 -2
  36. package/themes/single-business/src/components/GoogleLogin/index.tsx +2 -2
  37. package/themes/single-business/src/components/LoginForm/index.tsx +1 -1
  38. package/themes/single-business/src/components/PaymentOptions/index.tsx +4 -4
  39. package/themes/single-business/src/components/ProductForm/index.tsx +7 -6
  40. package/themes/single-business/src/components/ProductForm/styles.tsx +6 -0
  41. package/themes/single-business/src/components/SignupForm/index.tsx +2 -2
  42. package/themes/single-business/src/components/UserProfileForm/index.tsx +3 -2
  43. package/themes/uber-eats/src/components/AddressForm/index.tsx +5 -5
  44. package/themes/uber-eats/src/components/FacebookLogin/index.tsx +2 -2
  45. package/themes/uber-eats/src/components/LoginForm/index.tsx +1 -1
  46. package/themes/uber-eats/src/components/PaymentOptions/index.tsx +5 -5
  47. package/themes/uber-eats/src/components/SignupForm/index.tsx +2 -2
@@ -437,7 +437,7 @@ const AddressFormUI = (props: AddressFormParams) => {
437
437
  }
438
438
  setIsFirstTime(false)
439
439
  },
440
- onSubmitEditing: () => internalNumberRef.current.focus(),
440
+ onSubmitEditing: () => internalNumberRef?.current?.focus?.(),
441
441
  autoCorrect: false,
442
442
  blurOnSubmit: false,
443
443
  returnKeyType: 'next',
@@ -519,7 +519,7 @@ const AddressFormUI = (props: AddressFormParams) => {
519
519
  control={control}
520
520
  name='internal_number'
521
521
  rules={{ required: isRequiredField && isRequiredField('internal_number') ? t(`VALIDATION_ERROR_INTERNAL_NUMBER_REQUIRED`, `The field internal number is required`) : null }}
522
- defaultValue={address?.internal_number || formState.changes?.internal_number || addressState.address.internal_number || ''}
522
+ defaultValue={address?.internal_number || formState.changes?.internal_number || addressState?.address?.internal_number || ''}
523
523
  render={() => (
524
524
  <OInput
525
525
  name='internal_number'
@@ -528,11 +528,11 @@ const AddressFormUI = (props: AddressFormParams) => {
528
528
  handleChangeInput(text)
529
529
  setValue('internal_number', text)
530
530
  }}
531
- value={address?.internal_number || formState.changes?.internal_number || addressState.address.internal_number || ''}
531
+ value={address?.internal_number || formState.changes?.internal_number || addressState?.address?.internal_number || ''}
532
532
  style={styles.inputsStyle}
533
533
  forwardRef={internalNumberRef}
534
534
  returnKeyType='next'
535
- onSubmitEditing={() => zipCodeRef.current.focus()}
535
+ onSubmitEditing={() => zipCodeRef?.current?.focus?.()}
536
536
  blurOnSubmit={false}
537
537
  />
538
538
  )}
@@ -556,7 +556,7 @@ const AddressFormUI = (props: AddressFormParams) => {
556
556
  style={styles.inputsStyle}
557
557
  forwardRef={zipCodeRef}
558
558
  returnKeyType='next'
559
- onSubmitEditing={() => addressNotesRef.current.focus()}
559
+ onSubmitEditing={() => addressNotesRef?.current?.focus?.()}
560
560
  blurOnSubmit={false}
561
561
  />
562
562
  )}
@@ -27,7 +27,7 @@ export const FacebookLogin = (props: any) => {
27
27
  : t('Continue_WITH_FACEBOOK', 'Continue with Facebook');
28
28
 
29
29
  const logoutWithFacebook = () => {
30
- LoginManager.logOut();
30
+ LoginManager && LoginManager.logOut();
31
31
  };
32
32
 
33
33
  const handleLoginClick = async (accessToken: string) => {
@@ -57,7 +57,7 @@ export const FacebookLogin = (props: any) => {
57
57
 
58
58
  const loginWithFacebook = () => {
59
59
  handleLoading && handleLoading(true)
60
- LoginManager.logInWithPermissions(['public_profile']).then(
60
+ LoginManager && LoginManager.logInWithPermissions(['public_profile']).then(
61
61
  (login: any) => {
62
62
  if (login.isCancelled) {
63
63
  const err = t('LOGIN_WITH_FACEBOOK_CANCELLED', 'Login cancelled')
@@ -296,7 +296,7 @@ const LoginFormUI = (props: LoginParams) => {
296
296
  handleData={(val: any) => setPhoneInputData(val)}
297
297
  textInputProps={{
298
298
  returnKeyType: 'next',
299
- onSubmitEditing: () => inputRef.current.focus(),
299
+ onSubmitEditing: () => inputRef?.current?.focus?.(),
300
300
  }}
301
301
  />
302
302
  </View>
@@ -187,7 +187,7 @@ const PaymentOptionsUI = (props: any) => {
187
187
  showsVerticalScrollIndicator={false}
188
188
  data={paymethodsList.paymethods.sort((a: any, b: any) => a.id - b.id).filter((p: any) => !excludeIds.includes(p.id))}
189
189
  renderItem={renderPaymethods}
190
- keyExtractor={(paymethod: any) => paymethod.id.toString()}
190
+ keyExtractor={(paymethod: any) => paymethod?.id?.toString?.()}
191
191
  ListFooterComponent={renderFooter}
192
192
  />
193
193
  )}
@@ -220,7 +220,7 @@ const PaymentOptionsUI = (props: any) => {
220
220
  />
221
221
  }
222
222
 
223
- {isOpenMethod?.paymethod?.gateway === 'stripe' && !paymethodData.id && (
223
+ {isOpenMethod?.paymethod?.gateway === 'stripe' && !paymethodData?.id && (
224
224
  <View>
225
225
  <OButton
226
226
  text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
@@ -325,7 +325,7 @@ const PaymentOptionsUI = (props: any) => {
325
325
  <OModal
326
326
  entireModal
327
327
  title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
328
- open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData.id}
328
+ open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData?.id}
329
329
  onClose={() => handlePaymethodClick(null)}
330
330
  >
331
331
  <KeyboardAvoidingView
@@ -343,7 +343,7 @@ const PaymentOptionsUI = (props: any) => {
343
343
  </OModal>
344
344
 
345
345
  {/* Stripe Connect */}
346
- {isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData.id && (
346
+ {isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData?.id && (
347
347
  <View>
348
348
  <OButton
349
349
  text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
@@ -383,7 +383,7 @@ const SignupFormUI = (props: SignupParams) => {
383
383
  returnKeyType='next'
384
384
  blurOnSubmit={false}
385
385
  forwardRef={(ref: any) => handleRefs(ref, field.code)}
386
- onSubmitEditing={() => field.code === 'email' ? phoneRef.current.focus() : handleFocusRef(getNextFieldCode(i))}
386
+ onSubmitEditing={() => field.code === 'email' ? phoneRef?.current?.focus?.() : handleFocusRef(getNextFieldCode(i))}
387
387
  />
388
388
  )}
389
389
  name={field.code}
@@ -403,7 +403,7 @@ const SignupFormUI = (props: SignupParams) => {
403
403
  forwardRef={phoneRef}
404
404
  textInputProps={{
405
405
  returnKeyType: 'next',
406
- onSubmitEditing: () => passwordRef.current.focus()
406
+ onSubmitEditing: () => passwordRef?.current?.focus?.()
407
407
  }}
408
408
  />
409
409
  </View>
@@ -554,7 +554,7 @@ const AddressFormUI = (props: AddressFormParams) => {
554
554
  setAddressEditing(text.length == 0);
555
555
  },
556
556
  onSubmitEditing: () =>
557
- internalNumberRef.current.focus(),
557
+ internalNumberRef?.current?.focus?.(),
558
558
  autoCorrect: false,
559
559
  blurOnSubmit: false,
560
560
  returnKeyType: 'next',
@@ -658,7 +658,7 @@ const AddressFormUI = (props: AddressFormParams) => {
658
658
  defaultValue={
659
659
  address?.internal_number ||
660
660
  formState.changes?.internal_number ||
661
- addressState.address.internal_number ||
661
+ addressState?.address?.internal_number ||
662
662
  ''
663
663
  }
664
664
  render={() => (
@@ -672,13 +672,13 @@ const AddressFormUI = (props: AddressFormParams) => {
672
672
  value={
673
673
  address?.internal_number ||
674
674
  formState.changes?.internal_number ||
675
- addressState.address.internal_number ||
675
+ addressState?.address?.internal_number ||
676
676
  ''
677
677
  }
678
678
  style={{ ...styles.inputsStyle, marginRight: 24 }}
679
679
  forwardRef={internalNumberRef}
680
680
  returnKeyType="next"
681
- onSubmitEditing={() => zipCodeRef.current.focus()}
681
+ onSubmitEditing={() => zipCodeRef?.current?.focus?.()}
682
682
  blurOnSubmit={false}
683
683
  />
684
684
  )}
@@ -719,7 +719,7 @@ const AddressFormUI = (props: AddressFormParams) => {
719
719
  style={styles.inputsStyle}
720
720
  forwardRef={zipCodeRef}
721
721
  returnKeyType="next"
722
- onSubmitEditing={() => addressNotesRef.current.focus()}
722
+ onSubmitEditing={() => addressNotesRef?.current?.focus?.()}
723
723
  blurOnSubmit={false}
724
724
  />
725
725
  )}
@@ -25,7 +25,7 @@ export const FacebookLogin = (props: any) => {
25
25
  : t('CONTINUE_WITH_FACEBOOK', 'Continue with Facebook');
26
26
 
27
27
  const logoutWithFacebook = () => {
28
- LoginManager.logOut();
28
+ LoginManager && LoginManager.logOut();
29
29
  };
30
30
 
31
31
  const handleLoginClick = async (accessToken: string) => {
@@ -48,7 +48,7 @@ export const FacebookLogin = (props: any) => {
48
48
 
49
49
  const loginWithFacebook = () => {
50
50
  handleLoading && handleLoading(true)
51
- LoginManager.logInWithPermissions(['public_profile']).then(
51
+ LoginManager && LoginManager.logInWithPermissions(['public_profile']).then(
52
52
  (login: any) => {
53
53
  if (login.isCancelled) {
54
54
  const err = t('LOGIN_WITH_FACEBOOK_CANCELLED', 'Login cancelled')
@@ -325,7 +325,7 @@ const LoginFormUI = (props: LoginParams) => {
325
325
  handleData={(val: any) => setPhoneInputData(val)}
326
326
  textInputProps={{
327
327
  returnKeyType: 'next',
328
- onSubmitEditing: () => inputRef.current.focus(),
328
+ onSubmitEditing: () => inputRef?.current?.focus?.(),
329
329
  }}
330
330
  />
331
331
  </View>
@@ -150,7 +150,7 @@ const PaymentOptionsUI = (props: any) => {
150
150
  // data={paymethodsList.paymethods.sort((a: any, b: any) => a.id - b.id)}
151
151
  data={paymethodsList.paymethods.sort((a: any, b: any) => a.id - b.id).filter((p: any) => !excludeIds.includes(p.id))}
152
152
  renderItem={renderPaymethods}
153
- keyExtractor={(paymethod: any) => paymethod.id.toString()}
153
+ keyExtractor={(paymethod: any) => paymethod?.id?.toString?.()}
154
154
  />
155
155
  )}
156
156
 
@@ -226,7 +226,7 @@ const PaymentOptionsUI = (props: any) => {
226
226
  )}
227
227
 
228
228
  {/* Stripe */}
229
- {isOpenMethod?.paymethod?.gateway === 'stripe' && !paymethodData.id && (
229
+ {isOpenMethod?.paymethod?.gateway === 'stripe' && !paymethodData?.id && (
230
230
  <View>
231
231
  <OButton
232
232
  text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
@@ -276,7 +276,7 @@ const PaymentOptionsUI = (props: any) => {
276
276
  <OModal
277
277
  entireModal
278
278
  title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
279
- open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData.id}
279
+ open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData?.id}
280
280
  onClose={() => handlePaymethodClick(null)}
281
281
  >
282
282
  <KeyboardAvoidingView
@@ -294,7 +294,7 @@ const PaymentOptionsUI = (props: any) => {
294
294
  </OModal>
295
295
 
296
296
  {/* Stripe Connect */}
297
- {isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData.id && (
297
+ {isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData?.id && (
298
298
  <View>
299
299
  <OButton
300
300
  text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
@@ -360,7 +360,7 @@ const PaymentOptionsUI = (props: any) => {
360
360
  {/* Paypal */}
361
361
  {/* <Modal
362
362
  className='modal-info'
363
- open={paymethodSelected?.gateway === 'paypal' && !paymethodData.id}
363
+ open={paymethodSelected?.gateway === 'paypal' && !paymethodData?.id}
364
364
  onClose={() => handlePaymethodClick(null)}
365
365
  title={t('PAY_WITH_PAYPAL', 'Pay with PayPal')}
366
366
  >
@@ -443,7 +443,7 @@ const SignupFormUI = (props: SignupParams) => {
443
443
  forwardRef={(ref: any) => handleRefs(ref, field.code)}
444
444
  onSubmitEditing={() =>
445
445
  field.code === 'email'
446
- ? phoneRef.current.focus()
446
+ ? phoneRef?.current?.focus?.()
447
447
  : handleFocusRef(getNextFieldCode(i))
448
448
  }
449
449
  />
@@ -463,7 +463,7 @@ const SignupFormUI = (props: SignupParams) => {
463
463
  forwardRef={phoneRef}
464
464
  textInputProps={{
465
465
  returnKeyType: 'next',
466
- onSubmitEditing: () => passwordRef.current.focus(),
466
+ onSubmitEditing: () => passwordRef?.current?.focus?.(),
467
467
  }}
468
468
  />
469
469
  </View>
@@ -559,7 +559,7 @@ const AddressFormUI = (props: AddressFormParams) => {
559
559
  setAddressEditing(text.length == 0);
560
560
  },
561
561
  onSubmitEditing: () =>
562
- internalNumberRef.current.focus(),
562
+ internalNumberRef?.current?.focus?.(),
563
563
  autoCorrect: false,
564
564
  blurOnSubmit: false,
565
565
  returnKeyType: 'next',
@@ -652,7 +652,7 @@ const AddressFormUI = (props: AddressFormParams) => {
652
652
  defaultValue={
653
653
  address?.internal_number ||
654
654
  formState.changes?.internal_number ||
655
- addressState.address.internal_number ||
655
+ addressState?.address?.internal_number ||
656
656
  ''
657
657
  }
658
658
  render={() => (
@@ -666,13 +666,13 @@ const AddressFormUI = (props: AddressFormParams) => {
666
666
  value={
667
667
  address?.internal_number ||
668
668
  formState.changes?.internal_number ||
669
- addressState.address.internal_number ||
669
+ addressState?.address?.internal_number ||
670
670
  ''
671
671
  }
672
672
  style={{ ...styles.inputsStyle, marginRight: 24 }}
673
673
  forwardRef={internalNumberRef}
674
674
  returnKeyType="next"
675
- onSubmitEditing={() => zipCodeRef.current.focus()}
675
+ onSubmitEditing={() => zipCodeRef?.current?.focus?.()}
676
676
  blurOnSubmit={false}
677
677
  />
678
678
  )}
@@ -713,7 +713,7 @@ const AddressFormUI = (props: AddressFormParams) => {
713
713
  style={styles.inputsStyle}
714
714
  forwardRef={zipCodeRef}
715
715
  returnKeyType="next"
716
- onSubmitEditing={() => addressNotesRef.current.focus()}
716
+ onSubmitEditing={() => addressNotesRef?.current?.focus?.()}
717
717
  blurOnSubmit={false}
718
718
  />
719
719
  )}
@@ -26,7 +26,7 @@ export const AppleLogin = (props: any) => {
26
26
  : t('CONTINUE_WITH_FACEBOOK', 'Continue with Apple');
27
27
 
28
28
  const logoutWithFacebook = () => {
29
- LoginManager.logOut();
29
+ LoginManager && LoginManager.logOut();
30
30
  };
31
31
 
32
32
  const handleLoginClick = async (accessToken: string) => {
@@ -49,7 +49,7 @@ export const AppleLogin = (props: any) => {
49
49
 
50
50
  const loginWithFacebook = () => {
51
51
  handleLoading && handleLoading(true)
52
- LoginManager.logInWithPermissions(['public_profile']).then(
52
+ LoginManager && LoginManager.logInWithPermissions(['public_profile']).then(
53
53
  (login: any) => {
54
54
  if (login.isCancelled) {
55
55
  const err = t('LOGIN_WITH_FACEBOOK_CANCELLED', 'Login cancelled')
@@ -25,7 +25,7 @@ export const FacebookLogin = (props: any) => {
25
25
  : t('CONTINUE_WITH_FACEBOOK', 'Continue with Facebook');
26
26
 
27
27
  const logoutWithFacebook = () => {
28
- LoginManager.logOut();
28
+ LoginManager && LoginManager.logOut();
29
29
  };
30
30
 
31
31
  const handleLoginClick = async (accessToken: string) => {
@@ -48,7 +48,7 @@ export const FacebookLogin = (props: any) => {
48
48
 
49
49
  const loginWithFacebook = () => {
50
50
  handleLoading && handleLoading(true)
51
- LoginManager.logInWithPermissions(['public_profile']).then(
51
+ LoginManager && LoginManager.logInWithPermissions(['public_profile']).then(
52
52
  (login: any) => {
53
53
  if (login.isCancelled) {
54
54
  const err = t('LOGIN_WITH_FACEBOOK_CANCELLED', 'Login cancelled')
@@ -26,7 +26,7 @@ export const GoogleLogin = (props: any) => {
26
26
  : t('CONTINUE_WITH_GOOGLE', 'Continue with Google');
27
27
 
28
28
  const logoutWithFacebook = () => {
29
- LoginManager.logOut();
29
+ LoginManager && LoginManager.logOut();
30
30
  };
31
31
 
32
32
  const handleLoginClick = async (accessToken: string) => {
@@ -49,7 +49,7 @@ export const GoogleLogin = (props: any) => {
49
49
 
50
50
  const loginWithFacebook = () => {
51
51
  handleLoading && handleLoading(true)
52
- LoginManager.logInWithPermissions(['public_profile']).then(
52
+ LoginManager && LoginManager.logInWithPermissions(['public_profile']).then(
53
53
  (login: any) => {
54
54
  if (login.isCancelled) {
55
55
  const err = t('LOGIN_WITH_FACEBOOK_CANCELLED', 'Login cancelled')
@@ -381,7 +381,7 @@ const LoginFormUI = (props: LoginParams) => {
381
381
  handleData={(val: any) => setPhoneInputData(val)}
382
382
  textInputProps={{
383
383
  returnKeyType: 'next',
384
- onSubmitEditing: () => inputRef.current.focus(),
384
+ onSubmitEditing: () => inputRef?.current?.focus?.(),
385
385
  }}
386
386
  />
387
387
  </View>
@@ -240,7 +240,7 @@ const PaymentOptionsUI = (props: any) => {
240
240
  )}
241
241
 
242
242
  {/* Stripe */}
243
- {isOpenMethod?.paymethod?.gateway === 'stripe' && !paymethodData.id && (
243
+ {isOpenMethod?.paymethod?.gateway === 'stripe' && !paymethodData?.id && (
244
244
  <View>
245
245
  <OButton
246
246
  text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
@@ -290,7 +290,7 @@ const PaymentOptionsUI = (props: any) => {
290
290
  <OModal
291
291
  entireModal
292
292
  title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
293
- open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData.id}
293
+ open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData?.id}
294
294
  onClose={() => handlePaymethodClick(null)}
295
295
  >
296
296
  <KeyboardAvoidingView
@@ -308,7 +308,7 @@ const PaymentOptionsUI = (props: any) => {
308
308
  </OModal>
309
309
 
310
310
  {/* Stripe Connect */}
311
- {isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData.id && (
311
+ {isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData?.id && (
312
312
  <View>
313
313
  <OButton
314
314
  text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
@@ -374,7 +374,7 @@ const PaymentOptionsUI = (props: any) => {
374
374
  {/* Paypal */}
375
375
  {/* <Modal
376
376
  className='modal-info'
377
- open={paymethodSelected?.gateway === 'paypal' && !paymethodData.id}
377
+ open={paymethodSelected?.gateway === 'paypal' && !paymethodData?.id}
378
378
  onClose={() => handlePaymethodClick(null)}
379
379
  title={t('PAY_WITH_PAYPAL', 'Pay with PayPal')}
380
380
  >
@@ -1,4 +1,4 @@
1
- import React, { useEffect } from 'react';
1
+ import React, { useEffect, useRef } from 'react';
2
2
  import {
3
3
  ProductForm as ProductOptions,
4
4
  useSession,
@@ -9,7 +9,7 @@ import {
9
9
  import { useTheme } from 'styled-components/native';
10
10
  import { ProductIngredient } from '../ProductIngredient';
11
11
  import { ProductOption } from '../ProductOption';
12
- import { View, TouchableOpacity, StyleSheet, Dimensions, Platform, useWindowDimensions, Keyboard } from 'react-native';
12
+ import { View, TouchableOpacity, StyleSheet, Dimensions, Platform, useWindowDimensions, Keyboard, KeyboardAvoidingView } from 'react-native';
13
13
 
14
14
  import {
15
15
  ProductHeader,
@@ -120,7 +120,7 @@ export const ProductOptionsUI = (props: any) => {
120
120
  const { top, bottom } = useSafeAreaInsets();
121
121
  const { height } = useWindowDimensions();
122
122
  const [selOpt, setSelectedOpt] = useState(0);
123
-
123
+ const scrollViewRef = useRef<any>()
124
124
  const isError = (id: number) => {
125
125
  let bgColor = theme.colors.white;
126
126
  if (errors[`id:${id}`]) {
@@ -241,6 +241,7 @@ export const ProductOptionsUI = (props: any) => {
241
241
  const keyboardDidShowListener = Keyboard.addListener(
242
242
  'keyboardDidShow',
243
243
  () => {
244
+ scrollViewRef?.current && scrollViewRef?.current?.scrollToEnd()
244
245
  setIsKeyboardShow(true);
245
246
  }
246
247
  );
@@ -259,7 +260,7 @@ export const ProductOptionsUI = (props: any) => {
259
260
 
260
261
  return (
261
262
  <>
262
- <ScrollView style={{ height: windowHeight * 0.85 }}>
263
+ <ScrollView ref={scrollViewRef}>
263
264
  {!error && (
264
265
  <>
265
266
  <WrapHeader>
@@ -560,7 +561,7 @@ export const ProductOptionsUI = (props: any) => {
560
561
  )}
561
562
  </>
562
563
  )}
563
- <ProductComment style={{ paddingBottom: isKeyboardShow ? 200 : 0 }}>
564
+ <ProductComment>
564
565
  <SectionTitle>
565
566
  <OText size={16} weight={'600'} lineHeight={24}>
566
567
  {t('SPECIAL_COMMENT', 'Special comment')}
@@ -597,7 +598,7 @@ export const ProductOptionsUI = (props: any) => {
597
598
  )}
598
599
  </ScrollView>
599
600
  {!loading && !error && product && (
600
- <ProductActions style={{ maxHeight: windowHeight * 0.15 }}>
601
+ <ProductActions>
601
602
  <OText size={16} lineHeight={24} weight={'600'}>
602
603
  {productCart.total ? parsePrice(productCart?.total) : ''}
603
604
  </OText>
@@ -59,9 +59,12 @@ export const WrapperSubOption = styled.View`
59
59
  `
60
60
 
61
61
  export const ProductComment = styled.View`
62
+ padding-bottom: 40px
62
63
  `
63
64
 
64
65
  export const ProductActions = styled.View`
66
+ position: absolute;
67
+ bottom: 0px;
65
68
  min-height: 70px;
66
69
  padding: 12px 40px;
67
70
  width: 100%;
@@ -72,7 +75,10 @@ export const ProductActions = styled.View`
72
75
  justify-content: space-between;
73
76
  border-top-width: 1px;
74
77
  border-top-color: ${(props: any) => props.theme.colors.border};
78
+ flex: 1;
79
+ flex-direction: row;
75
80
  `
81
+
76
82
  export const ExtraOptionWrap = styled.ScrollView`
77
83
  margin-horizontal: -40px;
78
84
  `;
@@ -425,7 +425,7 @@ const SignupFormUI = (props: SignupParams) => {
425
425
  forwardRef={(ref: any) => handleRefs(ref, field.code)}
426
426
  onSubmitEditing={() =>
427
427
  field.code === 'email'
428
- ? phoneRef.current.focus()
428
+ ? phoneRef?.current?.focus?.()
429
429
  : handleFocusRef(getNextFieldCode(i))
430
430
  }
431
431
  />
@@ -445,7 +445,7 @@ const SignupFormUI = (props: SignupParams) => {
445
445
  forwardRef={phoneRef}
446
446
  textInputProps={{
447
447
  returnKeyType: 'next',
448
- onSubmitEditing: () => passwordRef.current.focus(),
448
+ onSubmitEditing: () => passwordRef?.current?.focus?.(),
449
449
  }}
450
450
  />
451
451
  </View>
@@ -114,8 +114,9 @@ const ProfileUI = (props: ProfileParams) => {
114
114
  console.log('ImagePicker Error: ', response.errorMessage);
115
115
  showToast(ToastType.Error, response.errorMessage);
116
116
  } else {
117
- if (response.uri) {
118
- const url = `data:${response.type};base64,${response.base64}`;
117
+ if (response?.assets?.[0]?.uri) {
118
+ const image = response?.assets?.[0]
119
+ const url = `data:${image?.type};base64,${image?.base64}`;
119
120
  handleButtonUpdateClick(null, true, url);
120
121
  } else {
121
122
  showToast(ToastType.Error, t('IMAGE_NOT_FOUND', 'Image not found'));
@@ -523,7 +523,7 @@ const AddressFormUI = (props: AddressFormParams) => {
523
523
  }
524
524
  setIsFirstTime(false)
525
525
  },
526
- onSubmitEditing: () => internalNumberRef.current.focus(),
526
+ onSubmitEditing: () => internalNumberRef?.current?.focus?.(),
527
527
  autoCorrect: false,
528
528
  blurOnSubmit: false,
529
529
  returnKeyType: 'next'
@@ -576,7 +576,7 @@ const AddressFormUI = (props: AddressFormParams) => {
576
576
  control={control}
577
577
  name='internal_number'
578
578
  rules={{ required: isRequiredField && isRequiredField('internal_number') ? t(`VALIDATION_ERROR_INTERNAL_NUMBER_REQUIRED`, `The field internal number is required`) : null }}
579
- defaultValue={address?.internal_number || formState.changes?.internal_number || addressState.address.internal_number || ''}
579
+ defaultValue={address?.internal_number || formState.changes?.internal_number || addressState?.address?.internal_number || ''}
580
580
  render={() => (
581
581
  <OInput
582
582
  name='internal_number'
@@ -585,11 +585,11 @@ const AddressFormUI = (props: AddressFormParams) => {
585
585
  handleChangeInput(text)
586
586
  setValue('internal_number', text)
587
587
  }}
588
- value={address?.internal_number || formState.changes?.internal_number || addressState.address.internal_number || ''}
588
+ value={address?.internal_number || formState.changes?.internal_number || addressState?.address?.internal_number || ''}
589
589
  style={styles.inputsStyle}
590
590
  forwardRef={internalNumberRef}
591
591
  returnKeyType='next'
592
- onSubmitEditing={() => zipCodeRef.current.focus()}
592
+ onSubmitEditing={() => zipCodeRef?.current?.focus?.()}
593
593
  blurOnSubmit={false}
594
594
  />
595
595
  )}
@@ -617,7 +617,7 @@ const AddressFormUI = (props: AddressFormParams) => {
617
617
  style={styles.inputsStyle}
618
618
  forwardRef={zipCodeRef}
619
619
  returnKeyType='next'
620
- onSubmitEditing={() => addressNotesRef.current.focus()}
620
+ onSubmitEditing={() => addressNotesRef?.current?.focus?.()}
621
621
  blurOnSubmit={false}
622
622
  />
623
623
  )}
@@ -26,7 +26,7 @@ export const FacebookLogin = (props: any) => {
26
26
  : t('LOGIN_WITH_FACEBOOK', 'Login with Facebook');
27
27
 
28
28
  const logoutWithFacebook = () => {
29
- LoginManager.logOut();
29
+ LoginManager && LoginManager.logOut();
30
30
  };
31
31
 
32
32
  const handleLoginClick = async (accessToken: string) => {
@@ -57,7 +57,7 @@ export const FacebookLogin = (props: any) => {
57
57
 
58
58
  const loginWithFacebook = () => {
59
59
  handleLoading && handleLoading(true)
60
- LoginManager.logInWithPermissions(['public_profile']).then(
60
+ LoginManager && LoginManager.logInWithPermissions(['public_profile']).then(
61
61
  (login: any) => {
62
62
  if (login.isCancelled) {
63
63
  const err = t('LOGIN_WITH_FACEBOOK_CANCELLED', 'Login cancelled')
@@ -288,7 +288,7 @@ const LoginFormUI = (props: LoginParams) => {
288
288
  handleData={(val: any) => setPhoneInputData(val)}
289
289
  textInputProps={{
290
290
  returnKeyType: 'next',
291
- onSubmitEditing: () => inputRef.current.focus(),
291
+ onSubmitEditing: () => inputRef?.current?.focus?.(),
292
292
  }}
293
293
  />
294
294
  </View>
@@ -195,7 +195,7 @@ const PaymentOptionsUI = (props: any) => {
195
195
  showsVerticalScrollIndicator={false}
196
196
  data={paymethodsList.paymethods.sort((a: any, b: any) => a.id - b.id).filter((p: any) => !excludeIds.includes(p.id))}
197
197
  renderItem={renderPaymethods}
198
- keyExtractor={(paymethod: any) => paymethod.id.toString()}
198
+ keyExtractor={(paymethod: any) => paymethod?.id?.toString?.()}
199
199
  ListFooterComponent={renderFooter}
200
200
  />
201
201
  )}
@@ -228,7 +228,7 @@ const PaymentOptionsUI = (props: any) => {
228
228
  />
229
229
  }
230
230
 
231
- {isOpenMethod?.paymethod?.gateway === 'stripe' && !paymethodData.id && (
231
+ {isOpenMethod?.paymethod?.gateway === 'stripe' && !paymethodData?.id && (
232
232
  <View>
233
233
  <OButton
234
234
  text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
@@ -333,7 +333,7 @@ const PaymentOptionsUI = (props: any) => {
333
333
  <OModal
334
334
  entireModal
335
335
  title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
336
- open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData.id}
336
+ open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData?.id}
337
337
  onClose={() => handlePaymethodClick(null)}
338
338
  >
339
339
  <KeyboardAvoidingView
@@ -351,7 +351,7 @@ const PaymentOptionsUI = (props: any) => {
351
351
  </OModal>
352
352
 
353
353
  {/* Stripe Connect */}
354
- {isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData.id && (
354
+ {isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData?.id && (
355
355
  <View>
356
356
  <OButton
357
357
  text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
@@ -417,7 +417,7 @@ const PaymentOptionsUI = (props: any) => {
417
417
  {/* Paypal */}
418
418
  {/* <Modal
419
419
  className='modal-info'
420
- open={paymethodSelected?.gateway === 'paypal' && !paymethodData.id}
420
+ open={paymethodSelected?.gateway === 'paypal' && !paymethodData?.id}
421
421
  onClose={() => handlePaymethodClick(null)}
422
422
  title={t('PAY_WITH_PAYPAL', 'Pay with PayPal')}
423
423
  >