ordering-ui-react-native 0.15.91 → 0.15.94

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 (28) hide show
  1. package/package.json +1 -1
  2. package/src/components/Checkout/index.tsx +23 -2
  3. package/src/components/SingleProductCard/index.tsx +16 -4
  4. package/themes/business/src/components/LoginForm/index.tsx +6 -4
  5. package/themes/business/src/components/NewOrderNotification/index.tsx +24 -13
  6. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +1 -0
  7. package/themes/business/src/components/OrdersOption/index.tsx +5 -2
  8. package/themes/kiosk/src/components/BusinessMenu/index.tsx +23 -25
  9. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -3
  10. package/themes/kiosk/src/components/Cart/index.tsx +10 -11
  11. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +36 -30
  12. package/themes/kiosk/src/components/Checkout/index.tsx +22 -19
  13. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +1 -1
  14. package/themes/kiosk/src/components/PaymentOptions/index.tsx +54 -52
  15. package/themes/kiosk/src/components/ProductOptionSubOption/index.tsx +3 -1
  16. package/themes/original/src/components/BusinessListingSearch/index.tsx +54 -2
  17. package/themes/original/src/components/BusinessListingSearch/styles.tsx +4 -0
  18. package/themes/original/src/components/BusinessesListing/index.tsx +3 -1
  19. package/themes/original/src/components/Checkout/index.tsx +36 -28
  20. package/themes/original/src/components/DriverTips/index.tsx +6 -6
  21. package/themes/original/src/components/Help/index.tsx +21 -4
  22. package/themes/original/src/components/LastOrders/index.tsx +12 -1
  23. package/themes/original/src/components/LoginForm/index.tsx +40 -7
  24. package/themes/original/src/components/OrderDetails/index.tsx +18 -21
  25. package/themes/original/src/components/PaymentOptionWallet/index.tsx +1 -0
  26. package/themes/original/src/components/Promotions/index.tsx +22 -6
  27. package/themes/original/src/components/Wallets/index.tsx +1 -1
  28. package/themes/original/src/types/index.tsx +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.15.91",
3
+ "version": "0.15.94",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -592,6 +592,19 @@ const CheckoutUI = (props: any) => {
592
592
  {t('WARNING_INVALID_PRODUCTS', 'Some products are invalid, please check them.')}
593
593
  </OText>
594
594
  )}
595
+
596
+ {options.type === 1 &&
597
+ validationFields?.fields?.checkout?.driver_tip?.enabled &&
598
+ validationFields?.fields?.checkout?.driver_tip?.required &&
599
+ (Number(cart?.driver_tip) <= 0) && (
600
+ <OText
601
+ style={{ textAlign: 'center' }}
602
+ color={theme.colors.error}
603
+ size={14}
604
+ >
605
+ {t('WARNING_INVALID_DRIVER_TIP', 'Driver Tip is required.')}
606
+ </OText>
607
+ )}
595
608
  </ChErrors>
596
609
  </ChSection>
597
610
  )}
