ordering-ui-react-native 0.23.43 → 0.23.45

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.23.43",
3
+ "version": "0.23.45",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -295,6 +295,7 @@ const CheckoutUI = (props: any) => {
295
295
  </Placeholder>
296
296
  ) : (
297
297
  <AddressDetails
298
+ cart={cart}
298
299
  navigation={navigation}
299
300
  location={businessDetails?.business?.location}
300
301
  businessLogo={businessDetails?.business?.logo}
@@ -598,14 +599,14 @@ const CheckoutUI = (props: any) => {
598
599
  validationFields?.fields?.checkout?.driver_tip?.enabled &&
599
600
  validationFields?.fields?.checkout?.driver_tip?.required &&
600
601
  (Number(cart?.driver_tip) <= 0) && (
601
- <OText
602
- style={{ textAlign: 'center' }}
603
- color={theme.colors.error}
604
- size={14}
605
- >
606
- {t('WARNING_INVALID_DRIVER_TIP', 'Driver Tip is required.')}
607
- </OText>
608
- )}
602
+ <OText
603
+ style={{ textAlign: 'center' }}
604
+ color={theme.colors.error}
605
+ size={14}
606
+ >
607
+ {t('WARNING_INVALID_DRIVER_TIP', 'Driver Tip is required.')}
608
+ </OText>
609
+ )}
609
610
  </ChErrors>
610
611
  </ChSection>
611
612
  )}
@@ -617,15 +618,15 @@ const CheckoutUI = (props: any) => {
617
618
  <FloatingButton
618
619
  handleClick={() => handlePlaceOrder()}
619
620
  isSecondaryBtn={loading || !cart?.valid || !paymethodSelected || placing || errorCash || cart?.subtotal_to_calculate < cart?.minimum || paymethodSelected?.gateway === 'paypal' ||
620
- (options.type === 1 &&
621
- validationFields?.fields?.checkout?.driver_tip?.enabled &&
622
- validationFields?.fields?.checkout?.driver_tip?.required &&
623
- (Number(cart?.driver_tip) <= 0))}
621
+ (options.type === 1 &&
622
+ validationFields?.fields?.checkout?.driver_tip?.enabled &&
623
+ validationFields?.fields?.checkout?.driver_tip?.required &&
624
+ (Number(cart?.driver_tip) <= 0))}
624
625
  disabled={loading || !cart?.valid || !paymethodSelected || placing || errorCash || cart?.subtotal_to_calculate < cart?.minimum || paymethodSelected?.gateway === 'paypal' ||
625
- (options.type === 1 &&
626
- validationFields?.fields?.checkout?.driver_tip?.enabled &&
627
- validationFields?.fields?.checkout?.driver_tip?.required &&
628
- (Number(cart?.driver_tip) <= 0))}
626
+ (options.type === 1 &&
627
+ validationFields?.fields?.checkout?.driver_tip?.enabled &&
628
+ validationFields?.fields?.checkout?.driver_tip?.required &&
629
+ (Number(cart?.driver_tip) <= 0))}
629
630
  btnText={cart?.subtotal_to_calculate >= cart?.minimum
630
631
  ? (
631
632
  placing
@@ -641,31 +642,31 @@ const CheckoutUI = (props: any) => {
641
642
  </>
642
643
  )}
643
644
  {webviewPaymethod?.gateway === 'paypal' && showGateway.open && (
644
- <PaymentOptionsWebView
645
- onNavigationRedirect={onNavigationRedirect}
646
- uri={`${ordering.root}/html/paypal_react_native`}
647
- user={user}
648
- token={token}
649
- cart={cart}
650
- currency={currency}
651
- webviewPaymethod={webviewPaymethod}
652
- setShowGateway={setShowGateway}
653
- setOpenOrderCreating={setOpenOrderCreating}
654
- />
645
+ <PaymentOptionsWebView
646
+ onNavigationRedirect={onNavigationRedirect}
647
+ uri={`${ordering.root}/html/paypal_react_native`}
648
+ user={user}
649
+ token={token}
650
+ cart={cart}
651
+ currency={currency}
652
+ webviewPaymethod={webviewPaymethod}
653
+ setShowGateway={setShowGateway}
654
+ setOpenOrderCreating={setOpenOrderCreating}
655
+ />
655
656
  )}
656
657
  {webviewPaymethod?.gateway === 'square' && showGateway.open && (
657
- <PaymentOptionsWebView
658
- onNavigationRedirect={onNavigationRedirect}
659
- uri={`https://test-square-f50f7.web.app`}
660
- user={user}
661
- token={token}
662
- cart={cart}
663
- currency={currency}
664
- webviewPaymethod={webviewPaymethod}
665
- setShowGateway={setShowGateway}
666
- setOpenOrderCreating={setOpenOrderCreating}
667
- locationId={'L1NGAY5M6KJRX'}
668
- />
658
+ <PaymentOptionsWebView
659
+ onNavigationRedirect={onNavigationRedirect}
660
+ uri={`https://test-square-f50f7.web.app`}
661
+ user={user}
662
+ token={token}
663
+ cart={cart}
664
+ currency={currency}
665
+ webviewPaymethod={webviewPaymethod}
666
+ setShowGateway={setShowGateway}
667
+ setOpenOrderCreating={setOpenOrderCreating}
668
+ locationId={'L1NGAY5M6KJRX'}
669
+ />
669
670
  )}
670
671
  {openOrderCreating && (
671
672
  <View style={{ zIndex: 9999, height: '100%', width: '100%', position: 'absolute', backgroundColor: 'white' }}>
@@ -5,7 +5,8 @@ import { useTheme } from 'styled-components/native'
5
5
  import {
6
6
  MomentOption as MomentOptionController,
7
7
  useConfig,
8
- useUtils
8
+ useUtils,
9
+ useLanguage
9
10
  } from 'ordering-components/native'
10
11
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
11
12
  import IconAntDesign from 'react-native-vector-icons/AntDesign'
@@ -26,6 +27,7 @@ const MomentSelectorUI = (props: any) => {
26
27
  const { top } = useSafeAreaInsets()
27
28
  const [{ configs }] = useConfig()
28
29
  const [{ parseTime }] = useUtils()
30
+ const [, t] = useLanguage()
29
31
 
30
32
  const [customizedDateList, setCustomizedDateList] = useState([])
31
33
  const [customizedTimeList, setCustomizedTimeList] = useState([])
@@ -130,6 +132,7 @@ const MomentSelectorUI = (props: any) => {
130
132
  <View style={styles.selectWrapper}>
131
133
  <SelectDropdown
132
134
  defaultValue={customizedTimeList?.find((item: any) => item.key === timeSelected)}
135
+ defaultButtonText={t('SELECT_A_TIME_OPTION', 'Select an option')}
133
136
  data={customizedTimeList}
134
137
  onSelect={(selectedItem, index) => {
135
138
  handleChangeTime(selectedItem.key)