ordering-ui-react-native 0.15.1 → 0.15.2-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 (124) hide show
  1. package/package.json +7 -3
  2. package/src/DeliveryApp.tsx +32 -1
  3. package/src/components/BusinessTypeFilter/index.tsx +9 -2
  4. package/src/components/BusinessTypeFilter/styles.tsx +1 -1
  5. package/src/components/BusinessesListing/index.tsx +1 -1
  6. package/src/components/Checkout/index.tsx +0 -1
  7. package/src/components/Home/index.tsx +3 -5
  8. package/src/components/LanguageSelector/index.tsx +65 -97
  9. package/src/components/LanguageSelector/styles.tsx +4 -17
  10. package/src/components/Messages/index.tsx +38 -30
  11. package/src/components/MomentOption/index.tsx +3 -1
  12. package/src/components/OrderDetails/index.tsx +25 -4
  13. package/src/components/PaymentOptions/index.tsx +9 -16
  14. package/src/components/PaymentOptionsWebView/index.tsx +123 -124
  15. package/src/components/ProductForm/index.tsx +1 -1
  16. package/src/components/ProductForm/styles.tsx +1 -0
  17. package/src/components/StripeElementsForm/index.tsx +27 -48
  18. package/src/components/UserProfileForm/index.tsx +35 -1
  19. package/src/components/VerifyPhone/styles.tsx +1 -2
  20. package/src/config.json +0 -2
  21. package/src/pages/Checkout.tsx +1 -1
  22. package/src/types/index.tsx +2 -9
  23. package/src/utils/index.tsx +2 -1
  24. package/themes/business/index.tsx +2 -0
  25. package/themes/business/src/components/Chat/index.tsx +32 -31
  26. package/themes/business/src/components/OrderDetails/Business.tsx +1 -0
  27. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +85 -17
  28. package/themes/business/src/components/OrdersListManager/index.tsx +874 -0
  29. package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
  30. package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
  31. package/themes/business/src/components/OrdersOption/index.tsx +70 -116
  32. package/themes/business/src/components/OrdersOption/styles.tsx +2 -5
  33. package/themes/business/src/components/PreviousOrders/index.tsx +82 -23
  34. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  35. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  36. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  37. package/themes/kiosk/src/components/BusinessController/index.tsx +27 -6
  38. package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
  39. package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +51 -24
  40. package/themes/kiosk/src/components/Cart/index.tsx +1 -1
  41. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
  42. package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
  43. package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
  44. package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
  45. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +7 -5
  46. package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
  47. package/themes/kiosk/src/components/Intro/index.tsx +13 -13
  48. package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
  49. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  50. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  51. package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
  52. package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
  53. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
  54. package/themes/kiosk/src/components/ProductForm/index.tsx +172 -124
  55. package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
  56. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
  57. package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
  58. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
  59. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  60. package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
  61. package/themes/original/index.tsx +179 -0
  62. package/themes/original/src/components/AddressForm/index.tsx +15 -10
  63. package/themes/original/src/components/AddressList/index.tsx +27 -1
  64. package/themes/original/src/components/AnalyticsSegment/index.tsx +127 -0
  65. package/themes/original/src/components/BusinessBasicInformation/index.tsx +100 -45
  66. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +28 -1
  67. package/themes/original/src/components/BusinessController/index.tsx +32 -21
  68. package/themes/original/src/components/BusinessListingSearch/index.tsx +7 -3
  69. package/themes/original/src/components/BusinessMenuList/index.tsx +14 -5
  70. package/themes/original/src/components/BusinessPreorder/index.tsx +142 -121
  71. package/themes/original/src/components/BusinessProductsCategories/index.tsx +7 -5
  72. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  73. package/themes/original/src/components/BusinessProductsListing/index.tsx +23 -30
  74. package/themes/original/src/components/BusinessReviews/index.tsx +8 -28
  75. package/themes/original/src/components/BusinessesListing/index.tsx +39 -52
  76. package/themes/original/src/components/Cart/index.tsx +40 -9
  77. package/themes/original/src/components/CartContent/index.tsx +2 -2
  78. package/themes/original/src/components/Checkout/index.tsx +58 -33
  79. package/themes/original/src/components/Checkout/styles.tsx +7 -0
  80. package/themes/original/src/components/CouponControl/index.tsx +1 -0
  81. package/themes/original/src/components/DriverTips/index.tsx +1 -1
  82. package/themes/original/src/components/ForgotPasswordForm/index.tsx +8 -12
  83. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +105 -90
  84. package/themes/original/src/components/LoginForm/index.tsx +156 -70
  85. package/themes/original/src/components/LoginForm/styles.tsx +6 -1
  86. package/themes/original/src/components/Messages/index.tsx +52 -45
  87. package/themes/original/src/components/Messages/styles.tsx +1 -3
  88. package/themes/original/src/components/MomentOption/index.tsx +127 -152
  89. package/themes/original/src/components/MomentOption/styles.tsx +42 -18
  90. package/themes/original/src/components/OrderDetails/index.tsx +102 -125
  91. package/themes/original/src/components/OrderDetails/styles.tsx +3 -1
  92. package/themes/original/src/components/OrderProgress/index.tsx +6 -7
  93. package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
  94. package/themes/original/src/components/OrderSummary/index.tsx +34 -1
  95. package/themes/original/src/components/OrdersOption/index.tsx +15 -46
  96. package/themes/original/src/components/OrdersOption/styles.tsx +0 -6
  97. package/themes/original/src/components/PaymentOptionWallet/index.tsx +6 -2
  98. package/themes/original/src/components/PaymentOptions/index.tsx +24 -25
  99. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
  100. package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
  101. package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
  102. package/themes/original/src/components/PreviousOrders/index.tsx +19 -13
  103. package/themes/original/src/components/ProductForm/index.tsx +157 -108
  104. package/themes/original/src/components/ProductForm/styles.tsx +5 -3
  105. package/themes/original/src/components/ProductOptionSubOption/index.tsx +6 -1
  106. package/themes/original/src/components/ReviewOrder/index.tsx +10 -9
  107. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  108. package/themes/original/src/components/SignupForm/index.tsx +173 -154
  109. package/themes/original/src/components/SingleProductCard/index.tsx +1 -1
  110. package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
  111. package/themes/original/src/components/TaxInformation/index.tsx +17 -7
  112. package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
  113. package/themes/original/src/components/UserDetails/index.tsx +4 -95
  114. package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
  115. package/themes/original/src/components/UserProfile/index.tsx +16 -11
  116. package/themes/original/src/components/UserProfileForm/index.tsx +16 -8
  117. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  118. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  119. package/themes/original/src/components/shared/HeaderTitle.tsx +21 -0
  120. package/themes/original/src/components/shared/index.tsx +2 -0
  121. package/themes/original/src/types/index.tsx +64 -22
  122. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +5 -5
  123. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  124. package/src/components/StripeMethodForm/index.tsx +0 -168
