ordering-ui-react-native 0.15.30 → 0.15.33

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 (31) hide show
  1. package/package.json +1 -1
  2. package/themes/business/src/components/OrdersOption/index.tsx +1 -1
  3. package/themes/business/src/components/PreviousOrders/index.tsx +8 -3
  4. package/themes/kiosk/src/components/Cart/index.tsx +1 -1
  5. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
  6. package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
  7. package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
  8. package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
  9. package/themes/kiosk/src/components/CustomerName/index.tsx +7 -2
  10. package/themes/kiosk/src/components/Intro/index.tsx +1 -1
  11. package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
  12. package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
  13. package/themes/kiosk/src/components/ProductForm/index.tsx +172 -123
  14. package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
  15. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
  16. package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
  17. package/themes/original/src/components/BusinessController/index.tsx +25 -17
  18. package/themes/original/src/components/BusinessProductsList/index.tsx +1 -1
  19. package/themes/original/src/components/BusinessProductsListing/index.tsx +1 -0
  20. package/themes/original/src/components/BusinessesListing/index.tsx +16 -30
  21. package/themes/original/src/components/Checkout/index.tsx +2 -2
  22. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +97 -89
  23. package/themes/original/src/components/Messages/index.tsx +28 -24
  24. package/themes/original/src/components/OrderProgress/index.tsx +1 -1
  25. package/themes/original/src/components/OrdersOption/index.tsx +2 -2
  26. package/themes/original/src/components/PreviousOrders/index.tsx +1 -1
  27. package/themes/original/src/components/ProductForm/styles.tsx +2 -1
  28. package/themes/original/src/components/ReviewOrder/index.tsx +10 -9
  29. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  30. package/themes/original/src/components/UserProfile/index.tsx +4 -6
  31. package/themes/original/src/types/index.tsx +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.15.30",
3
+ "version": "0.15.33",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -541,7 +541,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
541
541
  </TabsContainer>
542
542
  </ScrollView>
543
543
  </FiltersTab>
