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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.12.37",
3
+ "version": "0.12.41",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -513,7 +513,7 @@ const AddressFormUI = (props: AddressFormParams) => {
513
513
  }
514
514
  setIsFirstTime(false)
515
515
  },
516
- onSubmitEditing: () => internalNumberRef.current.focus(),
516
+ onSubmitEditing: () => internalNumberRef?.current?.focus?.(),
517
517
  autoCorrect: false,
518
518
  blurOnSubmit: false,
519
519
  returnKeyType: 'next'
@@ -573,7 +573,7 @@ const AddressFormUI = (props: AddressFormParams) => {
573
573
  control={control}
574
574
  name='internal_number'
575
575
  rules={{ required: isRequiredField && isRequiredField('internal_number') ? t(`VALIDATION_ERROR_INTERNAL_NUMBER_REQUIRED`, `The field internal number is required`) : null }}
576
- defaultValue={address?.internal_number || formState.changes?.internal_number || addressState.address.internal_number || ''}
576
+ defaultValue={address?.internal_number || formState.changes?.internal_number || addressState?.address?.internal_number || ''}
577
577
  render={() => (
578
578
  <OInput
579
579
  name='internal_number'
@@ -582,11 +582,11 @@ const AddressFormUI = (props: AddressFormParams) => {
582
582
  handleChangeInput(text)
583
583
  setValue('internal_number', text)
584
584
  }}
585
- value={address?.internal_number || formState.changes?.internal_number || addressState.address.internal_number || ''}
585
+ value={address?.internal_number || formState.changes?.internal_number || addressState?.address?.internal_number || ''}
586
586
  style={styles.inputsStyle}
587
587
  forwardRef={internalNumberRef}
588
588
  returnKeyType='next'
589
- onSubmitEditing={() => zipCodeRef.current.focus()}
589
+ onSubmitEditing={() => zipCodeRef?.current?.focus?.()}
590
590
  blurOnSubmit={false}
591
591
  />
592
592
  )}
@@ -609,7 +609,7 @@ const AddressFormUI = (props: AddressFormParams) => {
609
609
  style={styles.inputsStyle}
610
610
  forwardRef={zipCodeRef}
611
611
  returnKeyType='next'
612
- onSubmitEditing={() => addressNotesRef.current.focus()}
612
+ onSubmitEditing={() => addressNotesRef?.current?.focus?.()}
613
613
  blurOnSubmit={false}
614
614
  />
615
615
  )}
@@ -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')
@@ -270,7 +270,7 @@ const LoginFormUI = (props: LoginParams) => {
270
270
  handleData={(val: any) => setPhoneInputData(val)}
271
271
  textInputProps={{
272
272
  returnKeyType: 'next',
273
- onSubmitEditing: () => inputRef.current.focus(),
273
+ onSubmitEditing: () => inputRef?.current?.focus?.(),
274
274
  }}
275
275
  />
276
276
  </View>
@@ -159,7 +159,7 @@ const PaymentOptionsUI = (props: any) => {
159
159
  // data={paymethodsList.paymethods.sort((a: any, b: any) => a.id - b.id)}
160
160
  data={paymethodsList.paymethods.sort((a: any, b: any) => a.id - b.id).filter((p: any) => !excludeGateway.includes(p.gateway))}
161
161
  renderItem={renderPaymethods}
162
- keyExtractor={(paymethod: any) => paymethod.id.toString()}
162
+ keyExtractor={(paymethod: any) => paymethod?.id?.toString?.()}
163
163
  />
164
164
  )}