@@ -20,6 +20,7 @@ import { OText } from '../shared'
20
20
 
21
21
  const PaymentOptionWalletUI = (props: any) => {
22
22
  const {
23
+ businessConfigs,
23
24
  businessId,
24
25
  walletsState,
25
26
  selectWallet,
@@ -37,6 +38,9 @@ const PaymentOptionWalletUI = (props: any) => {
37
38
  const isWalletCashEnabled = configs?.wallet_cash_enabled?.value === '1'
38
39
  const isWalletPointsEnabled = configs?.wallet_credit_point_enabled?.value === '1'
39
40
 
41
+ const isBusinessWalletCashEnabled = businessConfigs.find((config: any) => config.key === 'wallet_cash_enabled')?.value === '1'
42
+ const isBusinessWalletPointsEnabled = businessConfigs.find((config: any) => config.key === 'wallet_credit_point_enabled')?.value === '1'
43
+
40
44
  const styles = StyleSheet.create({
41
45
  checkBoxStyle: {
42
46
  width: 25,
@@ -53,11 +57,11 @@ const PaymentOptionWalletUI = (props: any) => {
53
57
  const walletName: any = {
54
58
  cash: {
55
59
  name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
56
- isActive: isWalletCashEnabled
60
+ isActive: isWalletCashEnabled && isBusinessWalletCashEnabled
57
61
  },
58
62
  credit_point: {
59
63
  name: t('PAY_WITH_CREDITS_POINTS_WALLET', 'Pay with Credit Points Wallet'),
60
- isActive: isWalletPointsEnabled
64
+ isActive: isWalletPointsEnabled && isBusinessWalletPointsEnabled
61
65
  }
62
66
  }
63
67
 
@@ -9,6 +9,8 @@ import {
9
9
  import {
10
10
  PaymentOptions as PaymentOptionsController,
11
11
  useLanguage,
12
+ ToastType,
13
+ useToast,
12
14
  } from 'ordering-components/native';
13
15
  import { useTheme } from 'styled-components/native';
14
16
  import { PaymentOptionCash } from '../PaymentOptionCash';
@@ -30,8 +32,6 @@ import {
30
32
  import { getIconCard, flatArray } from '../../utils';
31
33
 
32
34
  const stripeOptions: any = ['stripe_direct', 'stripe', 'stripe_connect']
33
- const methodsPay = ['google_pay', 'apple_pay']
34
- const stripeDirectMethods = ['stripe_direct', ...methodsPay]
35
35
  // const stripeRedirectOptions = [
36
36
  // { name: 'Bancontact', value: 'bancontact' },
37
37
  // { name: 'Alipay', value: 'alipay' },
@@ -54,12 +54,11 @@ const PaymentOptionsUI = (props: any) => {
54
54
  handlePaymethodClick,
55
55
  handlePaymethodDataChange,
56
56
  isOpenMethod,
57
- handlePaymentMethodClickCustom,
58
- handlePlaceOrder
57
+ handlePaymentMethodClickCustom
59
58
  } = props
60
59
 
61
60
  const theme = useTheme();
62
-
61
+ const [, { showToast }] = useToast();
63
62
 
64
63
  const getPayIcon = (method: string) => {
65
64
  switch (method) {
@@ -95,11 +94,18 @@ const PaymentOptionsUI = (props: any) => {
95
94
  // ]
96
95
 
97
96
  const handlePaymentMethodClick = (paymethod: any) => {
98
- const isPopupMethod = ['stripe', 'stripe_direct', 'stripe_connect', 'stripe_redirect', 'paypal'].includes(paymethod?.gateway)
99
- if (webViewPaymentGateway.includes(paymethod?.gateway)) {
100
- handlePaymentMethodClickCustom(paymethod)
101
- }
102
- handlePaymethodClick(paymethod, isPopupMethod)
97
+ if (cart?.balance > 0) {
98
+ const isPopupMethod = ['stripe', 'stripe_direct', 'stripe_connect', 'stripe_redirect', 'paypal'].includes(paymethod?.gateway)
99
+ if (webViewPaymentGateway.includes(paymethod?.gateway)) {
100
+ handlePaymentMethodClickCustom(paymethod)
101
+ }
102
+ handlePaymethodClick(paymethod, isPopupMethod)
103
+ return
104
+ }
105
+ showToast(
106
+ ToastType.Error,
107
+ t('CART_BALANCE_ZERO', 'Sorry, the amount to pay is equal to zero and it is not necessary to select a payment method'))
108
+ ;
103
109
  }
104
110
 
105
111
  useEffect(() => {
@@ -116,16 +122,12 @@ const PaymentOptionsUI = (props: any) => {
116
122
 
117
123
  useEffect(() => {
118
124
  if (props.paySelected && props.paySelected?.data) {
119
- setPaymethodData && setPaymethodData(props.paySelected?.data)
125
+ requestAnimationFrame(() => {
126
+ setPaymethodData && setPaymethodData(props.paySelected?.data)
127
+ })
120
128
  }
121
129
  }, [props.paySelected])
122
130
 
123
- useEffect(() => {
124
- if (methodsPay.includes(paymethodSelected?.gateway) && paymethodData?.id && paymethodSelected?.data?.card) {
125
- handlePlaceOrder()
126
- }
127
- }, [paymethodData, paymethodSelected])
128
-
129
131
  const renderPaymethods = ({ item }: any) => {
130
132
  return (
131
133
  <TouchableOpacity
@@ -154,7 +156,7 @@ const PaymentOptionsUI = (props: any) => {
154
156
  )
155
157
  }
156
158
 
157
- const excludeIds: any = [32]; //exclude paypal & connect & redirect
159
+ const excludeIds: any = [32, 66]; //exclude paypal & connect & redirect
158
160
 
159
161
  return (
160
162
  <PMContainer>
@@ -287,11 +289,11 @@ const PaymentOptionsUI = (props: any) => {
287
289
  </KeyboardAvoidingView>
288
290
  </OModal>
289
291
 
290
- {/* Stripe direct, Google pay, Apple pay */}
292
+ {/* Stripe direct */}
291
293
  <OModal
292
294
  entireModal
293
295
  title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
294
- open={stripeDirectMethods?.includes(isOpenMethod?.paymethod?.gateway) && !paymethodData.id}
296
+ open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData?.id}
295
297
  onClose={() => handlePaymethodClick(null)}
296
298
  >
297
299
  <KeyboardAvoidingView
@@ -300,13 +302,10 @@ const PaymentOptionsUI = (props: any) => {
300
302
  enabled={Platform.OS === 'ios' ? true : false}
301
303
  >
302
304
  <StripeElementsForm
303
- cart={cart}
304
- paymethod={isOpenMethod?.paymethod?.gateway}
305
- methodsPay={methodsPay}
306
305
  businessId={props.businessId}
307
- publicKey={isOpenMethod?.paymethod?.credentials?.publishable || isOpenMethod?.paymethod?.credentials?.publishable_key}
306
+ publicKey={isOpenMethod?.paymethod?.credentials?.publishable}
308
307
  handleSource={handlePaymethodDataChange}
309
- onCancel={() => handlePaymethodClick(null)}
308
+ onCancel={() => handlePaymethodClick(false)}
310
309
  />
311
310
  </KeyboardAvoidingView>
312
311
  </OModal>
@@ -22,18 +22,23 @@ export const PhoneInputNumber = (props: PhoneInputParams) => {
22
22
  textStyle,
23
23
  flagStyle,
24
24
  noDropIcon,
25
- isDisabled
25
+ isDisabled,
26
+ isStartValidation
26
27
  } = props
27
28
 
28
29
  const theme = useTheme();
29
30
 
31
+ const [, t] = useLanguage()
32
+ const [{ configs }] = useConfig()
33
+ const phoneInput = useRef<PhoneInput>(null);
34
+ const [userphoneNumber, setUserphoneNumber] = useState('');
30
35
 
31
36
  const style = StyleSheet.create({
32
37
  input: {
33
38
  backgroundColor: theme.colors.white,
34
39
  borderRadius: 7.6,
35
40
  borderWidth: 1,
36
- borderColor: theme.colors.border,
41
+ borderColor: (isStartValidation && userphoneNumber === '') ? theme.colors.danger5 : theme.colors.border,
37
42
  paddingBottom: 0,
38
43
  paddingTop: 0,
39
44
  flexGrow: 1,
@@ -48,12 +53,6 @@ export const PhoneInputNumber = (props: PhoneInputParams) => {
48
53
  }
49
54
  })
50
55
 
51
-
52
- const [, t] = useLanguage()
53
- const [{ configs }] = useConfig()
54
- const phoneInput = useRef<PhoneInput>(null);
55
- const [userphoneNumber, setUserphoneNumber] = useState('');
56
-
57
56
  const handleChangeNumber = (number: any) => {
58
57
  setUserphoneNumber(number)
59
58
  }
@@ -97,6 +96,14 @@ export const PhoneInputNumber = (props: PhoneInputParams) => {
97
96
 
98
97
  return (
99
98
  <Wrapper onPress={() => forwardRef?.current?.focus?.()}>
99
+ {(isStartValidation && userphoneNumber === '') && (
100
+ <OText
101
+ size={14}
102
+ color={theme.colors.danger5}
103
+ >
104
+ {t('VALIDATION_ERROR_MOBILE_PHONE_REQUIRED', 'The field Mobile phone is required').replace('_attribute_', t('CELLPHONE', 'Cellphone'))}*
105
+ </OText>
106
+ )}
100
107
  <PhoneInput
101
108
  ref={phoneInput}
102
109
  disabled={isDisabled}
@@ -0,0 +1,114 @@
1
+ import React, { useEffect, useState } from 'react'
2
+ import { View } from 'react-native'
3
+ import { PlaceSpot as PlaceSpotController, useLanguage } from 'ordering-components/native'
4
+ import { PlaceGroupContainer, PlaceSpotContainer } from './styles'
5
+ import { NotFoundSource } from '../NotFoundSource'
6
+ import { OText, ODropDown } from '../shared'
7
+ import { Placeholder, PlaceholderLine } from 'rn-placeholder'
8
+ import { PlaceSpotParams } from '../../types'
9
+
10
+ const PlaceSpotUI = (props: PlaceSpotParams) => {
11
+ const {
12
+ isOpenPlaceSpot,
13
+ cart,
14
+ placesState,
15
+ handleChangePlace,
16
+ getPlacesList,
17
+ setOpenPlaceModal
18
+ } = props
19
+
20
+ const [, t] = useLanguage()
21
+ const [placeGroupSelected, setPlaceGroupSelected] = useState<any>(null)
22
+
23
+ const getPlacesGroups = () => {
24
+ const groups = placesState.placeGroups?.filter((group: any) => group?.enabled && placesState?.places?.find((place: any) => place?.enabled && place?.place_group_id === group?.id))
25
+ return groups.map((group: any) => ({
26
+ value: group,
27
+ content: group?.name,
28
+ showOnSelected: group?.name
29
+ }))
30
+ }
31
+
32
+ const getPlaces = () => {
33
+ const places = placeGroupSelected && placesState?.places?.filter((place: any) => place?.enabled && place?.place_group_id === placeGroupSelected?.id)
34
+ return places.map((place: any) => ({
35
+ value: place,
36
+ content: place.name,
37
+ showOnSelected: place.name
38
+ }))
39
+ }
40
+
41
+ const handlerChangePlace = (place: any) => {
42
+ setOpenPlaceModal(false)
43
+ handleChangePlace(place)
44
+ }
45
+
46
+
47
+ useEffect(() => {
48
+ if (!placesState?.loading) {
49
+ const placeGroupOnCart = placesState?.placeGroups.find((group: any) => group?.id === cart?.place?.place_group_id)
50
+ setPlaceGroupSelected(placeGroupOnCart)
51
+ }
52
+ }, [placesState])
53
+
54
+ useEffect(() => {
55
+ getPlacesList()
56
+ }, [isOpenPlaceSpot])
57
+
58
+ return (
59
+ <PlaceSpotContainer>
60
+ {(placesState.error || placesState?.placeGroups?.length === 0) && !placesState?.loading && (
61
+ <NotFoundSource
62
+ content={t('NO_PLACES_THIS_BUSINESS', 'There are not places for this business')}
63
+ />
64
+ )}
65
+ {placesState?.loading && (
66
+ <Placeholder>
67
+ <PlaceGroupContainer>
68
+ <PlaceholderLine width={100} height={25} />
69
+ <PlaceholderLine height={30} />
70
+ </PlaceGroupContainer>
71
+ <View>
72
+ <PlaceholderLine width={120} height={25} />
73
+ <PlaceholderLine height={30} />
74
+ </View>
75
+ </Placeholder>
76
+ )}
77
+ {!(placesState.error || placesState?.placeGroups?.length === 0) && !placesState?.loading && (
78
+ <>
79
+ <PlaceGroupContainer>
80
+ <OText size={16} mBottom={10}>{t('PLACE_GROUP', 'Place group')}</OText>
81
+ <ODropDown
82
+ placeholder={t('PLACE_GROUP', 'Place group')}
83
+ options={getPlacesGroups()}
84
+ onSelect={(group: any) => setPlaceGroupSelected(group)}
85
+ defaultValue={placeGroupSelected ?? cart?.place}
86
+ isModal
87
+ />
88
+ </PlaceGroupContainer>
89
+ {placeGroupSelected && (
90
+ <View>
91
+ <OText size={16} mBottom={10}>{t('SELECT_YOUR_SPOT', 'Select your spot')}</OText>
92
+ <ODropDown
93
+ onSelect={(place: any) => handlerChangePlace(place)}
94
+ placeholder={t('SELECT_YOUR_SPOT', 'Select your spot')}
95
+ options={getPlaces()}
96
+ defaultValue={placesState?.places?.find((place : any) => place?.id === cart?.place_id)}
97
+ isModal
98
+ />
99
+ </View>
100
+ )}
101
+ </>
102
+ )}
103
+ </PlaceSpotContainer>
104
+ )
105
+ }
106
+
107
+ export const PlaceSpot = (props: PlaceSpotParams) => {
108
+ const placeSpotProps = {
109
+ ...props,
110
+ UIComponent: PlaceSpotUI
111
+ }
112
+
113
+ return <PlaceSpotController {...placeSpotProps} />
114
+ }
@@ -0,0 +1,11 @@
1
+ import styled from 'styled-components/native'
2
+
3
+ export const PlaceSpotContainer = styled.View`
4
+ min-height: 300px;
5
+ padding: 20px;
6
+ `
7
+
8
+ export const PlaceGroupContainer = styled.View`
9
+ margin-bottom: 40px;
10
+ margin-top: 20px;
11
+ `
@@ -85,7 +85,11 @@ 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
+ driver: order?.driver,
90
+ products: order?.products,
91
+ review: order?.review,
92
+ user_review: order?.user_review
89
93
  },
90
94
  });
91
95
  };
@@ -139,18 +143,20 @@ export const PreviousOrders = (props: PreviousOrdersParams) => {
139
143
  </OText>
140
144
  </Information>
141
145
  <Status>
142
- <OButton
143
- text={t('REORDER', 'Reorder')}
144
- imgRightSrc={''}
145
- textStyle={styles.buttonText}
146
- style={
147
- reorderLoading && order.id === reorderSelected
148
- ? styles.reorderLoading
149
- : styles.reorderbutton
150
- }
151
- onClick={() => handleReorderClick(order.id)}
152
- isLoading={reorderLoading && order.id === reorderSelected}
153
- />
146
+ {order.cart && (
147
+ <OButton
148
+ text={t('REORDER', 'Reorder')}
149
+ imgRightSrc={''}
150
+ textStyle={styles.buttonText}
151
+ style={
152
+ reorderLoading && order.id === reorderSelected
153
+ ? styles.reorderLoading
154
+ : styles.reorderbutton
155
+ }
156
+ onClick={() => handleReorderClick(order.id)}
157
+ isLoading={reorderLoading && order.id === reorderSelected}
158
+ />
159
+ )}
154
160
  {allowedOrderStatus.includes(parseInt(order?.status)) &&
155
161
  !order.review && (
156
162
  <TouchableOpacity