ordering-ui-react-native 0.14.30 → 0.14.31-release

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 (61) hide show
  1. package/package.json +2 -2
  2. package/src/components/BusinessItemAccordion/index.tsx +2 -2
  3. package/src/components/BusinessProductsListing/index.tsx +10 -26
  4. package/src/components/Cart/index.tsx +136 -62
  5. package/src/components/Cart/styles.tsx +7 -0
  6. package/src/components/Checkout/index.tsx +10 -6
  7. package/src/components/LogoutButton/index.tsx +14 -0
  8. package/src/components/OrderDetails/index.tsx +102 -34
  9. package/src/components/OrderDetails/styles.tsx +7 -0
  10. package/src/components/OrderSummary/index.tsx +142 -58
  11. package/src/components/OrderSummary/styles.tsx +10 -2
  12. package/src/components/ProductForm/index.tsx +47 -10
  13. package/src/components/ProductForm/styles.tsx +1 -1
  14. package/src/components/SingleProductCard/index.tsx +1 -1
  15. package/src/components/TaxInformation/index.tsx +58 -26
  16. package/src/components/UpsellingProducts/index.tsx +13 -31
  17. package/src/components/VerifyPhone/styles.tsx +1 -2
  18. package/src/navigators/HomeNavigator.tsx +6 -0
  19. package/src/pages/ProductDetails.tsx +55 -0
  20. package/src/types/index.tsx +2 -0
  21. package/src/types/react-native-color-matrix-image-filters/index.d.ts +1 -0
  22. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  23. package/themes/doordash/src/components/ProductForm/index.tsx +41 -2
  24. package/themes/doordash/src/components/ProductForm/styles.tsx +1 -1
  25. package/themes/instacart/src/components/ProductForm/index.tsx +40 -1
  26. package/themes/instacart/src/components/ProductForm/styles.tsx +1 -1
  27. package/themes/kiosk/src/components/Cart/index.tsx +14 -21
  28. package/themes/kiosk/src/components/CartItem/index.tsx +9 -7
  29. package/themes/kiosk/src/components/CustomerName/index.tsx +2 -1
  30. package/themes/kiosk/src/components/Intro/index.tsx +4 -4
  31. package/themes/kiosk/src/components/OptionCard/index.tsx +11 -6
  32. package/themes/kiosk/src/components/PaymentOptions/index.tsx +46 -44
  33. package/themes/original/index.tsx +4 -0
  34. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -9
  35. package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -2
  36. package/themes/original/src/components/BusinessPreorder/index.tsx +37 -34
  37. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  38. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +35 -0
  39. package/themes/original/src/components/BusinessProductsListing/index.tsx +16 -47
  40. package/themes/original/src/components/Cart/index.tsx +10 -31
  41. package/themes/original/src/components/Checkout/index.tsx +2 -0
  42. package/themes/original/src/components/Checkout/styles.tsx +1 -0
  43. package/themes/original/src/components/DriverTips/index.tsx +3 -3
  44. package/themes/original/src/components/DriverTips/styles.tsx +5 -5
  45. package/themes/original/src/components/FacebookLogin/index.tsx +20 -5
  46. package/themes/original/src/components/Help/index.tsx +1 -1
  47. package/themes/original/src/components/Home/index.tsx +5 -3
  48. package/themes/original/src/components/LoginForm/index.tsx +50 -49
  49. package/themes/original/src/components/MessageListing/index.tsx +4 -2
  50. package/themes/original/src/components/OrderDetails/index.tsx +3 -1
  51. package/themes/original/src/components/OrderSummary/index.tsx +11 -30
  52. package/themes/original/src/components/PaymentOptionWallet/index.tsx +10 -6
  53. package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -0
  54. package/themes/original/src/components/ProductForm/index.tsx +113 -88
  55. package/themes/original/src/components/ProductForm/styles.tsx +10 -3
  56. package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
  57. package/themes/original/src/components/SingleProductCard/index.tsx +22 -13
  58. package/themes/original/src/components/SingleProductCard/styles.tsx +6 -0
  59. package/themes/original/src/components/UpsellingProducts/index.tsx +84 -86
  60. package/themes/original/src/types/index.tsx +7 -1
  61. package/themes/uber-eats/src/components/ProductForm/index.tsx +43 -2
@@ -21,10 +21,10 @@ import { Cart as TypeCart } from '../../types';
21
21
  import CartItem from '../CartItem';