544
- <View style={{ flex: 1, minHeight: HEIGHT_SCREEN - 250 }}>
544
+ <View style={{ flex: 1, minHeight: HEIGHT_SCREEN - 450 }}>
545
545
  {currentTabSelected !== 'logisticOrders' && (
546
546
  <View
547
547
  style={{
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { StyleSheet, TouchableOpacity, View } from 'react-native';
2
+ import { StyleSheet, TouchableOpacity, View, Platform, PlatformIOSStatic } from 'react-native';
3
3
  import { useTheme } from 'styled-components/native';
4
4
  import moment from 'moment'
5
5
  import { useLanguage, useUtils } from 'ordering-components/native';
@@ -9,6 +9,7 @@ import {
9
9
  } from './styles';
10
10
  import EntypoIcon from 'react-native-vector-icons/Entypo'
11
11
  import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
12
+ import DeviceInfo from 'react-native-device-info';
12
13
 
13
14
  const { useDeviceOrientation, PORTRAIT } = DeviceOrientationMethods
14
15
 
@@ -32,6 +33,10 @@ export const PreviousOrders = (props: any) => {
32
33
 
33
34
  const IS_PORTRAIT = orientationState.orientation === PORTRAIT
34
35
 
36
+ const platformIOS = Platform as PlatformIOSStatic
37
+ const isIpad = platformIOS.isPad
38
+ const isTablet = DeviceInfo.isTablet();
39
+
35
40
  const handlePressOrder = (order: any) => {
36
41
  if (order?.locked && isLogisticOrder) return
37
42
  handleClickOrder && handleClickOrder(order)
@@ -46,8 +51,8 @@ export const PreviousOrders = (props: any) => {
46
51
  const styles = StyleSheet.create({
47
52
  cardButton: {
48
53
  flex: 1,
49
- paddingVertical: 20,
50
- marginBottom: IS_PORTRAIT ? 20 : 0,
54
+ paddingVertical: (isIpad || isTablet) ? 20 : 0,
55
+ marginBottom: IS_PORTRAIT ? 25 : 0,
51
56
  marginLeft: 3,
52
57
  },
53
58
  icon: {
@@ -379,7 +379,7 @@ const CartUI = (props: any) => {
379
379
  <ProductForm
380
380
  productCart={curProduct}
381
381
  businessSlug={cart?.business?.slug}
382
- businessId={curProduct?.business_id}
382
+ businessId={cart?.business_id}
383
383
  categoryId={curProduct?.category_id}
384
384
  productId={curProduct?.id}
385
385
  onSave={handlerProductAction}
@@ -179,7 +179,7 @@ const CartBottomSheetUI = (props: CartBottomSheetUIProps): React.ReactElement |
179
179
  <ProductForm
180
180
  productCart={curProduct}
181
181
  businessSlug={cart?.business?.slug}
182
- businessId={curProduct?.business_id}
182
+ businessId={cart?.business_id}
183
183
  categoryId={curProduct?.category_id}
184
184
  productId={curProduct?.id}
185
185
  onSave={handlerProductAction}
@@ -5,7 +5,7 @@ export const StyledContainer = styled.ScrollView`
5
5
  zIndex: 1000;
6
6
  width: 100%;
7
7
  background-color: #fff;
8
- padding: 20px 20px 20px 0px;
8
+ padding: 20px 0 0;
9
9
  bottom: 0;
10
10
  shadow-color: #000;
11
11
  shadow-opacity: 0.4;
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { useLanguage } from 'ordering-components/native';
3
-
3
+ import { useCartBottomSheet } from '../../providers/CartBottomSheetProvider';
4
4
  import { CCNotCarts } from './styles';
5
5
 
6
6
  import { Cart } from '../Cart';
@@ -22,6 +22,7 @@ export const CartContent = (props: any) => {
22
22
 
23
23
  const [, t] = useLanguage()
24
24
  const [isCartsLoading, setIsCartsLoading] = useState(false)
25
+ const [, { hideCartBottomSheet }] = useCartBottomSheet();
25
26
 
26
27
  const cartProps = {
27
28
  navigation,
@@ -33,6 +34,15 @@ export const CartContent = (props: any) => {
33
34
  resetInactivityTimeout,
34
35
  }
35
36
 
37
+ useEffect(() => {
38
+ if (!cart && showNotFound) {
39
+ navigation?.canGoBack()
40
+ ? navigation.goBack()
41
+ : props.onNavigationRedirect && props.onNavigationRedirect('Business')
42
+ hideCartBottomSheet()
43
+ }
44
+ }, [cart])
45
+
36
46
  const content = (
37
47
  <>
38
48
  {(isOrderStateCarts && cart) && (
@@ -46,13 +56,13 @@ export const CartContent = (props: any) => {
46
56
  }
47
57
  </>
48
58
  )}
49
- {(!cart && showNotFound) && (
59
+ {/* {(!cart && showNotFound) && (
50
60
  <CCNotCarts>
51
61
  <OText size={24} style={{ textAlign: 'center' }}>
52
62
  {t('CARTS_NOT_FOUND', 'You don\'t have carts available')}
53
63
  </OText>
54
64
  </CCNotCarts>
55
- )}
65
+ )} */}
56
66
  <Spinner visible={isCartsLoading} />
57
67
  </>
58
68
  )
@@ -1,6 +1,7 @@
1
1
  import React, { useState } from 'react';
2
- import { View, Animated, TouchableOpacity } from 'react-native';
2
+ import { View, Animated, TouchableOpacity, ImageBackground } from 'react-native';
3
3
  import { useLanguage, useUtils } from 'ordering-components/native';
4
+ import FastImage from 'react-native-fast-image'
4
5
 
5
6
  import {
6
7
  StyledCartItem,
@@ -70,13 +71,24 @@ const CartItem = (props: CartItemProps) => {
70
71
  >
71
72
  <StyledCartItem>
72
73
  <View style={{ flexDirection: 'row' }}>
73
- <OImage
74
- source={{ uri: product?.images || '' }}
75
- height={60}
76
- width={60}
77
- resizeMode="cover"
78
- borderRadius={6}
79
- />
74
+ {product?.images ? (
75
+ <FastImage
76
+ style={{ height: 60, width: 80, borderRadius: 6 }}
77
+ source={{
78
+ uri: product?.images,
79
+ priority: FastImage.priority.normal,
80
+ // cache:FastImage.cacheControl.web
81
+ }}
82
+ resizeMode={FastImage.resizeMode.cover}
83
+ />
84
+ ) : (
85
+ <ImageBackground
86
+ style={{ height: 60, width: 80, borderRadius: 6 }}
87
+ source={theme.images.dummies.product}
88
+ imageStyle={{ borderRadius: 6 }}
89
+ resizeMode='cover'
90
+ />
91
+ )}
80
92
 
81
93
  <View style={{ flexDirection: 'column', justifyContent: 'space-evenly', marginHorizontal: 15, marginTop: 10 }}>
82
94
  <View>
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import { useLanguage, ToastType, useToast } from 'ordering-components/native';
3
- import { _setStoreData } from '../../../../../src/providers/StoreUtil';
3
+ import { _setStoreData, _removeStoreData } from '../../../../../src/providers/StoreUtil';
4
4
 
5
5
  import { OButton, OInput, OText } from '../shared';
6
6
  import { useForm, Controller } from 'react-hook-form';
@@ -28,6 +28,11 @@ const CustomerName = (props: Props): React.ReactElement => {
28
28
  onProceedToPay()
29
29
  };
30
30
 
31
+ const onSkip = () => {
32
+ _removeStoreData('customer_name')
33
+ onProceedToPay()
34
+ }
35
+
31
36
  const styles = StyleSheet.create({
32
37
  inputStyle: {
33
38
  borderRadius: 4,
@@ -75,7 +80,7 @@ const CustomerName = (props: Props): React.ReactElement => {
75
80
  <View style={{ flex: 1, alignItems: 'center' }}>
76
81
  <OButton
77
82
  text={t('SKIP', 'Skip')}
78
- onClick={onProceedToPay}
83
+ onClick={onSkip}
79
84
  textStyle={{ color: theme.colors.primary, fontSize: 20 }}
80
85
  parentStyle={{
81
86
  height: orientationState?.orientation === PORTRAIT
@@ -140,7 +140,7 @@ const Intro = (props: any): React.ReactElement => {
140
140
 
141
141
  const styles = StyleSheet.create({
142
142
  buttonLandStyle: {
143
- width: 290,
143
+ minWidth: 130,
144
144
  marginBottom: 16
145
145
  }
146
146
  });
@@ -212,7 +212,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
212
212
  setCustomerName(name)
213
213
  } catch (e) {
214
214
  if (e) {
215
- setCustomerName('')
215
+ setCustomerName(null)
216
216
  }
217
217
  }
218
218
  }
@@ -553,7 +553,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
553
553
  size={orientationState?.dimensions?.width * 0.048}
554
554
  weight="700"
555
555
  >
556
- {`${t('HUNGRY', 'hungry')}, ${customerName}`}
556
+ {t('HUNGRY', 'hungry')}{!!customerName && `, ${customerName}`}
557
557
  </OText>
558
558
  </OText>
559
559
 
@@ -169,7 +169,7 @@ const OrderSummaryUI = (props: any) => {
169
169
  isCartProduct
170
170
  productCart={curProduct}
171
171
  businessSlug={cart?.business?.slug}
172
- businessId={curProduct?.business_id}
172
+ businessId={cart?.business_id}
173
173
  categoryId={curProduct?.category_id}
174
174
  productId={curProduct?.id}
175
175
  onSave={handlerProductAction}
@@ -1,4 +1,5 @@
1
1
  import React, { useState } from 'react'
2
+ import FastImage from 'react-native-fast-image'
2
3
  import {
3
4
  View,
4
5
  TouchableOpacity,
@@ -69,7 +70,7 @@ export const ProductOptionsUI = (props: any) => {
69
70
 
70
71
  const { product, loading, error } = productObject;
71
72
 
72
- const HEADER_EXPANDED_HEIGHT = Platform.OS === 'ios' ? orientationState?.dimensions?.height * 0.65 : orientationState?.dimensions?.height * 0.4;
73
+ const HEADER_EXPANDED_HEIGHT = orientationState?.dimensions?.height * 0.4;
73
74
  const HEADER_COLLAPSED_HEIGHT = orientationState?.dimensions?.height * 0.2;
74
75
 
75
76
  const isError = (id: number) => {
@@ -203,7 +204,6 @@ export const ProductOptionsUI = (props: any) => {
203
204
  },
204
205
  scrollContainer: {
205
206
  padding: 16,
206
- paddingTop: HEADER_EXPANDED_HEIGHT
207
207
  },
208
208
  header: {
209
209
  backgroundColor: '#fff',
@@ -225,6 +225,10 @@ export const ProductOptionsUI = (props: any) => {
225
225
  shadowOpacity: 0.4,
226
226
  shadowRadius: 3,
227
227
  elevation: 5,
228
+ },
229
+ imageStyle: {
230
+ width: '100%',
231
+ height: HEADER_EXPANDED_HEIGHT,
228
232
  }
229
233
  });
230
234
 
@@ -232,118 +236,173 @@ export const ProductOptionsUI = (props: any) => {
232
236
  <>
233
237
  <ScrollView
234
238
  style={styles.mainContainer}
235
- contentContainerStyle={styles.scrollContainer}
236
239
  onScroll={Animated.event(
237
240
  [{ nativeEvent: { contentOffset: { y: scrollY } } }],
238
241
  { useNativeDriver: false })
239
242
  }
240
243
  scrollEventThrottle={16}
241
244
  >
242
- <Animated.View style={[styles.header, { height: headerHeight }]}>
243
- {!isDrawer && (<Animated.View style={{ opacity: navBar1ContainerOpacity }}>
244
- <NavBar
245
- {...navBarProps}
246
- titleColor={theme.colors.white}
247
- btnStyle={{
248
- width: 55,
249
- height: 55,
250
- overflow: 'scroll',
251
- backgroundColor: 'black',
252
- borderRadius: 100,
253
- color: 'white',
254
- opacity: 0.8,
255
- left: 20,
256
- }}
257
- />
258
- </Animated.View>
259
- )}
260
- <Animated.View style={{ opacity: navBar2ContainerOpacity, position: 'absolute' }}>
261
- <NavBar
262
- {...navBarProps}
263
- btnStyle={{
264
- width: 55,
265
- height: 55,
266
- backgroundColor: 'transparent',
267
- borderRadius: 100,
268
- left: 20,
269
- }}
270
- />
271
- </Animated.View>
245
+ {!isDrawer ? (
246
+ <Animated.View style={[styles.header, { height: headerHeight }]}>
247
+ {!isDrawer && (
248
+ <Animated.View style={{ opacity: navBar1ContainerOpacity }}>
249
+ <NavBar
250
+ {...navBarProps}
251
+ titleColor={theme.colors.white}
252
+ btnStyle={{
253
+ width: 55,
254
+ height: 55,
255
+ overflow: 'scroll',
256
+ backgroundColor: 'black',
257
+ borderRadius: 100,
258
+ color: 'white',
259
+ opacity: 0.8,
260
+ left: 20,
261
+ }}
262
+ />
263
+ </Animated.View>
264
+ )}
265
+ <Animated.View style={{ opacity: navBar2ContainerOpacity, position: 'absolute' }}>
266
+ <NavBar
267
+ {...navBarProps}
268
+ btnStyle={{
269
+ width: 55,
270
+ height: 55,
271
+ backgroundColor: 'transparent',
272
+ borderRadius: 100,
273
+ left: 20,
274
+ }}
275
+ />
276
+ </Animated.View>
272
277
 
273
- <Animated.View style={{
274
- backgroundColor: 'white',
275
- width: orientationState?.dimensions?.width,
276
- opacity: collapsedBarContainerOpacity,
277
- }}>
278
- <View
279
- style={{
280
- flexDirection: 'row',
281
- alignItems: 'center',
282
- padding: 20,
283
- paddingTop: 0,
284
- paddingBottom: 10
285
- }}
286
- >
287
- <OImage
288
- source={{ uri: product?.images }}
289
- width={70}
290
- height={70}
291
- resizeMode="cover"
292
- borderRadius={6}
278
+ <Animated.View style={{
279
+ backgroundColor: 'white',
280
+ width: orientationState?.dimensions?.width,
281
+ opacity: collapsedBarContainerOpacity,
282
+ }}>
283
+ <View
284
+ style={{
285
+ flexDirection: 'row',
286
+ alignItems: 'center',
287
+ padding: 20,
288
+ paddingTop: 0,
289
+ paddingBottom: 10
290
+ }}
291
+ >
292
+ {product?.images ? (
293
+ <FastImage
294
+ style={{ height: 70, width: 70, borderRadius: 6 }}
295
+ source={{
296
+ uri: product?.images,
297
+ priority: FastImage.priority.normal,
298
+ // cache:FastImage.cacheControl.web
299
+ }}
300
+ resizeMode={FastImage.resizeMode.cover}
301
+ />
302
+ ) : (
303
+ <ImageBackground
304
+ style={{ height: 70, width: 70, borderRadius: 6 }}
305
+ source={theme.images.dummies.product}
306
+ imageStyle={{ borderRadius: 6 }}
307
+ resizeMode='cover'
308
+ />
309
+ )}
310
+ <OText
311
+ size={orientationState?.dimensions?.width * 0.025}
312
+ weight="bold"
313
+ mLeft={20}
314
+ numberOfLines={2}
315
+ >
316
+ {product?.name}
317
+ </OText>
318
+ </View>
319
+ <View
320
+ style={{
321
+ position: 'absolute',
322
+ bottom: -2,
323
+ height: 1,
324
+ backgroundColor: 'white',
325
+ width: orientationState?.dimensions?.width,
326
+ ...styles.shadow,
327
+ }}
293
328
  />
294
- <OText
295
- size={orientationState?.dimensions?.width * 0.025}
296
- weight="bold"
297
- mLeft={20}
298
- numberOfLines={2}
329
+ </Animated.View>
330
+
331
+ <Animated.View style={{
332
+ opacity: heroContainerOpacity,
333
+ position: 'absolute',
334
+ zIndex: -100,
335
+ transform: [{ translateY: heroTranslateY }],
336
+ }}>
337
+ <View
338
+ style={{
339
+ width: orientationState?.dimensions?.width,
340
+ height: HEADER_EXPANDED_HEIGHT,
341
+ position: 'absolute',
342
+ zIndex: 1,
343
+ backgroundColor: 'rgba(24, 28, 50, 0.4)',
344
+ }}
299
345
  >
300
- {product?.name}
301
- </OText>
302
- </View>
303
- <View
304
- style={{
305
- position: 'absolute',
306
- bottom: -2,
307
- height: 1,
308
- backgroundColor: 'white',
309
- width: orientationState?.dimensions?.width,
310
- ...styles.shadow,
311
- }}
312
- />
346
+ {product?.images ? (
347
+ <FastImage
348
+ style={{ flex: 1, justifyContent: 'center' }}
349
+ source={{
350
+ uri: product?.images,
351
+ priority: FastImage.priority.normal,
352
+ // cache:FastImage.cacheControl.web
353
+ }}
354
+ resizeMode={FastImage.resizeMode.cover}
355
+ />
356
+ ) : (
357
+ <ImageBackground
358
+ style={{ flex: 1, justifyContent: 'center' }}
359
+ source={theme.images.dummies.product}
360
+ resizeMode='cover'
361
+ />
362
+ )}
363
+ </View>
364
+ </Animated.View>
313
365
  </Animated.View>
314
-
315
- <Animated.View style={{
316
- opacity: heroContainerOpacity,
317
- position: 'absolute',
318
- zIndex: -100,
319
- transform: [{ translateY: heroTranslateY }],
320
- }}>
321
- <View
366
+ ) : (
367
+ <View style={{...styles.imageStyle}}>
368
+ <Animated.View
322
369
  style={{
323
- width: orientationState?.dimensions?.width,
324
- height: HEADER_EXPANDED_HEIGHT,
370
+ ...styles.imageStyle,
371
+ opacity: heroContainerOpacity,
325
372
  position: 'absolute',
326
- zIndex: 1,
327
- backgroundColor: 'rgba(24, 28, 50, 0.4)',
373
+ zIndex: -100,
374
+ transform: [{ translateY: heroTranslateY }],
328
375
  }}
329
376
  >
330
- <ImageBackground source={{ uri: product?.images }} resizeMode='cover' style={{ flex: 1, justifyContent: 'center' }} />
377
+ <View style={styles.imageStyle}>
378
+ {product?.images ? (
379
+ <FastImage
380
+ style={{ flex: 1 }}
381
+ source={{
382
+ uri: product?.images,
383
+ priority: FastImage.priority.normal,
384
+ // cache:FastImage.cacheControl.web
385
+ }}
386
+ resizeMode={FastImage.resizeMode.cover}
387
+ />
388
+ ) : (
389
+ <ImageBackground
390
+ style={{ flex: 1, justifyContent: 'center' }}
391
+ source={theme.images.dummies.product}
392
+ resizeMode='cover'
393
+ />
394
+ )}
395
+ </View>
396
+ </Animated.View>
397
+ </View>
398
+ )}
331
399
 
332
- </View>
333
400
 
334
- <Animated.View
335
- style={{
336
- transform: [{ translateY: heroTranslateY }],
337
- width: orientationState?.dimensions?.width * 0.75,
338
- height: HEADER_EXPANDED_HEIGHT / 2,
339
- position: 'relative',
340
- top: HEADER_EXPANDED_HEIGHT / 3,
341
- zIndex: 100,
342
- padding: 20,
343
- }}
344
- >
401
+ {!loading && !error && product && (
402
+ <View style={{ paddingTop: isDrawer ? 20 : HEADER_EXPANDED_HEIGHT, paddingBottom: 80, paddingHorizontal: 16 }}>
403
+ <WrapContent isDrawer={isDrawer}>
345
404
  <OText
346
- color={theme.colors.white}
405
+ style={{ marginTop: 20 }}
347
406
  size={orientationState?.dimensions?.width * 0.038}
348
407
  weight="bold"
349
408
  mBottom={10}
@@ -352,33 +411,23 @@ export const ProductOptionsUI = (props: any) => {
352
411
  {product?.name || productCart?.name}
353
412
  </OText>
354
413
 
355
- <OText
356
- color={theme.colors.white}
357
- numberOfLines={4}
358
- >
359
- {product?.description || productCart?.description}
360
- </OText>
361
- </Animated.View>
362
- </Animated.View>
363
- </Animated.View>
414
+ {(product?.description || productCart?.description) && (
415
+ <OText
416
+ numberOfLines={4}
417
+ >
418
+ {product?.description || productCart?.description}
419
+ </OText>
420
+ )}
421
+
422
+ {((product?.sku && product?.sku !== '-1' && product?.sku !== '1') ||
423
+ (productCart?.sku && productCart?.sku !== '-1' && productCart?.sku !== '1')
424
+ ) && (
425
+ <ProductDescription>
426
+ <OText size={20}>{t('SKU', 'Sku')}</OText>
427
+ <OText>{product?.sku || productCart?.sku}</OText>
428
+ </ProductDescription>
429
+ )}
364
430
 
365
- {/* {!isFromCheckout && (
366
- <Spinner visible={loading} />
367
- )} */}
368
- {!loading && !error && product && (
369
- <View style={{ paddingTop: isDrawer ? 10 : 20, paddingBottom: 80 }}>
370
- <WrapContent isDrawer={isDrawer}>
371
- <ProductDescription>
372
- {(
373
- (product?.sku && product?.sku !== '-1' && product?.sku !== '1') ||
374
- (productCart?.sku && productCart?.sku !== '-1' && productCart?.sku !== '1')
375
- ) && (
376
- <>
377
- <OText size={20}>{t('SKU', 'Sku')}</OText>
378
- <OText>{product?.sku || productCart?.sku}</OText>
379
- </>
380
- )}
381
- </ProductDescription>
382
431
  <ProductEditions>
383
432
  {product?.ingredients.length > 0 && (
384
433
  <View style={styles.optionContainer}>
@@ -40,7 +40,7 @@ export const ProductTitle = styled.View`
40
40
  `
41
41
 
42
42
  export const ProductDescription = styled.View`
43
- margin-bottom: 30px;
43
+ margin-top: 10px;
44
44
  `
45
45
 
46
46
  export const ProductEditions = styled.View`
@@ -32,6 +32,7 @@ const ProductOptionUI = (props: any) => {
32
32
  <OText
33
33
  size={26}
34
34
  weight="bold"
35
+ style={{ width: '80%' }}
35
36
  >
36
37
  {option.name}
37
38
  </OText>
@@ -12,4 +12,5 @@ export const WrapHeader = styled.View`
12
12
  background-color: ${(props: any) => props.theme.colors.paleGray};
13
13
  border-top-left-radius: 10px;
14
14
  border-top-right-radius: 10px;
15
+ width: 100%;
15
16
  `
@@ -25,12 +25,20 @@ import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome5';
25
25
  import FastImage from 'react-native-fast-image'
26
26
 
27
27
  export const BusinessControllerUI = (props: BusinessControllerParams) => {
28
- const {
29
- business,
30
- handleClick,
31
- navigation,
32
- isBusinessOpen,
33
- style
28
+ const {
29
+ business,
30
+ handleClick,
31
+ navigation,
32
+ isBusinessOpen,
33
+ style,
34
+ businessHeader,
35
+ businessFeatured,
36
+ businessLogo,
37
+ businessReviews,
38
+ businessDeliveryPrice,
39
+ businessDeliveryTime,
40
+ businessPickupTime,
41
+ businessDistance
34
42
  } = props;
35
43
  const [{ parsePrice, parseDistance, parseNumber, optimizeImage }] = useUtils();
36
44
  const [orderState] = useOrder();
@@ -116,12 +124,12 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
116
124
  <FastImage
117
125
  style={{ height: 120 }}
118
126
  source={{
119
- uri: optimizeImage(business?.header, 'h_500,c_limit'),
120
- priority: FastImage.priority.normal,
127
+ uri: optimizeImage(businessHeader || business?.header, 'h_500,c_limit'),
128
+ priority: FastImage.priority.normal,
121
129
  }}
122
130
  resizeMode={FastImage.resizeMode.cover}
123
131
  />
124
- {business?.featured && (
132
+ {(businessFeatured ?? business?.featured) && (
125
133
  <View style={styles.featured}>
126
134
  <FontAwesomeIcon name="crown" size={26} color="gold" />
127
135
  </View>
@@ -145,17 +153,17 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
145
153
  <FastImage
146
154
  style={{ width: 56, height: 56 }}
147
155
  source={{
148
- uri: optimizeImage(business?.logo, 'h_150,c_limit'),
149
- priority: FastImage.priority.normal,
156
+ uri: optimizeImage(businessLogo || business?.logo, 'h_150,c_limit'),
157
+ priority: FastImage.priority.normal,
150
158
  }}
151
159
  resizeMode={FastImage.resizeMode.cover}
152
160
  />
153
161
  </BusinessLogo>
154
- {business?.reviews?.total > 0 && (
162
+ {(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && (
155
163
  <Reviews>
156
164
  <OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
157
165
  <OText size={10} style={{ lineHeight: 15 }}>
158
- {parseNumber(business?.reviews?.total, { separator: '.' })}
166
+ {parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
159
167
  </OText>
160
168
  </Reviews>
161
169
  )}
@@ -182,14 +190,14 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
182
190
  ) : (
183
191
  <View style={styles.bullet}>
184
192
  <OText size={10} color={theme.colors.textSecondary}>
185
- {`${t('DELIVERY_FEE', 'Delivery fee')} ${parsePrice(business?.delivery_price) + ' \u2022 '}`}
193
+ {`${t('DELIVERY_FEE', 'Delivery fee')} ${parsePrice(businessDeliveryPrice ?? business?.delivery_price) + ' \u2022 '}`}
186
194
  </OText>
187
195
  <OText size={10} color={theme.colors.textSecondary}>{`${convertHoursToMinutes(
188
196
  orderState?.options?.type === 1
189
- ? business?.delivery_time
190
- : business?.pickup_time,
197
+ ? (businessDeliveryTime ?? business?.delivery_time)
198
+ : (businessPickupTime ?? business?.pickup_time),
191
199
  )} \u2022 `}</OText>
192
- <OText size={10} color={theme.colors.textSecondary}>{parseDistance(business?.distance)}</OText>
200
+ <OText size={10} color={theme.colors.textSecondary}>{parseDistance(businessDistance ?? business?.distance)}</OText>
193
201
  </View>
194
202
  )}
195
203
  </Metadata>
@@ -237,7 +237,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
237
237
  };
238
238
 
239
239
  const bpStyles = StyleSheet.create({
240
- catWrap: { flexDirection: 'row', alignItems: 'center', height: 41, marginBottom: 19 },
240
+ catWrap: { flexDirection: 'row', alignItems: 'center', marginBottom: 19 },
241
241
  catIcon: {
242
242
  borderRadius: 7.6,
243
243
  shadowColor: '#000000',
@@ -72,6 +72,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
72
72
  borderWidth: 0,
73
73
  backgroundColor: theme.colors.clear,
74
74
  shadowColor: theme.colors.clear,
75
+ padding: 40,
75
76
  },
76
77
  searchIcon: {
77
78
  borderWidth: 0,
@@ -166,8 +166,15 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
166
166
  return R * c
167
167
  }
168
168
 
169
+ const resetInactivityTimeout = () => {
170
+ clearTimeout(timerId.current)
171
+ timerId.current = setInterval(() => {
172
+ getBusinesses(true)
173
+ }, 120000)
174
+ }
175
+
169
176
  useEffect(() => {
170
- if (businessesList.businesses.length > 0) {
177
+ if (!businessesList?.loading) {
171
178
  const fb = businessesList.businesses.filter((b) => b.featured === true && b?.open);
172
179
  const ary = [];
173
180
  while (fb.length > 0) {
@@ -175,16 +182,6 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
175
182
  }
176
183
  setFeaturedBusinesses(ary);
177
184
  }
178
- }, [businessesList.businesses]);
179
-
180
- const resetInactivityTimeout = () => {
181
- clearTimeout(timerId.current)
182
- timerId.current = setInterval(() => {
183
- getBusinesses(true)
184
- }, 300000)
185
- }
186
-
187
- useEffect(() => {
188
185
  resetInactivityTimeout()
189
186
  }, [businessesList.loading])
190
187
 
@@ -207,27 +204,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
207
204
  })
208
205
  }, [orderState?.options?.address?.location])
209
206
 
210
- useEffect(() => {
211
- const onFocusApp = (nextAppState: any) => {
212
- if (
213
- appState.current.match(/inactive|background/) &&
214
- nextAppState === "active"
215
- ) {
216
- getBusinesses(true);
217
- }
218
- appState.current = nextAppState;
219
- setAppStateVisible(appState.current);
220
- }
221
-
222
- AppState.addEventListener("change", onFocusApp);
223
- return () => {
224
- AppState.removeEventListener('change', onFocusApp);
225
- };
226
- }, [])
227
-
228
207
  useFocusEffect(
229
208
  useCallback(() => {
230
- getBusinesses(true)
231
209
  resetInactivityTimeout()
232
210
  return () => clearTimeout(timerId.current)
233
211
  }, [navigation])
@@ -401,6 +379,14 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
401
379
  handleCustomClick={handleBusinessClick}
402
380
  orderType={orderState?.options?.type}
403
381
  navigation={navigation}
382
+ businessHeader={business?.header}
383
+ businessFeatured={business?.featured}
384
+ businessLogo={business?.logo}
385
+ businessReviews={business?.reviews}
386
+ businessDeliveryPrice={business?.delivery_price}
387
+ businessDeliveryTime={business?.delivery_time}
388
+ businessPickupTime={business?.pickup_time}
389
+ businessDistance={business?.distance}
404
390
  />
405
391
  )
406
392
  )}
@@ -254,8 +254,8 @@ const CheckoutUI = (props: any) => {
254
254
  isVertical
255
255
  onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
256
256
  title={t('CHECKOUT', 'Checkout')}
257
- style={styles.pagePadding}
258
- titleStyle={{ marginLeft: 0, marginRight: 0 }}
257
+ titleStyle={{ marginLeft: 0, marginRight: 0, paddingLeft: 40 }}
258
+ btnStyle={{ marginLeft: 40, padding: 40 }}
259
259
  />
260
260
  <ChContainer style={styles.pagePadding}>
261
261
  <ChSection style={{ paddingTop: 0 }}>
@@ -1,8 +1,8 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import {
3
- BusinessList as BusinessesListingController,
3
+ BusinessList as BusinessesListingController,
4
4
  useLanguage,
5
- useOrder
5
+ useOrder
6
6
  } from 'ordering-components/native';
7
7
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
8
8
  import { View, ScrollView, Platform, Dimensions } from 'react-native';
@@ -24,117 +24,125 @@ const HighestRatedBusinessesUI = (props: HighestRatedBusinessesParams) => {
24
24
  } = props;
25
25
 
26
26
  const [, t] = useLanguage()
27
- const [orderState] = useOrder();
27
+ const [orderState] = useOrder()
28
28
 
29
29
  const windowWidth = Dimensions.get('window').width;
30
30
 
31
31
  useEffect(() => {
32
- if (businessesList?.loading || !isLoading) return
32
+ if (businessesList?.loading || !isLoading) return
33
33
  getBusinesses(true)
34
34
  }, [isLoading])
35
35
 
36
36
  return (
37
37
  <>
38
- <ListWrapper>
39
- <OText size={16} mBottom={5} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('HIGHEST_RATED', 'Highest rated')}</OText>
40
- <OText size={12}>{t('TOP_RATINGS_AND_GREAT_SERVICE', 'Top ratings and great service')}</OText>
41
- <ScrollView
42
- showsHorizontalScrollIndicator={false}
43
- nestedScrollEnabled
44
- horizontal
45
- style={{ height: 300 }}
46
- >
47
- {businessesList.loading ? (
48
- <>
49
- {[
50
- ...Array(10).keys()
51
- ].map((item, i) => (
52
- <Placeholder
53
- Animation={Fade}
54
- key={i}
55
- style={{
56
- marginTop: 20,
57
- width: windowWidth - 100,
58
- paddingHorizontal: 5,
59
- height: '100%'
60
- }}>
61
- <View style={{ width: '100%' }}>
62
- <PlaceholderLine
63
- height={150}
64
- style={{ marginBottom: 20, borderRadius: 8 }}
65
- />
66
- <View style={{ paddingHorizontal: 10 }}>
67
- <View
68
- style={{
69
- flexDirection: 'row',
70
- justifyContent: 'space-between',
71
- }}>
72
- <PlaceholderLine
73
- height={15}
74
- width={40}
75
- style={{ marginBottom: 15 }}
76
- />
77
- <PlaceholderLine
78
- height={15}
79
- width={20}
80
- style={{ marginBottom: 15 }}
81
- />
82
- </View>
38
+
39
+ {businessesList.loading ? (
40
+ <>
41
+ <ScrollView
42
+ showsHorizontalScrollIndicator={false}
43
+ nestedScrollEnabled
44
+ horizontal
45
+ style={{ height: 300, paddingHorizontal: 40 }}
46
+ >
47
+ {[
48
+ ...Array(10).keys()
49
+ ].map((item, i) => (
50
+ <Placeholder
51
+ Animation={Fade}
52
+ key={i}
53
+ style={{
54
+ marginTop: 20,
55
+ width: windowWidth - 100,
56
+ paddingHorizontal: 5,
57
+ height: '100%'
58
+ }}>
59
+ <View style={{ width: '100%' }}>
60
+ <PlaceholderLine
61
+ height={150}
62
+ style={{ marginBottom: 20, borderRadius: 8 }}
63
+ />
64
+ <View style={{ paddingHorizontal: 10 }}>
65
+ <View
66
+ style={{
67
+ flexDirection: 'row',
68
+ justifyContent: 'space-between',
69
+ }}>
83
70
  <PlaceholderLine
84
71
  height={15}
85
- width={30}
86
- style={{ marginBottom: 10 }}
72
+ width={40}
73
+ style={{ marginBottom: 15 }}
87
74
  />
88
75
  <PlaceholderLine
89
76
  height={15}
90
- width={80}
91
- style={{ marginBottom: 10 }}
77
+ width={20}
78
+ style={{ marginBottom: 15 }}
92
79
  />
93
80
  </View>
81
+ <PlaceholderLine
82
+ height={15}
83
+ width={30}
84
+ style={{ marginBottom: 10 }}
85
+ />
86
+ <PlaceholderLine
87
+ height={15}
88
+ width={80}
89
+ style={{ marginBottom: 10 }}
90
+ />
94
91
  </View>
95
- </Placeholder>
96
- ))}
97
- </>
98
- ) : (
99
- <>
100
- {businessesList.businesses.length > 0 ? (
101
- businessesList.businesses?.map(
102
- (business: any) => (
103
- <View
104
- key={business.id}
105
- style={{
106
- width: windowWidth - 100,
107
- paddingHorizontal: 5,
108
- height: '100%'
109
- }}
110
- >
111
- <BusinessController
112
- business={business}
113
- isBusinessOpen={business?.open}
114
- handleCustomClick={onBusinessClick}
115
- orderType={orderState?.options?.type}
116
- navigation={navigation}
117
- />
118
- </View>
92
+ </View>
93
+ </Placeholder>
94
+ ))}
95
+ </ScrollView>
96
+ </>
97
+ ) : (
98
+ <>
99
+ {businessesList.businesses.length > 0 && (
100
+ <ListWrapper>
101
+ <OText size={16} mBottom={5} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('HIGHEST_RATED', 'Highest rated')}</OText>
102
+ <OText size={12}>{t('TOP_RATINGS_AND_GREAT_SERVICE', 'Top ratings and great service')}</OText>
103
+ <ScrollView
104
+ showsHorizontalScrollIndicator={false}
105
+ nestedScrollEnabled
106
+ horizontal
107
+ style={{ height: 300 }}
108
+ >
109
+ {
110
+ businessesList.businesses?.map(
111
+ (business: any) => (
112
+ <View
113
+ key={business.id}
114
+ style={{
115
+ width: windowWidth - 100,
116
+ paddingHorizontal: 5,
117
+ height: '100%'
118
+ }}
119
+ >
120
+ <BusinessController
121
+ business={business}
122
+ isBusinessOpen={business?.open}
123
+ handleCustomClick={onBusinessClick}
124
+ orderType={orderState?.options?.type}
125
+ navigation={navigation}
126
+ />
127
+ </View>
128
+ )
119
129
  )
120
- )
121
- ) : (
122
- <NotFoundSource />
123
- )}
124
- </>
130
+ }
131
+ </ScrollView>
132
+ </ListWrapper>
125
133
  )}
126
- </ScrollView>
127
- </ListWrapper>
134
+ </>
135
+ )}
128
136
  </>
129
137
  )
130
138
  }
131
139
 
132
140
  export const HighestRatedBusinesses = (props: any) => {
133
- const highestRatedBusinessesProps = {
134
- ...props,
135
- UIComponent: HighestRatedBusinessesUI,
141
+ const highestRatedBusinessesProps = {
142
+ ...props,
143
+ UIComponent: HighestRatedBusinessesUI,
136
144
  initialOrderByValue: 'rating'
137
- };
145
+ };
138
146
 
139
- return <BusinessesListingController {...highestRatedBusinessesProps} />;
147
+ return <BusinessesListingController {...highestRatedBusinessesProps} />;
140
148
  };
@@ -332,30 +332,34 @@ const MessagesUI = (props: MessagesParams) => {
332
332
  )
333
333
  )
334
334
 
335
- const renderSend = (props: any) => (
336
- <Send
337
- {...props}
338
- disabled={(sendMessage?.loading || (message === '' && !image) || messages?.loading)}
339
- alwaysShowSend
340
- containerStyle={styles.containerSend}
341
- >
342
- <OIconButton
343
- onClick={onSubmit}
344
- style={{
345
- height: 44,
346
- width: 44,
347
- borderRadius: 7.6,
348
- opacity: (sendMessage?.loading || (message === '' && !image) || messages?.loading) ? 0.4 : 1,
349
- borderColor: theme.colors.primary,
350
- backgroundColor: theme.colors.primary,
351
- }}
352
- iconStyle={{ marginTop: 3, marginRight: 2 }}
353
- icon={theme.images.general.enter}
354
- disabled={(sendMessage?.loading || (message === '' && !image) || messages?.loading)}
355
- disabledColor={theme.colors.white}
356
- />
357
- </Send>
358
- )
335
+ const renderSend = (props: any) => {
336
+ const isDisabled = (sendMessage?.loading || (message === '' && !image) || messages?.loading)
337
+ return (
338
+ <Send
339
+ {...props}
340
+ disabled={isDisabled}
341
+ alwaysShowSend
342
+ containerStyle={styles.containerSend}
343
+ >
344
+ <OIconButton
345
+ onClick={onSubmit}
346
+ style={{
347
+ height: 44,
348
+ width: 44,
349
+ borderRadius: 7.6,
350
+ opacity: isDisabled ? 0.2 : 1,
351
+ borderColor: isDisabled ? theme.colors.secondary : theme.colors.primary,
352
+ backgroundColor: isDisabled ? theme.colors.secondary : theme.colors.primary,
353
+ }}
354
+ iconStyle={{ marginTop: 3, marginRight: 2 }}
355
+ icon={theme.images.general.enter}
356
+ iconColor={isDisabled ? '#000' : '#fff'}
357
+ disabled={isDisabled}
358
+ disabledColor={theme.colors.secondary}
359
+ />
360
+ </Send>
361
+ )
362
+ }
359
363
 
360
364
  const renderBubble = (props: any) => (
361
365
  <Bubble
@@ -218,7 +218,7 @@ export const OrderProgress = (props: any) => {
218
218
  const orderProgressProps = {
219
219
  ...props,
220
220
  UIComponent: OrderProgressUI,
221
- orderStatus: [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21, 22, 23],
221
+ orderStatus: [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23],
222
222
  useDefualtSessionManager: true,
223
223
  paginationSettings: {
224
224
  initialPage: 1,
@@ -239,8 +239,8 @@ export const OrdersOption = (props: OrdersOptionParams) => {
239
239
  ...props,
240
240
  UIComponent: OrdersOptionUI,
241
241
  orderStatus: props.preOrders ? [13] : props.activeOrders
242
- ? [0, 3, 4, 7, 8, 9, 14, 15, 18, 19, 20, 21, 22, 23]
243
- : [1, 2, 5, 6, 10, 11, 12, 16, 17],
242
+ ? [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23]
243
+ : [1, 2, 5, 6, 10, 11, 12, 15, 16, 17],
244
244
  useDefualtSessionManager: true,
245
245
  }
246
246
 
@@ -85,7 +85,7 @@ export const PreviousOrders = (props: PreviousOrdersParams) => {
85
85
  order: {
86
86
  id: order?.id,
87
87
  business_id: order?.business_id,
88
- logo: order.business?.logo,
88
+ logo: order?.business?.logo,
89
89
  driver: order?.driver,
90
90
  products: order?.products,
91
91
  review: order?.review,
@@ -6,9 +6,10 @@ export const WrapHeader = styled.View`
6
6
  `
7
7
 
8
8
  export const TopActions = styled.TouchableOpacity`
9
- height: 44px;
9
+ height: 60px;
10
10
  justify-content: center;
11
11
  padding-horizontal: 30px;
12
+ width: 80px;
12
13
  `;
13
14
 
14
15
  export const TopHeader = styled.View`
@@ -43,7 +43,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
43
43
  logoWrapper: {
44
44
  shadowColor: theme.colors.black,
45
45
  shadowRadius: 3,
46
- shadowOffset: {width: 1, height: 4},
46
+ shadowOffset: { width: 1, height: 4 },
47
47
  elevation: 3,
48
48
  borderRadius: 8,
49
49
  shadowOpacity: 0.1,
@@ -108,11 +108,11 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
108
108
  }
109
109
 
110
110
  const qualificationList = [
111
- { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
111
+ { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
112
112
  { key: 2, text: t('BAD', 'Bad'), percent: 0.25, parentStyle: { left: '25%' }, isInnerStyle: true, pointerColor: true },
113
113
  { key: 3, text: t('OKAY', 'Okay'), percent: 0.5, parentStyle: { left: '50%' }, isInnerStyle: true, pointerColor: true },
114
114
  { key: 4, text: t('GOOD', 'Good'), percent: 0.75, parentStyle: { left: '75%' }, isInnerStyle: true, pointerColor: true },
115
- { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
115
+ { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
116
116
  ]
117
117
 
118
118
  const commentsList = reviewCommentList('order')
@@ -137,7 +137,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
137
137
  return found
138
138
  }
139
139
 
140
- const handleContinueClick = () => {
140
+ const handleContinueClick = () => {
141
141
  if (!order?.review) {
142
142
  onSubmit()
143
143
  } else {
@@ -183,7 +183,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
183
183
  comments.map(comment => _comments += comment.content + '. ')
184
184
  }
185
185
  let _comment
186
- _comment = _comments + extraComment
186
+ _comment = _comments + extraComment
187
187
  setStars({ ...stars, comments: _comment })
188
188
  }, [comments, extraComment])
189
189
 
@@ -214,7 +214,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
214
214
  <OText color={theme.colors.primary}>{t('ORDER_REVIEWED', 'This order has been already reviewed')}</OText>
215
215
  </View>
216
216
  ) : (
217
- <View style={{flex: 1, justifyContent: 'flex-end'}}>
217
+ <View style={{ flex: 1, justifyContent: 'flex-end' }}>
218
218
  <FormReviews>
219
219
  <OText mBottom={13} color={theme.colors.textNormal}>{t('HOW_WAS_YOUR_ORDER', 'How was your order?')}</OText>
220
220
  <RatingBarContainer>
@@ -266,7 +266,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
266
266
  style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
267
267
  imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
268
268
  imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
269
- onClick={() => handleChangeComment(commentItem) }
269
+ onClick={() => handleChangeComment(commentItem)}
270
270
  />
271
271
  ))}
272
272
  </CommentsButtonGroup>
@@ -304,7 +304,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
304
304
  textStyle={{ color: theme.colors.white, paddingRight: 10 }}
305
305
  text={t('CONTINUE', 'Continue')}
306
306
  style={{ borderRadius: 8 }}
307
- imgRightSrc={theme.images.general.arrow_right}
307
+ imgRightSrc={theme.images.general.arrow_right}
308
308
  imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
309
309
  onClick={handleSubmit(handleContinueClick)}
310
310
  />
@@ -317,7 +317,8 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
317
317
  export const ReviewOrder = (props: ReviewOrderParams) => {
318
318
  const reviewOrderProps = {
319
319
  ...props,
320
- UIComponent: ReviewOrderUI
320
+ UIComponent: ReviewOrderUI,
321
+ defaultStar: 5
321
322
  }
322
323
  return <ReviewOrderController {...reviewOrderProps} />
323
324
  }
@@ -74,7 +74,7 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
74
74
  titleWrapStyle={{ paddingHorizontal: 0 }}
75
75
  titleStyle={{ marginRight: 0, marginLeft: 0 }}
76
76
  />
77
- {order?.products.map((product: any) => (
77
+ {order?.products?.map((product: any) => (
78
78
  <SingleProductReview
79
79
  key={product.id}
80
80
  product={product}
@@ -141,8 +141,8 @@ const ProfileListUI = (props: ProfileParams) => {
141
141
  {t('PROFILE', 'Profile')}
142
142
  </OText>
143
143
  <CenterView style={styles.pagePadding}>
144
- <View style={styles.photo}>
145
- {user?.photo ? (
144
+ {user?.photo && (
145
+ <View style={styles.photo}>
146
146
  <FastImage
147
147
  style={{ height: 60, width: 60, borderRadius: 8 }}
148
148
  source={{
@@ -151,10 +151,8 @@ const ProfileListUI = (props: ProfileParams) => {
151
151
  }}
152
152
  resizeMode={FastImage.resizeMode.cover}
153
153
  />
154
- ) : (
155
- <Ionicons name='person-outline' size={50} style={{ marginRight: 10 }} />
156
- )}
157
- </View>
154
+ </View>
155
+ )}
158
156
  <View style={{ flexBasis: '70%' }}>
159
157
  <OText size={20} lineHeight={30} weight={Platform.OS === 'ios' ? '500' : 'bold'} color={theme.colors.textNormal}>{user?.name} {user?.lastname}</OText>
160
158
  <TouchableOpacity onPress={() => navigation.navigate('ProfileForm', { ...detailProps })}>
@@ -166,7 +166,15 @@ export interface BusinessControllerParams {
166
166
  businessWillCloseSoonMinutes?: number
167
167
  isBusinessClose?: number,
168
168
  navigation?: any,
169
- style?: ViewStyle
169
+ style?: ViewStyle,
170
+ businessHeader?: string,
171
+ businessFeatured?: boolean,
172
+ businessLogo?: string,
173
+ businessReviews?: any,
174
+ businessDeliveryPrice?: number,
175
+ businessDeliveryTime?: string,
176
+ businessPickupTime?: string,
177
+ businessDistance?: number
170
178
  }
171
179
  export interface BusinessProductsListingParams {
172
180
  navigation?: any;