165
165
  {(paymethodsList.loading || isLoading) && (
@@ -232,7 +232,7 @@ const PaymentOptionsUI = (props: any) => {
232
232
  )}
233
233
 
234
234
  {/* Stripe */}
235
- {isOpenMethod?.paymethod?.gateway === 'stripe' && !paymethodData.id && (
235
+ {isOpenMethod?.paymethod?.gateway === 'stripe' && !paymethodData?.id && (
236
236
  <View style={{ width: '100%' }}>
237
237
  <OButton
238
238
  text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
@@ -281,7 +281,7 @@ const PaymentOptionsUI = (props: any) => {
281
281
  <OModal
282
282
  entireModal
283
283
  title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
284
- open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData.id}
284
+ open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData?.id}
285
285
  onClose={() => handlePaymethodClick(null)}
286
286
  >
287
287
  <KeyboardAvoidingView
@@ -299,7 +299,7 @@ const PaymentOptionsUI = (props: any) => {
299
299
  </OModal>
300
300
 
301
301
  {/* Stripe Connect */}
302
- {isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData.id && (
302
+ {isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData?.id && (
303
303
  <View>
304
304
  <OButton
305
305
  text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
@@ -365,7 +365,7 @@ const PaymentOptionsUI = (props: any) => {
365
365
  {/* Paypal */}
366
366
  {/* <Modal
367
367
  className='modal-info'
368
- open={paymethodSelected?.gateway === 'paypal' && !paymethodData.id}
368
+ open={paymethodSelected?.gateway === 'paypal' && !paymethodData?.id}
369
369
  onClose={() => handlePaymethodClick(null)}
370
370
  title={t('PAY_WITH_PAYPAL', 'Pay with PayPal')}
371
371
  >
@@ -368,7 +368,7 @@ const SignupFormUI = (props: SignupParams) => {
368
368
  returnKeyType='next'
369
369
  blurOnSubmit={false}
370
370
  forwardRef={(ref : any) => handleRefs(ref,field.code)}
371
- onSubmitEditing={() => field.code === 'email' ? phoneRef.current.focus() : handleFocusRef(getNextFieldCode(i))}
371
+ onSubmitEditing={() => field.code === 'email' ? phoneRef?.current?.focus?.() : handleFocusRef(getNextFieldCode(i))}
372
372
  />
373
373
  )}
374
374
  name={field.code}
@@ -387,7 +387,7 @@ const SignupFormUI = (props: SignupParams) => {
387
387
  forwardRef={phoneRef}
388
388
  textInputProps={{
389
389
  returnKeyType: 'next',
390
- onSubmitEditing: () => passwordRef.current.focus()
390
+ onSubmitEditing: () => passwordRef?.current?.focus?.()
391
391
  }}
392
392
  />
393
393
  </View>
@@ -138,7 +138,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
138
138
 
139
139
  if (!isFocus) {
140
140
  if (time.length > 1) timerRef.current.clear();
141
- timerRef.current.focus();
141
+ timerRef?.current?.focus?.();
142
142
  handleFocusTimer();
143
143
  }
144
144
  };
@@ -150,7 +150,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
150
150
  }
151
151
 
152
152
  if (!isFocus && textTareaRef?.current) {
153
- textTareaRef.current.focus();
153
+ textTareaRef?.current?.focus?.();
154
154
  }
155
155
  };
156
156
 
@@ -163,7 +163,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
163
163
 
164
164
  const time = parseInt(hour || '0') * 60 + (parseInt(minsToSend) || 0);
165
165
 
166
- let bodyToSend;
166
+ let bodyToSend : any = {};
167
167
  const orderStatus: any = {
168
168
  acceptByBusiness: {
169
169
  prepared_in: time,
@@ -535,7 +535,7 @@ const LoginFormUI = (props: LoginParams) => {
535
535
  onSubmitEditing={() => null}
536
536
  textInputProps={{
537
537
  returnKeyType: 'next',
538
- onSubmitEditing: () => inputRef.current.focus(),
538
+ onSubmitEditing: () => inputRef?.current?.focus?.(),
539
539
  }}
540
540
  />
541
541
  </View>
@@ -270,7 +270,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
270
270
  />
271
271
  </Pickup>
272
272
  )}
273
- {(order?.status === 3) && order?.delivery_type === 1 && (
273
+ {order?.status === 3 && order?.delivery_type === 1 && (
274
274
  <View style={{ paddingVertical: 20, marginBottom: 20 }}>
275
275
  <OButton
276
276
  style={styles.btnPickUp}
@@ -285,67 +285,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
285
285
  </View>
286
286
  )}
287
287
  </>
288
-
289
- <OModal
290
- open={openModalForBusiness}
291
- order={order}
292
- title={`${t('INVOICE_ORDER_NO', 'Order No.')} ${order.id}`}
293
- entireModal
294
- onClose={() => handleCloseModal()}>
295
- <Chat
296
- type={
297
- openModalForBusiness ? USER_TYPE.BUSINESS : USER_TYPE.DRIVER
298
- }
299
- orderId={order?.id}
300
- messages={messages}
301
- order={order}
302
- setMessages={setMessages}
303
- />
304
- </OModal>
305
-
306
- <OModal
307
- open={openModalForAccept}
308
- onClose={() => setOpenModalForAccept(false)}
309
- entireModal
310
- customClose>
311
- <AcceptOrRejectOrder
312
- handleUpdateOrder={handleChangeOrderStatus}
313
- closeModal={setOpenModalForAccept}
314
- customerCellphone={order?.customer?.cellphone}
315
- loading={props.order?.loading}
316
- action={actionOrder}
317
- orderId={order?.id}
318
- notShowCustomerPhone
319
- actions={actions}
320
- orderTitle={orderTitle}
321
- appTitle={appTitle}
322
- />
323
- </OModal>
324
-
325
- <OModal
326
- open={openModalForMapView}
327
- onClose={() => handleOpenMapView()}
328
- entireModal
329
- customClose>
330
- <DriverMap
331
- navigation={navigation}
332
- order={order}
333
- orderStatus={getOrderStatus(order?.status, t)?.value || ''}
334
- location={locationMarker}
335
- readOnly
336
- updateDriverPosition={updateDriverPosition}
337
- driverUpdateLocation={driverUpdateLocation}
338
- setDriverUpdateLocation={setDriverUpdateLocation}
339
- handleViewActionOrder={handleViewActionOrder}
340
- isBusinessMarker={isBusinessMarker}
341
- isToFollow={isToFollow}
342
- showAcceptOrReject={
343
- showFloatButtonsAcceptOrReject[order?.status]
344
- }
345
- handleOpenMapView={handleOpenMapView}
346
- />
347
- </OModal>
348
-
349
288
  <View
350
289
  style={{
351
290
  height:
@@ -458,6 +397,69 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
458
397
  )}
459
398
  </>
460
399
  )}
400
+ {openModalForMapView && (
401
+ <OModal
402
+ open={openModalForMapView}
403
+ onClose={() => handleOpenMapView()}
404
+ entireModal
405
+ customClose>
406
+ <DriverMap
407
+ navigation={navigation}
408
+ order={order}
409
+ orderStatus={getOrderStatus(order?.status, t)?.value || ''}
410
+ location={locationMarker}
411
+ readOnly
412
+ updateDriverPosition={updateDriverPosition}
413
+ driverUpdateLocation={driverUpdateLocation}
414
+ setDriverUpdateLocation={setDriverUpdateLocation}
415
+ handleViewActionOrder={handleViewActionOrder}
416
+ isBusinessMarker={isBusinessMarker}
417
+ isToFollow={isToFollow}
418
+ showAcceptOrReject={
419
+ showFloatButtonsAcceptOrReject[order?.status]
420
+ }
421
+ handleOpenMapView={handleOpenMapView}
422
+ />
423
+ </OModal>
424
+ )}
425
+ {openModalForBusiness && (
426
+ <OModal
427
+ open={openModalForBusiness}
428
+ order={order}
429
+ title={`${t('INVOICE_ORDER_NO', 'Order No.')} ${order.id}`}
430
+ entireModal
431
+ onClose={() => handleCloseModal()}>
432
+ <Chat
433
+ type={
434
+ openModalForBusiness ? USER_TYPE.BUSINESS : USER_TYPE.DRIVER
435
+ }
436
+ orderId={order?.id}
437
+ messages={messages}
438
+ order={order}
439
+ setMessages={setMessages}
440
+ />
441
+ </OModal>
442
+ )}
443
+ {openModalForAccept && (
444
+ <OModal
445
+ open={openModalForAccept}
446
+ onClose={() => setOpenModalForAccept(false)}
447
+ entireModal
448
+ customClose>
449
+ <AcceptOrRejectOrder
450
+ handleUpdateOrder={handleChangeOrderStatus}
451
+ closeModal={setOpenModalForAccept}
452
+ customerCellphone={order?.customer?.cellphone}
453
+ loading={props.order?.loading}
454
+ action={actionOrder}
455
+ orderId={order?.id}
456
+ notShowCustomerPhone
457
+ actions={actions}
458
+ orderTitle={orderTitle}
459
+ appTitle={appTitle}
460
+ />
461
+ </OModal>
462
+ )}
461
463
  </View>
462
464
  {alertState?.open && (
463
465
  <Alert
@@ -27,7 +27,7 @@ export const SearchBar = (props: any) => {
27
27
  };
28
28
 
29
29
  const handleActiveInput = () => {
30
- inputRef.current.focus();
30
+ inputRef?.current?.focus?.();
31
31
  };
32
32
 
33
33
  let timeout: null | any = null;
@@ -392,7 +392,7 @@ const SignupFormUI = (props: SignupParams) => {
392
392
  forwardRef={(ref: any) => handleRefs(ref, field.code)}
393
393
  onSubmitEditing={() =>
394
394
  field.code === 'email'
395
- ? phoneRef.current.focus()
395
+ ? phoneRef?.current?.focus?.()
396
396
  : handleFocusRef(getNextFieldCode(i))
397
397
  }
398
398
  />
@@ -414,7 +414,7 @@ const SignupFormUI = (props: SignupParams) => {
414
414
  onSubmitEditing={() => null}
415
415
  textInputProps={{
416
416
  returnKeyType: 'next',
417
- onSubmitEditing: () => passwordRef.current.focus(),
417
+ onSubmitEditing: () => passwordRef?.current?.focus?.(),
418
418
  }}
419
419
  />
420
420
  </View>
@@ -526,9 +526,9 @@ export interface TagsParams {
526
526
  interface actions {
527
527
  accept: string;
528
528
  reject: string;
529
- pickupFailed: string;
530
- deliveryFailed: string;
531
- notReady: string;
529
+ pickupFailed?: string;
530
+ deliveryFailed?: string;
531
+ notReady?: string;
532
532
  }
533
533
 
534
534
  interface textTranslate {
@@ -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'
@@ -499,7 +499,7 @@ const AddressFormUI = (props: AddressFormParams) => {
499
499
  control={control}
500
500
  name='internal_number'
501
501
  rules={{ required: isRequiredField && isRequiredField('internal_number') ? t(`VALIDATION_ERROR_INTERNAL_NUMBER_REQUIRED`, `The field internal number is required`) : null }}
502
- defaultValue={address?.internal_number || formState.changes?.internal_number || addressState.address.internal_number || ''}
502
+ defaultValue={address?.internal_number || formState.changes?.internal_number || addressState?.address?.internal_number || ''}
503
503
  render={() => (
504
504
  <OInput
505
505
  name='internal_number'
@@ -508,11 +508,11 @@ const AddressFormUI = (props: AddressFormParams) => {
508
508
  handleChangeInput(text)
509
509
  setValue('internal_number', text)
510
510
  }}
511
- value={address?.internal_number || formState.changes?.internal_number || addressState.address.internal_number || ''}
511
+ value={address?.internal_number || formState.changes?.internal_number || addressState?.address?.internal_number || ''}
512
512
  style={styles.inputsStyle}
513
513
  forwardRef={internalNumberRef}
514
514
  returnKeyType='next'
515
- onSubmitEditing={() => zipCodeRef.current.focus()}
515
+ onSubmitEditing={() => zipCodeRef?.current?.focus?.()}
516
516
  blurOnSubmit={false}
517
517
  inputStyle={{ fontSize: 12 }}
518
518
  />
@@ -538,7 +538,7 @@ const AddressFormUI = (props: AddressFormParams) => {
538
538
  style={styles.inputsStyle}
539
539
  forwardRef={zipCodeRef}
540
540
  returnKeyType='next'
541
- onSubmitEditing={() => addressNotesRef.current.focus()}
541
+ onSubmitEditing={() => addressNotesRef?.current?.focus?.()}
542
542
  blurOnSubmit={false}
543
543
  inputStyle={{ fontSize: 12 }}
544
544
  />
@@ -31,7 +31,7 @@ export const FacebookLogin = (props: any) => {
31
31
  : text;
32
32
 
33
33
  const logoutWithFacebook = () => {
34
- LoginManager.logOut();
34
+ LoginManager && LoginManager.logOut();
35
35
  };
36
36
 
37
37
  const handleLoginClick = async (accessToken: string) => {
@@ -61,7 +61,7 @@ export const FacebookLogin = (props: any) => {
61
61
 
62
62
  const loginWithFacebook = () => {
63
63
  handleLoading && handleLoading(true)
64
- LoginManager.logInWithPermissions(['public_profile']).then(
64
+ LoginManager && LoginManager.logInWithPermissions(['public_profile']).then(
65
65
  (login: any) => {
66
66
  if (login.isCancelled) {
67
67
  const err = t('LOGIN_WITH_FACEBOOK_CANCELLED', 'Login cancelled')
@@ -355,7 +355,7 @@ const LoginFormUI = (props: LoginParams) => {
355
355
  handleData={(val: any) => setPhoneInputData(val)}
356
356
  textInputProps={{
357
357
  returnKeyType: 'next',
358
- onSubmitEditing: () => inputRef.current.focus(),
358
+ onSubmitEditing: () => inputRef?.current?.focus?.(),
359
359
  }}
360
360
  />
361
361
  </View>
@@ -172,7 +172,7 @@ const PaymentOptionsUI = (props: any) => {
172
172
  // data={paymethodsList.paymethods.sort((a: any, b: any) => a.id - b.id)}
173
173
  data={paymethodsList.paymethods.sort((a: any, b: any) => a.id - b.id).filter((p: any) => !excludeIds.includes(p.id))}
174
174
  renderItem={renderPaymethods}
175
- keyExtractor={(paymethod: any) => paymethod.id.toString()}
175
+ keyExtractor={(paymethod: any) => paymethod?.id?.toString?.()}
176
176
  />
177
177
  )}
178
178
  {(paymethodsList.loading || isLoading) && (
@@ -245,7 +245,7 @@ const PaymentOptionsUI = (props: any) => {
245
245
  )}
246
246
 
247
247
  {/* Stripe */}
248
- {isOpenMethod?.paymethod?.gateway === 'stripe' && !paymethodData.id && (
248
+ {isOpenMethod?.paymethod?.gateway === 'stripe' && !paymethodData?.id && (
249
249
  <View>
250
250
  <OButton
251
251
  text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
@@ -295,7 +295,7 @@ const PaymentOptionsUI = (props: any) => {
295
295
  <OModal
296
296
  entireModal
297
297
  title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
298
- open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData.id}
298
+ open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData?.id}
299
299
  onClose={() => handlePaymethodClick(null)}
300
300
  overScreen
301
301
  >
@@ -314,7 +314,7 @@ const PaymentOptionsUI = (props: any) => {
314
314
  </OModal>
315
315
 
316
316
  {/* Stripe Connect */}
317
- {isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData.id && (
317
+ {isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData?.id && (
318
318
  <View>
319
319
  <OButton
320
320
  text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
@@ -381,7 +381,7 @@ const PaymentOptionsUI = (props: any) => {
381
381
  {/* Paypal */}
382
382
  {/* <Modal
383
383
  className='modal-info'
384
- open={paymethodSelected?.gateway === 'paypal' && !paymethodData.id}
384
+ open={paymethodSelected?.gateway === 'paypal' && !paymethodData?.id}
385
385
  onClose={() => handlePaymethodClick(null)}
386
386
  title={t('PAY_WITH_PAYPAL', 'Pay with PayPal')}
387
387
  >
@@ -426,7 +426,7 @@ const SignupFormUI = (props: SignupParams) => {
426
426
  returnKeyType='next'
427
427
  blurOnSubmit={false}
428
428
  forwardRef={(ref: any) => handleRefs(ref, field.code)}
429
- onSubmitEditing={() => field.code === 'email' ? phoneRef.current.focus() : handleFocusRef(getNextFieldCode(i))}
429
+ onSubmitEditing={() => field.code === 'email' ? phoneRef?.current?.focus?.() : handleFocusRef(getNextFieldCode(i))}
430
430
  inputStyle={{ color: theme.colors.textPrimary, fontSize: 12 }}
431
431
  />
432
432
  )}
@@ -451,7 +451,7 @@ const SignupFormUI = (props: SignupParams) => {
451
451
  forwardRef={phoneRef}
452
452
  textInputProps={{
453
453
  returnKeyType: 'next',
454
- onSubmitEditing: () => passwordRef.current.focus(),
454
+ onSubmitEditing: () => passwordRef?.current?.focus?.(),
455
455
  style: { borderWidth: 0, fontSize: 12 }
456
456
  }}
457
457
  textWrapStyle={{ borderColor: theme.colors.clear, borderWidth: 0, height: 40, paddingStart: 0 }}
@@ -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')
@@ -320,7 +320,7 @@ const LoginFormUI = (props: LoginParams) => {
320
320
  handleData={(val: any) => setPhoneInputData(val)}
321
321
  textInputProps={{
322
322
  returnKeyType: 'next',
323
- onSubmitEditing: () => inputRef.current.focus(),
323
+ onSubmitEditing: () => inputRef?.current?.focus?.(),
324
324
  }}
325
325
  />
326
326
  </View>
@@ -286,7 +286,7 @@ const PaymentOptionsUI = (props: any) => {
286
286
  <OModal
287
287
  entireModal
288
288
  title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
289
- open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData.id}
289
+ open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData?.id}
290
290
  onClose={() => handlePaymethodClick(null)}
291
291
  >
292
292
  <KeyboardAvoidingView
@@ -304,7 +304,7 @@ const PaymentOptionsUI = (props: any) => {
304
304
  </OModal>
305
305
 
306
306
  {/* Stripe Connect */}
307
- {isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData.id && (
307
+ {isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData?.id && (
308
308
  <View>
309
309
  <StripeCardsList
310
310
  paymethod={isOpenMethod?.paymethod}
@@ -370,7 +370,7 @@ const PaymentOptionsUI = (props: any) => {
370
370
  {/* Paypal */}
371
371
  {/* <Modal
372
372
  className='modal-info'
373
- open={paymethodSelected?.gateway === 'paypal' && !paymethodData.id}
373
+ open={paymethodSelected?.gateway === 'paypal' && !paymethodData?.id}
374
374
  onClose={() => handlePaymethodClick(null)}
375
375
  title={t('PAY_WITH_PAYPAL', 'Pay with PayPal')}
376
376
  >
@@ -426,7 +426,7 @@ const SignupFormUI = (props: SignupParams) => {
426
426
  forwardRef={(ref: any) => handleRefs(ref, field.code)}
427
427
  onSubmitEditing={() =>
428
428
  field.code === 'email'
429
- ? phoneRef.current.focus()
429
+ ? phoneRef?.current?.focus?.()
430
430
  : handleFocusRef(getNextFieldCode(i))
431
431
  }
432
432
  />
@@ -446,7 +446,7 @@ const SignupFormUI = (props: SignupParams) => {
446
446
  forwardRef={phoneRef}
447
447
  textInputProps={{
448
448
  returnKeyType: 'next',
449
- onSubmitEditing: () => passwordRef.current.focus(),
449
+ onSubmitEditing: () => passwordRef?.current?.focus?.(),
450
450
  }}
451
451
  />
452
452
  </View>