22
22
  import NavBar from '../NavBar';
23
23
  import { CouponControl } from '../CouponControl';
24
- import { LANDSCAPE, PORTRAIT, useDeviceOrientation} from "../../../../../src/hooks/DeviceOrientation";
24
+ import { LANDSCAPE, PORTRAIT, useDeviceOrientation } from "../../../../../src/hooks/DeviceOrientation";
25
25
  import { useCartBottomSheet } from '../../providers/CartBottomSheetProvider';
26
26
  import { Container } from '../../../../../src/layouts/Container';
27
-
27
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
28
28
  const CartUI = (props: any) => {
29
29
  const {
30
30
  cart,
@@ -35,7 +35,7 @@ const CartUI = (props: any) => {
35
35
  removeProduct,
36
36
  setIsCartsLoading,
37
37
  navigation,
38
- } : CartUIProps = props
38
+ }: CartUIProps = props
39
39
 
40
40
  const theme = useTheme()
41
41
  const [, t] = useLanguage()
@@ -83,8 +83,8 @@ const CartUI = (props: any) => {
83
83
 
84
84
  const handleChangeOrderType = () => {
85
85
  navigation.push('DeliveryType', {
86
- callback : () => {navigation.pop(1)},
87
- goBack: () => {navigation.pop(1)},
86
+ callback: () => { navigation.pop(1) },
87
+ goBack: () => { navigation.pop(1) },
88
88
  });
89
89
  }
90
90
 
@@ -97,7 +97,7 @@ const CartUI = (props: any) => {
97
97
  title={t('CONFIRM_YOUR_ORDER', 'Confirm your order')}
98
98
  onActionLeft={goToBack}
99
99
  style={{ height: orientationState?.dimensions?.height * 0.08 }}
100
- btnStyle={{paddingLeft: 0}}
100
+ btnStyle={{ paddingLeft: 0 }}
101
101
  rightComponent={(
102
102
  <OButton
103
103
  text={t('CANCEL_ORDER', 'Cancel order')}
@@ -183,6 +183,7 @@ const CartUI = (props: any) => {
183
183
  </OText>
184
184
  </OSTable>
185
185
  {cart?.discount > 0 && cart?.total >= 0 && orientationState?.orientation == PORTRAIT && (
186
+
186
187
  <OSTable
187
188
  style={{
188
189
  backgroundColor: theme.colors.success,
@@ -197,10 +198,7 @@ const CartUI = (props: any) => {
197
198
  flexDirection: 'row',
198
199
  }}
199
200
  >
200
- <OIcon
201
- src={theme.images.general.check_decagram}
202
- />
203
-
201
+ <AntDesignIcon name='checkcircle' size={24} color='#00D27A' />
204
202
  {cart?.discount_type === 1 ? (
205
203
  <OText
206
204
  mLeft={15}
@@ -219,8 +217,6 @@ const CartUI = (props: any) => {
219
217
  </OText>
220
218
  )}
221
219
  </View>
222
-
223
-
224
220
  <OText
225
221
  size={16}
226
222
  color={theme.colors.green}
@@ -252,9 +248,9 @@ const CartUI = (props: any) => {
252
248
  {cart?.driver_tip_rate > 0 &&
253
249
  parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
254
250
  !!!parseInt(configs?.driver_tip_use_custom?.value, 10) &&
255
- (
256
- `(${parseNumber(cart?.driver_tip_rate)}%)`
257
- )}
251
+ (
252
+ `(${parseNumber(cart?.driver_tip_rate)}%)`
253
+ )}
258
254
  </OText>
259
255
  <OText>{parsePrice(cart?.driver_tip)}</OText>
260
256
  </OSTable>
@@ -294,7 +290,7 @@ const CartUI = (props: any) => {
294
290
  <>
295
291
  <FloatingLayout isIos={Platform.OS === 'ios'}>
296
292
  <CheckoutAction>
297
- <View style={{display: 'flex', flexDirection: 'row'}}>
293
+ <View style={{ display: 'flex', flexDirection: 'row' }}>
298
294
  {cart?.discount > 0 && cart?.total >= 0 && orientationState?.orientation == LANDSCAPE && (
299
295
  <OSTable
300
296
  style={{
@@ -311,10 +307,7 @@ const CartUI = (props: any) => {
311
307
  flexDirection: 'row',
312
308
  }}
313
309
  >
314
- <OIcon
315
- src={theme.images.general.check_decagram}
316
- />
317
-
310
+ <AntDesignIcon name='checkcircle' size={24} color='#00D27A' />
318
311
  {cart?.discount_type === 1 ? (
319
312
  <OText
320
313
  mLeft={15}
@@ -369,7 +362,7 @@ const CartUI = (props: any) => {
369
362
  imgRightSrc={null}
370
363
  textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
371
364
  onClick={() => { navigation?.navigate('CustomerName', { cartUuid: cart?.uuid }) }}
372
- style={{width: '100%', marginTop: 4}}
365
+ style={{ width: '100%', marginTop: 4 }}
373
366
  />
374
367
  </View>
375
368
  </View>
@@ -16,6 +16,7 @@ import { Product } from '../../types';
16
16
  import QuantityControl from '../QuantityControl';
17
17
  import { LANDSCAPE, useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation';
18
18
  import { useTheme } from 'styled-components/native';
19
+ import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome'
19
20
 
20
21
  const CartItem = (props: CartItemProps) => {
21
22
  const theme = useTheme()
@@ -97,7 +98,6 @@ const CartItem = (props: CartItemProps) => {
97
98
  <OButton
98
99
  bgColor="transparent"
99
100
  borderColor="transparent"
100
- imgLeftSrc={theme.images.general.edit}
101
101
  text={t('EDIT', 'Edit')}
102
102
  style={{ justifyContent: 'flex-start', paddingLeft: 0, maxWidth: 80 }}
103
103
  textStyle={{
@@ -105,16 +105,18 @@ const CartItem = (props: CartItemProps) => {
105
105
  marginLeft: 6,
106
106
  }}
107
107
  onClick={() => { onEditProduct ? onEditProduct(product) : null }}
108
+ iconProps={{ name: 'edit' }}
109
+ IconCustom={() => <FontAwesomeIcon name='edit' size={24} color={theme.colors.primary} />}
108
110
  />
109
111
  <OIconButton
110
112
  bgColor="transparent"
111
113
  borderColor="transparent"
112
- RenderIcon={isProductIngredients && (() =>
113
- <EvilIcons
114
- name={isActive ? 'chevron-up': 'chevron-down'}
115
- size={40}
116
- color={theme.colors.primary}
117
- />
114
+ RenderIcon={isProductIngredients && (() =>
115
+ <EvilIcons
116
+ name={isActive ? 'chevron-up' : 'chevron-down'}
117
+ size={40}
118
+ color={theme.colors.primary}
119
+ />
118
120
  )}
119
121
  style={{ justifyContent: 'flex-start', right: 40 }}
120
122
  onClick={() => (!product?.valid_menu && isCartProduct)
@@ -72,12 +72,13 @@ const CustomerName = (props: Props): React.ReactElement => {
72
72
  <OButton
73
73
  text={t('SKIP', 'Skip')}
74
74
  onClick={onProceedToPay}
75
- textStyle={{color: theme.colors.primaryContrast, fontSize: 20}}
75
+ textStyle={{color: theme.colors.primary, fontSize: 20}}
76
76
  parentStyle={{
77
77
  height: orientationState?.orientation === PORTRAIT
78
78
  ? 50 : 100
79
79
  }}
80
80
  style={{
81
+ backgroundColor: theme.colors.white,
81
82
  width: orientationState?.orientation === PORTRAIT
82
83
  ? orientationState?.dimensions.width - 40
83
84
  : orientationState?.dimensions.width * 0.1,
@@ -8,7 +8,7 @@ import OImage from '../../components/shared/OImage';
8
8
  import OButton from '../../components/shared/OButton';
9
9
  import { LanguageSelector } from '../../components/LanguageSelector';
10
10
  import { LogoutPopup } from '../../components/LogoutPopup';
11
- import {PORTRAIT, LANDSCAPE, useDeviceOrientation} from "../../../../../src/hooks/DeviceOrientation";
11
+ import { PORTRAIT, LANDSCAPE, useDeviceOrientation } from "../../../../../src/hooks/DeviceOrientation";
12
12
 
13
13
  const Intro = (props: any): React.ReactElement => {
14
14
  const { navigation } = props;
@@ -87,7 +87,7 @@ const Intro = (props: any): React.ReactElement => {
87
87
  source={theme.images.general.homeHeroLandscape}
88
88
  width={orientationState?.dimensions?.width * 0.40}
89
89
  height={orientationState?.dimensions?.height * 1.1}
90
- style={{bottom: 100, right: 100}}
90
+ style={{ bottom: 100, right: 100 }}
91
91
  resizeMode='cover'
92
92
  />
93
93
 
@@ -114,7 +114,7 @@ const Intro = (props: any): React.ReactElement => {
114
114
 
115
115
  <OButton
116
116
  style={styles.buttonLandStyle}
117
- text={t('TOUCH_TO_ORDER', 'Touch to order')}
117
+ text={t('TOUCH_ANYWHERE_TO_ORDER', 'Touch anywhere to order')}
118
118
  parentStyle={{
119
119
  alignItems: 'center',
120
120
  width: orientationState?.dimensions?.width - _offset
@@ -138,7 +138,7 @@ const Intro = (props: any): React.ReactElement => {
138
138
 
139
139
  const styles = StyleSheet.create({
140
140
  buttonLandStyle: {
141
- width: 260,
141
+ width: 290,
142
142
  marginBottom: 16
143
143
  }
144
144
  });
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { FunctionComponent } from 'react';
2
2
  import { ImageSourcePropType, ImageStyle, TextStyle, ViewStyle, ActivityIndicator } from 'react-native';
3
3
  import { TouchableOpacity } from 'react-native-gesture-handler';
4
4
  import { useTheme } from 'styled-components/native';
@@ -28,11 +28,15 @@ const OptionCard = (props: Props) => {
28
28
  <ActivityIndicator size='large' color='#ffffff' />
29
29
  </ActivityIndicatorContainer>
30
30
  )}
31
- <OIcon
32
- src={props.icon}
33
- style={{ marginBottom: 10, ...props?.iconStyle }}
34
- />
35
-
31
+ {props.icon && (
32
+ <OIcon
33
+ src={props.icon}
34
+ style={{ marginBottom: 10, ...props?.iconStyle }}
35
+ />
36
+ )}
37
+ {props.VectorIcon && (
38
+ <props.VectorIcon />
39
+ )}
36
40
  <OText
37
41
  weight="700"
38
42
  color="white"
@@ -97,6 +101,7 @@ interface Props {
97
101
  callToActionTextStyle?: TextStyle;
98
102
  callToActionIcon?: ImageSourcePropType;
99
103
  callToActionIconStyle?: ImageStyle;
104
+ VectorIcon?: FunctionComponent;
100
105
  }
101
106
 
102
107
  export default OptionCard;
@@ -19,6 +19,8 @@ import Spinner from 'react-native-loading-spinner-overlay';
19
19
  import { LANDSCAPE, PORTRAIT, useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation';
20
20
  import GridContainer from '../../layouts/GridContainer';
21
21
  import { OModal, PaymentOptionStripe } from '../../../../../src';
22
+ import AntIconDesign from 'react-native-vector-icons/AntDesign'
23
+ import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons'
22
24
 
23
25
  const PaymentOptionsUI = (props: any) => {
24
26
  const {
@@ -41,7 +43,7 @@ const PaymentOptionsUI = (props: any) => {
41
43
  } = props;
42
44
 
43
45
  const theme = useTheme();
44
- const [, {showToast}] = useToast();
46
+ const [, { showToast }] = useToast();
45
47
  const [, t] = useLanguage();
46
48
  const [orientationState] = useDeviceOrientation();
47
49
  const [userErrors, setUserErrors] = useState<any>([]);
@@ -134,52 +136,52 @@ const PaymentOptionsUI = (props: any) => {
134
136
  CASH_ID:
135
137
  cashIndex !== -1
136
138
  ? {
137
- style: cardStyle,
138
- title: t('CASH', 'Cash'),
139
- description: t(
140
- 'GO_FOR_YOR_RECEIPT_AND_GO_TO_THE_FRONT_COUNTER',
141
- 'Pay with cash in the front counter',
142
- ),
143
- bgImage: theme.images.general.cash,
144
- icon: theme.images.general.shoppingCart,
145
- callToActionText: t('LETS_GO', 'LETS_GO'),
146
- onClick: () =>
147
- onSelectPaymethod(supportedMethods[cashIndex], false),
148
- ...supportedMethods[cashIndex],
149
- }
139
+ style: cardStyle,
140
+ title: t('CASH', 'Cash'),
141
+ description: t(
142
+ 'GO_FOR_YOR_RECEIPT_AND_GO_TO_THE_FRONT_COUNTER',
143
+ 'Pay with cash in the front counter',
144
+ ),
145
+ bgImage: theme.images.general.cash,
146
+ callToActionText: t('LETS_GO', 'LETS_GO'),
147
+ VectorIcon: () => <AntIconDesign name='shoppingcart' size={28} color='white' style={{ marginBottom: 10 }} />,
148
+ onClick: () =>
149
+ onSelectPaymethod(supportedMethods[cashIndex], false),
150
+ ...supportedMethods[cashIndex],
151
+ }
150
152
  : null,
151
153
 
152
154
  CARD_ON_DELIVERY_ID:
153
155
  cardOnDeliveryIndex !== -1
154
156
  ? {
155
- style: cardStyle,
156
- title: t('CARD', supportedMethods[cardOnDeliveryIndex]?.name),
157
- description: t(
158
- 'WE_ACCEPT_EVERY_DEBIT_OR_CREDIT_CARD',
159
- 'We accept every debit or credit card',
160
- ),
161
- bgImage: theme.images.general.carddelivery,
162
- icon: theme.images.general.pushPin,
163
- callToActionText: t("LETS_GO", "Let's go"),
164
- onClick: () => onSelectPaymethod(supportedMethods[cardOnDeliveryIndex], false),
165
- ...supportedMethods[cardOnDeliveryIndex],
166
- }
157
+ style: cardStyle,
158
+ title: t('CARD', supportedMethods[cardOnDeliveryIndex]?.name),
159
+ description: t(
160
+ 'WE_ACCEPT_EVERY_DEBIT_OR_CREDIT_CARD',
161
+ 'We accept every debit or credit card',
162
+ ),
163
+ bgImage: theme.images.general.carddelivery,
164
+ callToActionText: t("LETS_GO", "Let's go"),
165
+ VectorIcon: () => <MaterialIcon name='pin-outline' size={28} color='white' style={{ marginBottom: 10 }} />,
166
+ onClick: () => onSelectPaymethod(supportedMethods[cardOnDeliveryIndex], false),
167
+ ...supportedMethods[cardOnDeliveryIndex],
168
+ }
167
169
  : null,
168
170
  STRIPE:
169
171
  stripeIndex !== -1
170
172
  ? {
171
- style: cardStyle,
172
- title: t('STRIPE', supportedMethods[stripeIndex]?.name),
173
- description: t('STRIPE', 'Stripe'),
174
- bgImage: theme.images.general.carddelivery,
175
- icon: theme.images.general.pushPin,
176
- callToActionText: t('INSERT_INFO', 'Test info'),
177
- onClick: () => {
178
- onSelectPaymethod(supportedMethods[stripeIndex], false);
179
- setIsOpenModal(true)
180
- },
181
- ...supportedMethods[stripeIndex],
182
- }
173
+ style: cardStyle,
174
+ title: t('STRIPE', supportedMethods[stripeIndex]?.name),
175
+ description: t('STRIPE', 'Stripe'),
176
+ bgImage: theme.images.general.carddelivery,
177
+ callToActionText: t('INSERT_INFO', 'Test info'),
178
+ VectorIcon: () => <MaterialIcon name='pin-outline' size={28} color='white' style={{ marginBottom: 10 }} />,
179
+ onClick: () => {
180
+ onSelectPaymethod(supportedMethods[stripeIndex], false);
181
+ setIsOpenModal(true)
182
+ },
183
+ ...supportedMethods[stripeIndex],
184
+ }
183
185
  : null,
184
186
  };
185
187
 
@@ -193,11 +195,11 @@ const PaymentOptionsUI = (props: any) => {
193
195
  <NavBar
194
196
  title={t('PAYMENT_METHODS', 'Payment methods')}
195
197
  onActionLeft={goToBack}
196
- btnStyle={{paddingLeft: 0}}
198
+ btnStyle={{ paddingLeft: 0 }}
197
199
  />
198
200
 
199
201
  <View
200
- style={{marginVertical: orientationState?.dimensions?.height * 0.03}}>
202
+ style={{ marginVertical: orientationState?.dimensions?.height * 0.03 }}>
201
203
  <OText size={orientationState?.dimensions?.width * 0.048}>
202
204
  {t('HOW_WOULD_YOU', 'How would you')} {'\n'}
203
205
  <OText
@@ -209,10 +211,10 @@ const PaymentOptionsUI = (props: any) => {
209
211
  </View>
210
212
 
211
213
  {supportedMethods?.length > 0 && (
212
- <GridContainer style={{justifyContent: 'space-between'}}>
214
+ <GridContainer style={{ justifyContent: 'space-between' }}>
213
215
  {propsOfItems.CARD_ON_DELIVERY_ID && (
214
- <View style={{marginBottom: orientationState?.orientation === LANDSCAPE ? 20 : 0}}>
215
- <OptionCard {...propsOfItems?.CARD_ON_DELIVERY_ID} styke/>
216
+ <View style={{ marginBottom: orientationState?.orientation === LANDSCAPE ? 20 : 0 }}>
217
+ <OptionCard {...propsOfItems?.CARD_ON_DELIVERY_ID} styke />
216
218
  </View>
217
219
  )}
218
220
 
@@ -249,7 +251,7 @@ const PaymentOptionsUI = (props: any) => {
249
251
  )}
250
252
  </GridContainer>
251
253
  )}
252
- <View style={{height: orientationState?.dimensions?.height * 0.05}} />
254
+ <View style={{ height: orientationState?.dimensions?.height * 0.05 }} />
253
255
  <OModal
254
256
  open={isOpenModal}
255
257
  onClose={() => setIsOpenModal(false)}
@@ -30,6 +30,8 @@ import { NotFoundSource } from './src/components/NotFoundSource';
30
30
  import { OrderTypeSelector } from './src/components/OrderTypeSelector';
31
31
  import { Wallets } from './src/components/Wallets';
32
32
  import { PaymentOptionWallet } from './src/components/PaymentOptionWallet';
33
+ import { ProductForm } from './src/components/ProductForm';
34
+ import { UpsellingProducts } from './src/components/UpsellingProducts';
33
35
 
34
36
  import { Toast } from './src/components/shared/OToast';
35
37
  import {
@@ -90,6 +92,8 @@ export {
90
92
  OrderTypeSelector,
91
93
  Wallets,
92
94
  PaymentOptionWallet,
95
+ ProductForm,
96
+ UpsellingProducts,
93
97
 
94
98
  // OComponents
95
99
  Toast,
@@ -139,17 +139,20 @@ export const BusinessItemAccordion = (props: any) => {
139
139
  )}
140
140
  </BIActions>
141
141
  </BIHeader>
142
- {!isActive && !isClosed && !!isProducts && !checkoutButtonDisabled && (
142
+ {!isActive && !isClosed && !!isProducts && (
143
143
  <PriceContainer>
144
144
  <OText>{parsePrice(cart?.total)}</OText>
145
- <OButton
146
- onClick={handleClickCheckout}
147
- textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
148
- style={{ width: 160, flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
149
- text={t('CHECKOUT', 'Checkout')}
150
- bgColor={(cart?.subtotal < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
151
- borderColor={theme.colors.primary}
152
- />
145
+ {cart?.valid_products && (
146
+ <OButton
147
+ onClick={handleClickCheckout}
148
+ textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
149
+ style={{ width: 160, flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
150
+ text={t('CHECKOUT', 'Checkout')}
151
+ bgColor={(cart?.subtotal < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
152
+ borderColor={theme.colors.primary}
153
+ isDisabled={checkoutButtonDisabled}
154
+ />
155
+ )}
153
156
  </PriceContainer>
154
157
  )}
155
158
 
@@ -7,9 +7,10 @@ export const BIContainer = styled.View`
7
7
  opacity: 1;
8
8
  border-radius: 7.6px;
9
9
  overflow: hidden;
10
-
10
+ min-height: 120px;
11
11
  ${(props: any) => props.isClosed && css`
12
- opacity: 0.5;
12
+ opacity: 0.5;
13
+ min-height: 60px;
13
14
  `}
14
15
  `
15
16
 
@@ -46,7 +46,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
46
46
  const [menu, setMenu] = useState({})
47
47
  const [timeList, setTimeList] = useState<any>([])
48
48
  const [selectDate, setSelectedDate] = useState<any>(null)
49
- const [datesWhitelist, setDateWhitelist] = useState<any>([{start: null, end: null}])
49
+ const [datesWhitelist, setDateWhitelist] = useState<any>([{ start: null, end: null }])
50
50
 
51
51
  const styles = StyleSheet.create({
52
52
  container: {
@@ -54,19 +54,19 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
54
54
  paddingVertical: 30,
55
55
  paddingHorizontal: 40
56
56
  },
57
- businessLogo: {
58
- backgroundColor: 'white',
59
- width: 60,
60
- height: 60,
61
- borderRadius: 7.6,
62
- justifyContent: 'center',
63
- alignItems: 'center',
64
- shadowColor: '#000000',
65
- shadowOffset: { width: 0, height: 1 },
66
- shadowOpacity: 0.1,
67
- shadowRadius: 1,
68
- elevation: 2
69
- },
57
+ businessLogo: {
58
+ backgroundColor: 'white',
59
+ width: 60,
60
+ height: 60,
61
+ borderRadius: 7.6,
62
+ justifyContent: 'center',
63
+ alignItems: 'center',
64
+ shadowColor: '#000000',
65
+ shadowOffset: { width: 0, height: 1 },
66
+ shadowOpacity: 0.1,
67
+ shadowRadius: 1,
68
+ elevation: 2
69
+ },
70
70
  selectOption: {
71
71
  backgroundColor: theme.colors.backgroundGray100,
72
72
  borderRadius: 7.6,
@@ -82,7 +82,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
82
82
  paddingBottom: 15,
83
83
  borderBottomWidth: 1,
84
84
  borderColor: theme.colors.backgroundGray200,
85
- height: 90
85
+ height: 100,
86
86
  },
87
87
  calendarHeaderContainer: {
88
88
  flex: 1,
@@ -101,35 +101,36 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
101
101
  dateNumber: {
102
102
  color: '#B1BCCC',
103
103
  fontSize: 16,
104
- fontWeight: '500'
104
+ fontWeight: '500',
105
105
  },
106
106
  dateName: {
107
107
  color: '#B1BCCC',
108
108
  fontSize: 12,
109
- textTransform: 'capitalize'
109
+ textTransform: 'capitalize',
110
110
  },
111
111
  highlightDateName: {
112
112
  color: '#344050',
113
113
  fontSize: 12,
114
- textTransform: 'capitalize'
114
+ textTransform: 'capitalize',
115
115
  },
116
116
  highlightDateNumber: {
117
117
  color: '#344050',
118
118
  fontSize: 16,
119
- textTransform: 'capitalize'
119
+ textTransform: 'capitalize',
120
120
  },
121
121
  disabledDateName: {
122
122
  color: '#B1BCCC',
123
123
  fontSize: 10,
124
124
  textTransform: 'capitalize',
125
- opacity: 1
125
+ opacity: 1,
126
126
  },
127
127
  disabledDateNumber: {
128
128
  color: '#B1BCCC',
129
129
  fontSize: 14,
130
- fontWeight: '500'
130
+ fontWeight: '500',
131
+
131
132
  }
132
- })
133
+ })
133
134
 
134
135
  const preorderTypeList = [
135
136
  { key: 'business_hours', name: t('BUSINESS_HOURS', 'Business hours') },
@@ -191,7 +192,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
191
192
 
192
193
  const LeftSelector = () => {
193
194
  return (
194
- <View style={{height: '100%', justifyContent: 'flex-end'}}>
195
+ <View style={{ height: '100%', justifyContent: 'flex-end' }}>
195
196
  <IconAntDesign
196
197
  name='caretleft'
197
198
  color={theme.colors.textNormal}
@@ -203,7 +204,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
203
204
 
204
205
  const RightSelector = () => {
205
206
  return (
206
- <View style={{height: '100%', justifyContent: 'flex-end'}}>
207
+ <View style={{ height: '100%', justifyContent: 'flex-end' }}>
207
208
  <IconAntDesign
208
209
  name='caretright'
209
210
  color={theme.colors.textNormal}
@@ -280,7 +281,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
280
281
  name='close'
281
282
  color={theme.colors.textThird}
282
283
  size={24}
283
- style={{ marginLeft: -4}}
284
+ style={{ marginLeft: -4 }}
284
285
  />
285
286
  </TouchableOpacity>
286
287
  <BusinessInfoWrapper>
@@ -294,8 +295,8 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
294
295
  <FastImage
295
296
  style={{ width: 59, height: 59 }}
296
297
  source={{
297
- uri: optimizeImage(business?.logo, 'h_60,c_limit'),
298
- priority: FastImage.priority.normal,
298
+ uri: optimizeImage(business?.logo, 'h_60,c_limit'),
299
+ priority: FastImage.priority.normal,
299
300
  }}
300
301
  resizeMode={FastImage.resizeMode.cover}
301
302
  />
@@ -372,7 +373,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
372
373
  setMenu={setMenu}
373
374
  menu={menu}
374
375
  />
375
- </MenuWrapper>
376
+ </MenuWrapper>
376
377
  )}
377
378
  <OrderTimeWrapper>
378
379
  <OText
@@ -393,11 +394,13 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
393
394
  calendarHeaderStyle={styles.calendarHeader}
394
395
  dateNumberStyle={styles.dateNumber}
395
396
  dateNameStyle={styles.dateName}
396
- iconContainer={{flex: 0.1}}
397
+ iconContainer={{ flex: 0.1 }}
397
398
  highlightDateNameStyle={styles.highlightDateName}
398
399
  highlightDateNumberStyle={styles.highlightDateNumber}
400
+ dayContainerStyle={{ height: '100%' }}
401
+ highlightDateContainerStyle={{ height: '100%' }}
399
402
  calendarHeaderFormat='MMMM, YYYY'
400
- iconStyle={{borderWidth: 1}}
403
+ iconStyle={{ borderWidth: 1 }}
401
404
  selectedDate={selectDate}
402
405
  datesWhitelist={datesWhitelist}
403
406
  disabledDateNameStyle={styles.disabledDateName}
@@ -416,7 +419,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
416
419
  <TimeItem active={timeSelected === time.value}>
417
420
  <OText
418
421
  size={14}
419
- color={timeSelected === time.value ? theme.colors.primary: theme.colors.textNormal}
422
+ color={timeSelected === time.value ? theme.colors.primary : theme.colors.textNormal}
420
423
  style={{
421
424
  lineHeight: 24
422
425
  }}
@@ -425,15 +428,15 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
425
428
  </TouchableOpacity>
426
429
  ))}
427
430
  {timeList.length % 3 === 2 && (
428
- <TimeItem style={{backgroundColor: 'transparent'}}/>
431
+ <TimeItem style={{ backgroundColor: 'transparent' }} />
429
432
  )}
430
433
  </TimeContentWrapper>
431
434
  </TimeListWrapper>
432
435
  </OrderTimeWrapper>
433
436
  <OButton
434
437
  text={t('GO_TO_MENU', 'Go to menu')}
435
- textStyle={{color: 'white'}}
436
- style={{borderRadius: 7.6, marginBottom: 20, marginTop: 30}}
438
+ textStyle={{ color: 'white' }}
439
+ style={{ borderRadius: 7.6, marginBottom: 20, marginTop: 30 }}
437
440
  onClick={() => handleClickBusiness()}
438
441
  />
439
442
  </PreOrderContainer>
@@ -49,7 +49,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
49
49
  product={product}
50
50
  businessId={businessId}
51
51
  onProductClick={() => onProductClick(product)}
52
- productAddedToCart={currentCart?.products?.find((Cproduct: any) => Cproduct.id === product.id)}
52
+ productAddedToCartLength={currentCart?.products?.reduce((productsLength: number, Cproduct: any) => { return productsLength + (Cproduct?.id === product?.id ? Cproduct?.quantity : 0) }, 0)}
53
53
  />
54
54
  ))}
55
55
 
@@ -72,7 +72,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
72
72
  product={product}
73
73
  businessId={businessId}
74
74
  onProductClick={onProductClick}
75
- productAddedToCart={currentCart?.products?.find((Cproduct: any) => Cproduct.id === product.id)}
75
+ productAddedToCartLength={currentCart?.products?.reduce((productsLength: number, Cproduct: any) => { return productsLength + (Cproduct?.id === product?.id ? Cproduct?.quantity : 0) }, 0)}
76
76
  />
77
77
  ),
78
78
  )}
@@ -117,7 +117,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
117
117
  businessId={businessId}
118
118
  product={product}
119
119
  onProductClick={onProductClick}
120
- productAddedToCart={currentCart?.products?.find((Cproduct: any) => Cproduct.id === product.id)}
120
+ productAddedToCartLength={currentCart?.products?.reduce((productsLength: number, Cproduct: any) => { return productsLength + (Cproduct?.id === product?.id ? Cproduct?.quantity : 0) }, 0)}
121
121
  />
122
122
  ))}
123
123
  </>