@@ -602,8 +615,16 @@ const CheckoutUI = (props: any) => {
602
615
  <>
603
616
  <FloatingButton
604
617
  handleClick={() => handlePlaceOrder()}
605
- isSecondaryBtn={loading || !cart?.valid || !paymethodSelected || placing || errorCash || cart?.subtotal_to_calculate < cart?.minimum || paymethodSelected?.gateway === 'paypal'}
606
- disabled={loading || !cart?.valid || !paymethodSelected || placing || errorCash || cart?.subtotal_to_calculate < cart?.minimum || paymethodSelected?.gateway === 'paypal'}
618
+ isSecondaryBtn={loading || !cart?.valid || !paymethodSelected || placing || errorCash || cart?.subtotal_to_calculate < cart?.minimum || paymethodSelected?.gateway === 'paypal' ||
619
+ (options.type === 1 &&
620
+ validationFields?.fields?.checkout?.driver_tip?.enabled &&
621
+ validationFields?.fields?.checkout?.driver_tip?.required &&
622
+ (Number(cart?.driver_tip) <= 0))}
623
+ disabled={loading || !cart?.valid || !paymethodSelected || placing || errorCash || cart?.subtotal_to_calculate < cart?.minimum || paymethodSelected?.gateway === 'paypal' ||
624
+ (options.type === 1 &&
625
+ validationFields?.fields?.checkout?.driver_tip?.enabled &&
626
+ validationFields?.fields?.checkout?.driver_tip?.required &&
627
+ (Number(cart?.driver_tip) <= 0))}
607
628
  btnText={cart?.subtotal_to_calculate >= cart?.minimum
608
629
  ? (
609
630
  placing
@@ -10,6 +10,7 @@ import {
10
10
  import { StyleSheet } from 'react-native'
11
11
  import { OText, OIcon } from '../shared'
12
12
  import { useTheme } from 'styled-components/native'
13
+ import FastImage from 'react-native-fast-image'
13
14
 
14
15
  export const SingleProductCard = (props: SingleProductCardParams) => {
15
16
  const {
@@ -77,10 +78,21 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
77
78
  activeOpacity={1}
78
79
  onPress={() => onProductClick?.(product)}
79
80
  >
80
- <OIcon
81
- url={optimizeImage(product?.images, 'h_200,c_limit')}
82
- style={styles.productStyle}
83
- />
81
+ {product?.images ? (
82
+ <FastImage
83
+ style={styles.productStyle}
84
+ source={{
85
+ uri: optimizeImage(product?.images, 'h_250,c_limit'),
86
+ priority: FastImage.priority.normal,
87
+ }}
88
+ resizeMode={FastImage.resizeMode.cover}
89
+ />
90
+ ) : (
91
+ <OIcon
92
+ src={theme?.images?.dummies?.product}
93
+ style={styles.productStyle}
94
+ />
95
+ )}
84
96
  <CardInfo>
85
97
  <OText numberOfLines={1} ellipsizeMode='tail' style={styles.textStyle}>{product?.name}</OText>
86
98
  <OText size={12} numberOfLines={2} ellipsizeMode='tail' style={styles.textStyle}>{product?.description}</OText>
@@ -67,7 +67,7 @@ const LoginFormUI = (props: LoginParams) => {
67
67
  const inputRef = useRef<any>(null);
68
68
  const inputMailRef = useRef<any>(null);
69
69
 
70
- const [projectName, setProjectName] = useState('');
70
+ const [projectName, setProjectName] = useState({name: '', isFocued: false});
71
71
  const [passwordSee, setPasswordSee] = useState(false);
72
72
  const [isLoadingVerifyModal, setIsLoadingVerifyModal] = useState(false);
73
73
  const [isModalVisible, setIsModalVisible] = useState(false);
@@ -125,15 +125,16 @@ const LoginFormUI = (props: LoginParams) => {
125
125
 
126
126
  useEffect(() => {
127
127
  const projectInputInterval = setInterval(() => {
128
- if (projectName && useRootPoint) {
128
+ if (projectName.name && useRootPoint && projectName.isFocued) {
129
129
  setOrdering({
130
130
  ...ordering,
131
- project: projectName
131
+ project: projectName.name
132
132
  })
133
133
  }
134
134
  }, 1500)
135
135
  return () => clearInterval(projectInputInterval);
136
136
  }, [projectName])
137
+
137
138
  const getTraduction = (key: string) => {
138
139
  const keyList: any = {
139
140
  // Add the key and traduction that you need below
@@ -515,7 +516,7 @@ const LoginFormUI = (props: LoginParams) => {
515
516
  icon={theme.images.general.project}
516
517
  iconColor={theme.colors.arrowColor}
517
518
  onChange={(e: any) => {
518
- setProjectName(e?.target?.value)
519
+ setProjectName({name: e?.target?.value, isFocued: true})
519
520
  onChange(e?.target?.value);
520
521
  setSubmitted(false);
521
522
  }}
@@ -544,6 +545,7 @@ const LoginFormUI = (props: LoginParams) => {
544
545
  icon={theme.images.logos.emailInputIcon}
545
546
  iconColor={theme.colors.arrowColor}
546
547
  onChange={(e: any) => {
548
+ setProjectName({...projectName, isFocued: false})
547
549
  handleChangeInputEmail(e, onChange);
548
550
  }}
549
551
  selectionColor={theme.colors.primary}
@@ -23,7 +23,7 @@ const NewOrderNotificationUI = (props: any) => {
23
23
  const [ordering] = useApi()
24
24
  const { getCurrentLocation } = useLocation();
25
25
  const [soundTimeout, setSoundTimeout] = useState<any>(null)
26
- const [currentEvent, setCurrentEvent] = useState<any>(null)
26
+ let [currentEvent, setCurrentEvent] = useState<any>(null)
27
27
 
28
28
  const evtList: any = {
29
29
  1: {
@@ -46,6 +46,7 @@ const NewOrderNotificationUI = (props: any) => {
46
46
  const notificationSound = new Sound(theme.sounds.notification, (e) => { console.log(e) });
47
47
 
48
48
  const handlePlayNotificationSound = () => {
49
+ if (currentEvent) return
49
50
  let times = 0
50
51
  const _timeout = setInterval(function () {
51
52
  notificationSound.play(success => {
@@ -63,30 +64,40 @@ const NewOrderNotificationUI = (props: any) => {
63
64
 
64
65
  const handleCloseModal = () => {
65
66
  clearInterval(soundTimeout)
67
+ currentEvent = null
66
68
  setCurrentEvent({ evt: null })
67
69
  }
68
70
 
69
71
  const handleEventNotification = async (evtType: number, value: any) => {
70
72
  if (value?.driver) {
71
- const location = await getCurrentLocation()
72
- await fetch(`${ordering.root}/users/${user.id}/locations`, {
73
- method: 'POST',
74
- body: JSON.stringify({
75
- location: JSON.stringify({location: `{lat: ${location.latitude}, lng: ${location.longitude}}`})
76
- }),
77
- headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` }
78
- })
79
- const assignedTimeDiff = moment.utc(value?.driver?.last_order_assigned_at).local().fromNow()
80
- if (assignedTimeDiff === 'a few seconds ago' && !isBusinessApp) {
73
+ try {
74
+ const location = await getCurrentLocation()
75
+ await fetch(`${ordering.root}/users/${user.id}/locations`, {
76
+ method: 'POST',
77
+ body: JSON.stringify({
78
+ location: JSON.stringify({location: `{lat: ${location.latitude}, lng: ${location.longitude}}`})
79
+ }),
80
+ headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` }
81
+ })
82
+ } catch (error) {
83
+ console.log(error)
84
+ }
85
+ const duration = moment.duration(moment().diff(moment.utc(value?.last_driver_assigned_at)))
86
+ const assignedSecondsDiff = duration.asSeconds()
87
+ if (assignedSecondsDiff < 5 && !isBusinessApp) {
81
88
  handlePlayNotificationSound()
82
89
  clearInterval(soundTimeout)
90
+ currentEvent = { evt: 2, orderId: value?.id }
83
91
  setCurrentEvent({ evt: 2, orderId: value?.id })
84
92
  }
85
- return
86
93
  }
87
- if (evtType === 3) return
94
+ if (evtType === 3 || value.author_id === user.id) return
88
95
  handlePlayNotificationSound()
89
96
  clearInterval(soundTimeout)
97
+ currentEvent = {
98
+ evt: evtType,
99
+ orderId: evtList[evtType].event === 'messages' ? value?.order_id : value?.id
100
+ }
90
101
  setCurrentEvent({
91
102
  evt: evtType,
92
103
  orderId: evtList[evtType].event === 'messages' ? value?.order_id : value?.id
@@ -77,6 +77,7 @@ export const OrderContentComponent = (props: OrderContent) => {
77
77
  })
78
78
 
79
79
  const getIncludedTaxes = () => {
80
+ if (!order?.taxes) return 0
80
81
  if (order?.taxes?.length === 0) {
81
82
  return order.tax_type === 1 ? order?.summary?.tax ?? 0 : 0
82
83
  } else {
@@ -725,8 +725,11 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
725
725
  </ScrollView>
726
726
  </View>
727
727
  {/* </GestureRecognizer> */}
728
-
729
- <NewOrderNotification isBusinessApp={isBusinessApp} />
728
+
729
+ {isBusinessApp && (
730
+ <NewOrderNotification isBusinessApp={isBusinessApp} />
731
+ )}
732
+
730
733
  {(openSearchModal || openSLASettingModal) && (
731
734
  <OModal open={openSearchModal || openSLASettingModal} entireModal customClose>
732
735
  <ModalContainer
@@ -120,32 +120,30 @@ const BusinessMenu = (props:any): React.ReactElement => {
120
120
  }}
121
121
  >
122
122
  <Container nopadding nestedScrollEnabled>
123
- <View style={{ paddingTop: 20 }}>
124
- <NavBar
125
- title={t('MENU_V21', 'Menu')}
126
- onActionLeft={goToBack}
127
- includeOrderTypeSelector
128
- onClickTypes={handleRedirect}
129
- rightComponent={cart && (
130
- <TouchableOpacity
131
- style={{ paddingHorizontal: 20, flexDirection: 'row', alignItems: 'center' }}
132
- onPress={onToggleCart}
123
+ <NavBar
124
+ title={t('MENU_V21', 'Menu')}
125
+ onActionLeft={goToBack}
126
+ includeOrderTypeSelector
127
+ onClickTypes={handleRedirect}
128
+ rightComponent={cart && (
129
+ <TouchableOpacity
130
+ style={{ flexDirection: 'row', alignItems: 'center' }}
131
+ onPress={onToggleCart}
132
+ >
133
+ <OText
134
+ color={theme.colors.mediumGray}
133
135
  >
134
- <OText
135
- color={theme.colors.mediumGray}
136
- >
137
- {`${cart?.products?.length || 0} ${t('ITEMS', 'items')}`} {parsePrice(cart?.total || 0)} {' '}
138
- </OText>
139
-
140
- <MaterialIcon
141
- name={bottomSheetVisibility ? "cart-off" : "cart-outline"}
142
- color={theme.colors.primary}
143
- size={30}
144
- />
145
- </TouchableOpacity>
146
- )}
147
- />
148
- </View>
136
+ {`${cart?.products?.length || 0} ${t('ITEMS', 'items')}`} {parsePrice(cart?.total || 0)} {' '}
137
+ </OText>
138
+
139
+ <MaterialIcon
140
+ name={bottomSheetVisibility ? "cart-off" : "cart-outline"}
141
+ color={theme.colors.primary}
142
+ size={30}
143
+ />
144
+ </TouchableOpacity>
145
+ )}
146
+ />
149
147
 
150
148
  <BusinessProductsListing
151
149
  { ...businessProductsListingProps }
@@ -1,5 +1,5 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
1
+ import React from 'react';
2
+ import { PlaceholderLine } from 'rn-placeholder';
3
3
  import { View, ScrollView, Platform } from 'react-native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import { useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation';
@@ -21,7 +21,6 @@ const BusinessesListingUI = (props: any) => {
21
21
  navigation,
22
22
  businessesList,
23
23
  handleBusinessClick,
24
- paginationProps,
25
24
  } = props;
26
25
 
27
26
  const theme = useTheme();
@@ -110,7 +110,6 @@ const CartUI = (props: any) => {
110
110
  <NavBar
111
111
  title={t('CONFIRM_YOUR_ORDER', 'Confirm your order')}
112
112
  onActionLeft={goToBack}
113
- style={{ height: orientationState?.dimensions?.height * 0.08 }}
114
113
  btnStyle={{ paddingLeft: 0 }}
115
114
  rightComponent={(
116
115
  <OButton
@@ -238,8 +237,8 @@ const CartUI = (props: any) => {
238
237
  </OSTable>
239
238
  )}
240
239
  {
241
- cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 1)?.map((offer: any) => (
242
- <OSTable key={offer.id}>
240
+ cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 1)?.map((offer: any, i: number) => (
241
+ <OSTable key={`${offer?.id}_${i}`}>
243
242
  <OSRow>
244
243
  <OText>{offer.name}</OText>
245
244
  {offer.rate_type === 1 && (
@@ -263,8 +262,8 @@ const CartUI = (props: any) => {
263
262
  </OSTable>
264
263
  )}
265
264
  {
266
- cart.taxes?.length > 0 && cart.taxes.filter((tax: any) => tax.type === 2 && tax?.rate !== 0).map((tax: any) => (
267
- <OSTable key={tax.id}>
265
+ cart.taxes?.length > 0 && cart.taxes.filter((tax: any) => tax.type === 2 && tax?.rate !== 0).map((tax: any, i: number) => (
266
+ <OSTable key={`${tax?.id}_${i}`}>
268
267
  <OSRow>
269
268
  <OText>
270
269
  {tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
@@ -276,8 +275,8 @@ const CartUI = (props: any) => {
276
275
  ))
277
276
  }
278
277
  {
279
- cart?.fees?.length > 0 && cart?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0)).map((fee: any) => (
280
- <OSTable key={fee?.id}>
278
+ cart?.fees?.length > 0 && cart?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0)).map((fee: any, i: number) => (
279
+ <OSTable key={`${fee?.id}_${i}`}>
281
280
  <OSRow>
282
281
  <OText>
283
282
  {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
@@ -289,8 +288,8 @@ const CartUI = (props: any) => {
289
288
  ))
290
289
  }
291
290
  {
292
- cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 3)?.map((offer: any) => (
293
- <OSTable key={offer.id}>
291
+ cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 3)?.map((offer: any, i: number) => (
292
+ <OSTable key={`${offer?.id}_${i}`}>
294
293
  <OSRow>
295
294
  <OText>{offer.name}</OText>
296
295
  {offer.rate_type === 1 && (
@@ -310,8 +309,8 @@ const CartUI = (props: any) => {
310
309
  </OSTable>
311
310
  )}
312
311
  {
313
- cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any) => (
314
- <OSTable key={offer.id}>
312
+ cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any, i: number) => (
313
+ <OSTable key={`${offer?.id}_${i}`}>
315
314
  <OSRow>
316
315
  <OText>{offer.name}</OText>
317
316
  {offer.rate_type === 1 && (
@@ -12,6 +12,7 @@ import {
12
12
  OText
13
13
  } from '../../components/shared';
14
14
  import { CartBottomSheet } from '../../components/CartBottomSheet';
15
+ import { NotFoundSource } from '../NotFoundSource';
15
16
  import { Category } from '../../types';
16
17
  import { CartContent } from '../../components/CartContent';
17
18
  import { TouchableOpacity } from 'react-native-gesture-handler';
@@ -112,37 +113,36 @@ const CategoriesMenu = (props: any): React.ReactElement => {
112
113
  }}
113
114
  >
114
115
  <Container nopadding nestedScrollEnabled>
115
- <View style={{ paddingTop: 20 }}>
116
- <NavBar
117
- title={categories[curIndexCateg].name}
118
- onActionLeft={goToBack}
119
- rightComponent={cart && (
120
- <TouchableOpacity
121
- style={{ paddingHorizontal: 20, flexDirection: 'row', alignItems: 'center' }}
122
- onPress={onToggleCart}
116
+ <NavBar
117
+ title={categories[curIndexCateg].name}
118
+ onActionLeft={goToBack}
119
+ rightComponent={cart && (
120
+ <TouchableOpacity
121
+ style={{ paddingHorizontal: 20, flexDirection: 'row', alignItems: 'center' }}
122
+ onPress={onToggleCart}
123
+ >
124
+ <OText
125
+ color={theme.colors.mediumGray}
123
126
  >
124
- <OText
125
- color={theme.colors.mediumGray}
126
- >
127
- {`${cart?.products?.length || 0} ${t('ITEMS', 'items')}`} {parsePrice(cart?.total || 0)} {' '}
128
- </OText>
129
-
130
- <MaterialIcon
131
- name={bottomSheetVisibility ? "cart-off" : "cart-outline"}
132
- color={theme.colors.primary}
133
- size={30}
134
- />
135
- </TouchableOpacity>
136
- )}
137
- />
138
- <OSegment
139
- items={categories.map((category) => ({
140
- text: category.name
141
- }))}
142
- selectedIdx={curIndexCateg}
143
- onSelectItem={onChangeTabs}
144
- />
145
- </View>
127
+ {`${cart?.products?.length || 0} ${t('ITEMS', 'items')}`} {parsePrice(cart?.total || 0)} {' '}
128
+ </OText>
129
+
130
+ <MaterialIcon
131
+ name={bottomSheetVisibility ? "cart-off" : "cart-outline"}
132
+ color={theme.colors.primary}
133
+ size={30}
134
+ />
135
+ </TouchableOpacity>
136
+ )}
137
+ />
138
+
139
+ <OSegment
140
+ items={categories.map((category) => ({
141
+ text: category.name
142
+ }))}
143
+ selectedIdx={curIndexCateg}
144
+ onSelectItem={onChangeTabs}
145
+ />
146
146
 
147
147
  <GridContainer
148
148
  style={{
@@ -182,6 +182,12 @@ const CategoriesMenu = (props: any): React.ReactElement => {
182
182
  }}
183
183
  />
184
184
  ))}
185
+
186
+ {categories[curIndexCateg].products.length === 0 && (
187
+ <NotFoundSource
188
+ content={t('ERROR_NOT_FOUND_PRODUCTS_TIME', 'No products found at this time')}
189
+ />
190
+ )}
185
191
  </GridContainer>
186
192
  </Container>
187
193
  </View>
@@ -36,27 +36,30 @@ const CheckoutUI = (props: any) => {
36
36
 
37
37
  const [errorCash, setErrorCash] = useState(false);
38
38
 
39
+ useEffect(() => {
40
+ if (!cartState.loading && cart && !cart?.valid && cart?.status === 2) {
41
+ navigation?.canGoBack() && navigation.goBack()
42
+ }
43
+ }, [cart])
44
+
39
45
  return (
40
46
  <>
41
- {!cartState.loading && cart && cart?.status !== 2 && cart?.valid && (
42
- <PaymentOptions
43
- navigation={navigation}
44
- cart={cart}
45
- errors={errors}
46
- onPaymentChange={handlePaymethodChange}
47
- onNavigationRedirect={onNavigationRedirect}
48
- paySelected={paymethodSelected}
49
- handlerClickPlaceOrder={handlerClickPlaceOrder}
50
- placing={placing}
51
-
52
- errorCash={errorCash}
53
- isDisabled={cart?.status === 2}
54
- businessId={businessDetails?.business?.id}
55
- isLoading={businessDetails.loading}
56
- paymethods={businessDetails?.business?.paymethods}
57
- setErrorCash={setErrorCash}
58
- />
59
- )}
47
+ <PaymentOptions
48
+ navigation={navigation}
49
+ cart={cart}
50
+ errors={errors}
51
+ onPaymentChange={handlePaymethodChange}
52
+ onNavigationRedirect={onNavigationRedirect}
53
+ paySelected={paymethodSelected}
54
+ handlerClickPlaceOrder={handlerClickPlaceOrder}
55
+ placing={placing}
56
+ errorCash={errorCash}
57
+ isDisabled={cart?.status === 2}
58
+ businessId={businessDetails?.business?.id}
59
+ isLoading={cartState.loading || businessDetails.loading}
60
+ paymethods={businessDetails?.business?.paymethods}
61
+ setErrorCash={setErrorCash}
62
+ />
60
63
  </>
61
64
  )
62
65
  }
@@ -59,7 +59,7 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
59
59
  <Container>
60
60
  <NavBar
61
61
  title={t('ORDER_TYPE_X_ID', 'Order type')}
62
- {...(goBack && { onActionLeft: goBack })}
62
+ onActionLeft={goBack}
63
63
  btnStyle={{ paddingLeft: 0 }}
64
64
  />
65
65
 
@@ -192,64 +192,66 @@ const PaymentOptionsUI = (props: any) => {
192
192
  <Spinner visible={isLoading || placing || paymethodsList?.loading} />
193
193
 
194
194
  <Container nestedScrollEnabled>
195
- <NavBar
196
- title={t('PAYMENT_METHODS', 'Payment methods')}
197
- onActionLeft={goToBack}
198
- btnStyle={{ paddingLeft: 0 }}
199
- />
200
-
201
- <View
202
- style={{ marginVertical: orientationState?.dimensions?.height * 0.03 }}>
203
- <OText size={orientationState?.dimensions?.width * 0.048}>
204
- {t('HOW_WOULD_YOU', 'How would you')} {'\n'}
205
- <OText
206
- size={orientationState?.dimensions?.width * 0.048}
207
- weight={'700'}>
208
- {`${t('LIKE_TO_PAY', 'like to pay')}?`}
209
- </OText>
210
- </OText>
211
- </View>
212
-
213
195
  {supportedMethods?.length > 0 && (
214
- <GridContainer style={{ justifyContent: 'space-between' }}>
215
- {propsOfItems.CARD_ON_DELIVERY_ID && (
216
- <View style={{ marginBottom: orientationState?.orientation === LANDSCAPE ? 20 : 0 }}>
217
- <OptionCard {...propsOfItems?.CARD_ON_DELIVERY_ID} styke />
218
- </View>
219
- )}
196
+ <>
197
+ <NavBar
198
+ title={t('PAYMENT_METHODS', 'Payment methods')}
199
+ onActionLeft={goToBack}
200
+ btnStyle={{ paddingLeft: 0 }}
201
+ />
220
202
 
221
203
  <View
222
- style={{
223
- width:
224
- orientationState?.orientation === LANDSCAPE
225
- ? orientationState?.dimensions?.width * 0.0016
226
- : 1,
227
- height:
228
- orientationState?.orientation === PORTRAIT
229
- ? orientationState?.dimensions?.height * 0.018
230
- : 1,
231
- }}
232
- />
204
+ style={{ marginVertical: orientationState?.dimensions?.height * 0.03 }}>
205
+ <OText size={orientationState?.dimensions?.width * 0.048}>
206
+ {t('HOW_WOULD_YOU', 'How would you')} {'\n'}
207
+ <OText
208
+ size={orientationState?.dimensions?.width * 0.048}
209
+ weight={'700'}>
210
+ {`${t('LIKE_TO_PAY', 'like to pay')}?`}
211
+ </OText>
212
+ </OText>
213
+ </View>
233
214
 
234
- {propsOfItems?.CASH_ID && <OptionCard {...propsOfItems?.CASH_ID} />}
215
+ <GridContainer style={{ justifyContent: 'space-between' }}>
216
+ {propsOfItems.CARD_ON_DELIVERY_ID && (
217
+ <View style={{ marginBottom: orientationState?.orientation === LANDSCAPE ? 20 : 0 }}>
218
+ <OptionCard {...propsOfItems?.CARD_ON_DELIVERY_ID} styke />
219
+ </View>
220
+ )}
235
221
 
236
- <View
237
- style={{
238
- width:
239
- orientationState?.orientation === LANDSCAPE
240
- ? orientationState?.dimensions?.width * 0.0016
241
- : 1,
242
- height:
243
- orientationState?.orientation === PORTRAIT
244
- ? orientationState?.dimensions?.height * 0.018
245
- : 1,
246
- }}
247
- />
222
+ <View
223
+ style={{
224
+ width:
225
+ orientationState?.orientation === LANDSCAPE
226
+ ? orientationState?.dimensions?.width * 0.0016
227
+ : 1,
228
+ height:
229
+ orientationState?.orientation === PORTRAIT
230
+ ? orientationState?.dimensions?.height * 0.018
231
+ : 1,
232
+ }}
233
+ />
234
+
235
+ {propsOfItems?.CASH_ID && <OptionCard {...propsOfItems?.CASH_ID} />}
236
+
237
+ <View
238
+ style={{
239
+ width:
240
+ orientationState?.orientation === LANDSCAPE
241
+ ? orientationState?.dimensions?.width * 0.0016
242
+ : 1,
243
+ height:
244
+ orientationState?.orientation === PORTRAIT
245
+ ? orientationState?.dimensions?.height * 0.018
246
+ : 1,
247
+ }}
248
+ />
248
249
 
249
- {propsOfItems.STRIPE && (
250
- <OptionCard {...propsOfItems?.STRIPE} />
251
- )}
252
- </GridContainer>
250
+ {propsOfItems.STRIPE && (
251
+ <OptionCard {...propsOfItems?.STRIPE} />
252
+ )}
253
+ </GridContainer>
254
+ </>
253
255
  )}
254
256
  <View style={{ height: orientationState?.dimensions?.height * 0.05 }} />
255
257
  <OModal
@@ -144,13 +144,15 @@ export const ProductOptionSubOptionUI = (props: any) => {
144
144
  </PositionControl>
145
145
  )
146
146
  }
147
+ {price > 0 && (
147
148
  <OText
148
149
  color="#909BA9"
149
150
  size={16}
150
151
  weight="bold"
151
152
  >
152
- {price > 0 && '+'} {parsePrice(price)}
153
+ + {parsePrice(price)}
153
154
  </OText>
155
+ )}
154
156
  </RightSide>
155
157
  </Container>
156
158
  )