ordering-ui-react-native 0.16.67 → 0.16.68-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 (206) hide show
  1. package/package.json +6 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/index.tsx +61 -63
  4. package/src/components/ActiveOrders/styles.tsx +8 -14
  5. package/src/components/BusinessInformation/index.tsx +19 -4
  6. package/src/components/BusinessInformation/styles.tsx +2 -2
  7. package/src/components/BusinessProductsList/index.tsx +10 -10
  8. package/src/components/BusinessesListing/index.tsx +1 -1
  9. package/src/components/Checkout/index.tsx +2 -1
  10. package/src/components/LanguageSelector/index.tsx +21 -16
  11. package/src/components/Messages/index.tsx +2 -2
  12. package/src/components/NotificationSetting/index.tsx +85 -0
  13. package/src/components/OrdersOption/index.tsx +54 -56
  14. package/src/components/PaymentOptions/index.tsx +298 -345
  15. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  16. package/src/components/SingleProductReview/index.tsx +7 -4
  17. package/src/components/StripeElementsForm/index.tsx +25 -16
  18. package/src/components/VerifyPhone/styles.tsx +1 -2
  19. package/src/components/shared/OBottomPopup.tsx +6 -2
  20. package/src/components/shared/OToast.tsx +4 -4
  21. package/src/index.tsx +2 -0
  22. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  23. package/src/utils/index.tsx +2 -1
  24. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
  25. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  26. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  27. package/themes/business/src/components/Chat/index.tsx +31 -31
  28. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  29. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  30. package/themes/business/src/components/MapView/index.tsx +14 -3
  31. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  32. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  33. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +70 -43
  34. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  35. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  36. package/themes/business/src/components/OrdersOption/index.tsx +74 -76
  37. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  38. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  39. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  40. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  41. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  42. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  43. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  44. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  45. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  46. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  47. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  48. package/themes/business/src/components/PreviousOrders/index.tsx +440 -245
  49. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  50. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  51. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  52. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  53. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  54. package/themes/business/src/components/shared/OLink.tsx +33 -13
  55. package/themes/business/src/components/shared/OText.tsx +8 -2
  56. package/themes/business/src/types/index.tsx +22 -10
  57. package/themes/business/src/utils/index.tsx +10 -0
  58. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  59. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  60. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  61. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  62. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  63. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  64. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  65. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  66. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  67. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  68. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  69. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  70. package/themes/kiosk/src/types/index.d.ts +2 -0
  71. package/themes/original/index.tsx +8 -0
  72. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  73. package/themes/original/src/components/AddressForm/index.tsx +153 -137
  74. package/themes/original/src/components/AddressList/index.tsx +18 -18
  75. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  76. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  77. package/themes/original/src/components/BusinessBasicInformation/index.tsx +49 -33
  78. package/themes/original/src/components/BusinessController/index.tsx +101 -70
  79. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  80. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  81. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  82. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  83. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  84. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  85. package/themes/original/src/components/BusinessListingSearch/index.tsx +87 -142
  86. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  87. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  88. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  89. package/themes/original/src/components/BusinessProductsList/index.tsx +54 -60
  90. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  91. package/themes/original/src/components/BusinessProductsListing/index.tsx +561 -477
  92. package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
  93. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  94. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  95. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +93 -98
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  97. package/themes/original/src/components/BusinessesListing/index.tsx +13 -8
  98. package/themes/original/src/components/Cart/index.tsx +63 -38
  99. package/themes/original/src/components/CartContent/index.tsx +80 -18
  100. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  101. package/themes/original/src/components/Checkout/index.tsx +110 -114
  102. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  103. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  104. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  105. package/themes/original/src/components/DriverTips/index.tsx +47 -37
  106. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  107. package/themes/original/src/components/Favorite/index.tsx +7 -4
  108. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  109. package/themes/original/src/components/FavoriteList/index.tsx +69 -45
  110. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  111. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  112. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  113. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  114. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  115. package/themes/original/src/components/Help/index.tsx +7 -7
  116. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
  117. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  118. package/themes/original/src/components/HelpGuide/index.tsx +12 -11
  119. package/themes/original/src/components/HelpGuide/styles.tsx +5 -0
  120. package/themes/original/src/components/HelpOrder/index.tsx +12 -20
  121. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  122. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  123. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  124. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  125. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  126. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  127. package/themes/original/src/components/MessageListing/index.tsx +7 -7
  128. package/themes/original/src/components/Messages/index.tsx +35 -20
  129. package/themes/original/src/components/MomentOption/index.tsx +17 -11
  130. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  131. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  132. package/themes/original/src/components/MultiCheckout/index.tsx +158 -77
  133. package/themes/original/src/components/MultiOrdersDetails/index.tsx +60 -33
  134. package/themes/original/src/components/MyOrders/index.tsx +86 -20
  135. package/themes/original/src/components/NavBar/index.tsx +7 -6
  136. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  137. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  138. package/themes/original/src/components/Notifications/index.tsx +144 -0
  139. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  140. package/themes/original/src/components/OrderDetails/index.tsx +114 -15
  141. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  142. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  143. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  144. package/themes/original/src/components/OrderProgress/index.tsx +77 -66
  145. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  146. package/themes/original/src/components/OrderSummary/index.tsx +3 -36
  147. package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
  148. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
  149. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  150. package/themes/original/src/components/OrdersOption/index.tsx +97 -55
  151. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  152. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  153. package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
  154. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  155. package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
  156. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  157. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  158. package/themes/original/src/components/ProductForm/index.tsx +212 -253
  159. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  160. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  161. package/themes/original/src/components/ProductOptionSubOption/index.tsx +17 -9
  162. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
  163. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  164. package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
  165. package/themes/original/src/components/Promotions/index.tsx +234 -220
  166. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  167. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  168. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  169. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  170. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  171. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  172. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  173. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  174. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  175. package/themes/original/src/components/ServiceForm/index.tsx +328 -264
  176. package/themes/original/src/components/SignupForm/index.tsx +134 -89
  177. package/themes/original/src/components/SingleOrderCard/index.tsx +129 -54
  178. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  179. package/themes/original/src/components/SingleProductCard/index.tsx +101 -85
  180. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -9
  181. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  182. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  183. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  184. package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
  185. package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
  186. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  187. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  188. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  189. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  190. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  191. package/themes/original/src/components/UserProfileForm/index.tsx +19 -28
  192. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  193. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  194. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  195. package/themes/original/src/components/Wallets/index.tsx +176 -164
  196. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  197. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  198. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  199. package/themes/original/src/components/shared/OBottomPopup.tsx +6 -4
  200. package/themes/original/src/components/shared/OButton.tsx +9 -4
  201. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  202. package/themes/original/src/components/shared/OInput.tsx +10 -1
  203. package/themes/original/src/layouts/Container.tsx +13 -9
  204. package/themes/original/src/types/index.tsx +55 -5
  205. package/themes/original/src/utils/index.tsx +103 -58
  206. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,24 +1,79 @@
1
1
  import React, { useEffect, useState } from 'react'
2
- import { View } from 'react-native'
3
- import { PlaceSpot as PlaceSpotController, useLanguage } from 'ordering-components/native'
2
+ import { View, StyleSheet } from 'react-native'
3
+ import { PlaceSpot as PlaceSpotController, useLanguage, useOrder, useToast, ToastType } from 'ordering-components/native'
4
4
  import { PlaceGroupContainer, PlaceSpotContainer } from './styles'
5
5
  import { NotFoundSource } from '../NotFoundSource'
6
- import { OText, ODropDown } from '../shared'
6
+ import { OText, ODropDown, OInput, OButton } from '../shared'
7
7
  import { Placeholder, PlaceholderLine } from 'rn-placeholder'
8
8
  import { PlaceSpotParams } from '../../types'
9
+ import { useTheme } from 'styled-components/native'
10
+ import SelectDropdown from 'react-native-select-dropdown'
11
+ import IconAntDesign from 'react-native-vector-icons/AntDesign'
9
12
 
10
13
  const PlaceSpotUI = (props: PlaceSpotParams) => {
11
14
  const {
12
- isOpenPlaceSpot,
13
15
  cart,
16
+ orderTypes,
14
17
  placesState,
15
18
  handleChangePlace,
16
- getPlacesList,
17
- setOpenPlaceModal
19
+ spotNumber,
20
+ spotState,
21
+ isCheckout,
22
+ vehicle,
23
+ isInputMode,
24
+ setSpotNumber,
25
+ setVehicle,
26
+ handleChangeSpot,
27
+ setPlaceSpotNumber
18
28
  } = props
19
29
 
30
+ const theme = useTheme()
20
31
  const [, t] = useLanguage()
32
+ const [orderState] = useOrder()
33
+ const [, { showToast }] = useToast();
34
+
21
35
  const [placeGroupSelected, setPlaceGroupSelected] = useState<any>(null)
36
+ const vehicleInputAllowed = [4, 5]
37
+
38
+ const currentOrderType = isCheckout ? orderState?.options?.type : cart?.delivery_type
39
+ const isEatin = currentOrderType === 3
40
+ const isDriveThru = currentOrderType === 5
41
+ const placeholderText = isEatin
42
+ ? t('EATIN_SPOT_NUMBER', 'Table number')
43
+ : isDriveThru
44
+ ? t('DRIVE_THRU_SPOT_NUMBER', 'Drive thru lane')
45
+ : t('CURBSIDE_SPOT_NUMBER', 'Spot number')
46
+
47
+ const styles = StyleSheet.create({
48
+ selectOption: {
49
+ backgroundColor: theme.colors.backgroundGray100,
50
+ borderRadius: 7.6,
51
+ paddingVertical: 10,
52
+ paddingHorizontal: 14,
53
+ flexDirection: 'row-reverse',
54
+ alignItems: 'center',
55
+ justifyContent: 'space-between',
56
+ height: 50,
57
+ width: '100%'
58
+ },
59
+ optionWrapper: {
60
+ marginBottom: 20
61
+ }
62
+ })
63
+
64
+ const vehicleTypeList: any = [
65
+ { key: 'car', text: t('VEHICLE_TYPE_CAR', 'Car') },
66
+ { key: 'truck', text: t('VEHICLE_TYPE_TRUCK', 'Truck') },
67
+ { key: 'suv', text: t('VEHICLE_TYPE_SUV', 'SUV') },
68
+ { key: 'van', text: t('VEHICLE_TYPE_VAN', 'Van') },
69
+ { key: 'motorcycle', text: t('VEHICLE_TYPE_MOTORCYCLE', 'Motorcycle') }
70
+ ]
71
+
72
+ const vehicleInputList = [
73
+ { key: 'model', text: t('VEHICLE_MODEL', 'Model') },
74
+ { key: 'car_registration', text: t('VEHICLE_CAR_REGISTRATION', 'Car registration') },
75
+ { key: 'color', text: t('VEHICLE_COLOR', 'Color') }
76
+ ]
22
77
 
23
78
  const getPlacesGroups = () => {
24
79
  const groups = placesState.placeGroups?.filter((group: any) => group?.enabled && placesState?.places?.find((place: any) => place?.enabled && place?.place_group_id === group?.id))
@@ -39,10 +94,37 @@ const PlaceSpotUI = (props: PlaceSpotParams) => {
39
94
  }
40
95
 
41
96
  const handlerChangePlace = (place: any) => {
42
- setOpenPlaceModal(false)
43
97
  handleChangePlace(place)
44
98
  }
45
99
 
100
+ const onChangeSpot = () => {
101
+ if (orderState.loading) return
102
+ if (!Number.isInteger(Number(spotNumber))) {
103
+ showToast(ToastType.Error, t('VALIDATION_ERROR_INTEGER', 'The _attribute_ must be an integer.').replace('_attribute_', placeholderText))
104
+ return
105
+ }
106
+ if (Number(spotNumber) < 0) {
107
+ showToast(ToastType.Error, t('VALIDATION_MUST_BIGGER_ZERO', '_attribute_ must be bigger than zero').replace('_attribute_', placeholderText))
108
+ return
109
+ }
110
+ const isVehicle = Object.values(vehicle).every(e => e)
111
+ const bodyToSend: any = {}
112
+ spotNumber && (bodyToSend.spot_number = spotNumber)
113
+ isVehicle && (bodyToSend.vehicle = vehicle)
114
+
115
+ if (Object.keys(bodyToSend).length) {
116
+ handleChangeSpot({ bodyToSend, isCheckout: !!isCheckout })
117
+ }
118
+ }
119
+
120
+ const manageErrorsToShow = (array = []) => {
121
+ let stringError = ''
122
+ const list = Array.isArray(array) ? array : Object.values(array)
123
+ list.map((item: any, i: number) => {
124
+ stringError += (i + 1) === array.length ? `- ${item?.message || item}` : `- ${item?.message || item}\n`
125
+ })
126
+ return stringError;
127
+ }
46
128
 
47
129
  useEffect(() => {
48
130
  if (!placesState?.loading) {
@@ -52,51 +134,162 @@ const PlaceSpotUI = (props: PlaceSpotParams) => {
52
134
  }, [placesState])
53
135
 
54
136
  useEffect(() => {
55
- getPlacesList()
56
- }, [isOpenPlaceSpot])
137
+ if (spotState?.error?.length > 0) {
138
+ const errorText = manageErrorsToShow(spotState?.error)
139
+ showToast(ToastType.Error, errorText)
140
+ }
141
+ }, [spotState?.error])
142
+
143
+ const onChangePlaceSpot = (value: string) => {
144
+ setSpotNumber(value)
145
+ setPlaceSpotNumber(value)
146
+ }
57
147
 
58
148
  return (
59
149
  <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} />
150
+ {isInputMode ? (
151
+ <PlaceGroupContainer>
152
+ <OText color={theme.colors.textNormal} size={16} weight='500' mBottom={15}>{orderTypes[currentOrderType]}</OText>
153
+ {vehicleInputAllowed.includes(currentOrderType) && (
154
+ <>
155
+ <View style={styles.optionWrapper}>
156
+ <OText color={theme.colors.textNormal} size={12} mBottom={5}>{t('VEHICLE_TYPE', 'Vehicle type')}</OText>
157
+ <SelectDropdown
158
+ defaultButtonText={t('SELECT_AN_OPTION', 'Select an option')}
159
+ data={vehicleTypeList}
160
+ defaultValue={vehicle?.type ? vehicleTypeList.find((obj: any) => obj.key === vehicle.type) : null}
161
+ onSelect={(selectedItem, index) => {
162
+ setVehicle({ ...vehicle, type: selectedItem.key ?? '' })
163
+ }}
164
+ buttonTextAfterSelection={(selectedItem, index) => {
165
+ return selectedItem.text
166
+ }}
167
+ rowTextForSelection={(item, index) => {
168
+ return item.text
169
+ }}
170
+ buttonStyle={styles.selectOption}
171
+ buttonTextStyle={{
172
+ color: theme.colors.disabled,
173
+ fontSize: 14,
174
+ textAlign: 'left',
175
+ marginHorizontal: 0
176
+ }}
177
+ dropdownStyle={{
178
+ borderRadius: 8,
179
+ borderColor: theme.colors.lightGray
180
+ }}
181
+ rowStyle={{
182
+ borderBottomColor: theme.colors.backgroundGray100,
183
+ backgroundColor: theme.colors.backgroundGray100,
184
+ height: 40,
185
+ flexDirection: 'column',
186
+ alignItems: 'flex-start',
187
+ paddingTop: 8,
188
+ paddingHorizontal: 14
189
+ }}
190
+ rowTextStyle={{
191
+ color: theme.colors.disabled,
192
+ fontSize: 14,
193
+ marginHorizontal: 0
194
+ }}
195
+ renderDropdownIcon={() => {
196
+ return (
197
+ <IconAntDesign
198
+ name='down'
199
+ color={theme.colors.textThird}
200
+ size={16}
201
+ />
202
+ )
203
+ }}
204
+ />
205
+ </View>
206
+ {vehicleInputList.map((input: any) => (
207
+ <View key={input.key}>
208
+ <OText color={theme.colors.textNormal} size={12} mBottom={5}>{input.text}</OText>
209
+ <OInput
210
+ placeholder={input.text}
211
+ value={vehicle[input.key] ?? ''}
212
+ onChange={(value: string) => setVehicle({ ...vehicle, [input.key]: value })}
213
+ style={{
214
+ borderColor: theme.colors.border,
215
+ borderRadius: 7.6,
216
+ marginBottom: 20
217
+ }}
218
+ inputStyle={{ fontSize: 12, color: theme.colors.textNormal }}
219
+ />
220
+ </View>
221
+ ))}
222
+ </>
223
+ )}
224
+ <OText color={theme.colors.textNormal} size={12} mBottom={5}>{placeholderText}</OText>
225
+ <OInput
226
+ value={spotNumber?.toString() ?? ''}
227
+ placeholder={placeholderText}
228
+ type='number-pad'
229
+ onChange={(value: string) => onChangePlaceSpot(value)}
230
+ style={{
231
+ borderColor: theme.colors.border,
232
+ borderRadius: 7.6
233
+ }}
234
+ inputStyle={{ fontSize: 12, color: theme.colors.textNormal }}
235
+ />
236
+ <View style={{ alignItems: 'flex-start' }}>
237
+ <OButton
238
+ onClick={() => onChangeSpot()}
239
+ bgColor={theme.colors.primary}
240
+ borderColor={theme.colors.primary}
241
+ textStyle={{ color: 'white', fontSize: 12 }}
242
+ imgRightSrc={null}
243
+ text={t('UPDATE_SPOT_NUMBER', 'Update')}
244
+ isDisabled={(!spotNumber && !Object.values(vehicle).every(e => e))}
245
+ style={{ borderRadius: 7.6, height: 44, shadowOpacity: 0, marginTop: 20 }}
246
+ />
74
247
  </View>
75
- </Placeholder>
76
- )}
77
- {!(placesState.error || placesState?.placeGroups?.length === 0) && !placesState?.loading && (
248
+ </PlaceGroupContainer>
249
+ ) : (
78
250
  <>
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
251
+ {(placesState.error || placesState?.placeGroups?.length === 0) && !placesState?.loading && (
252
+ <NotFoundSource
253
+ content={t('NO_PLACES_THIS_BUSINESS', 'There are not places for this business')}
87
254
  />
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>
255
+ )}
256
+ {placesState?.loading && (
257
+ <Placeholder>
258
+ <PlaceGroupContainer>
259
+ <PlaceholderLine width={100} height={25} />
260
+ <PlaceholderLine height={30} />
261
+ </PlaceGroupContainer>
262
+ <View>
263
+ <PlaceholderLine width={120} height={25} />
264
+ <PlaceholderLine height={30} />
265
+ </View>
266
+ </Placeholder>
267
+ )}
268
+ {!(placesState.error || placesState?.placeGroups?.length === 0) && !placesState?.loading && (
269
+ <>
270
+ <PlaceGroupContainer>
271
+ <OText size={16} mBottom={10}>{t('PLACE_GROUP', 'Place group')}</OText>
272
+ <ODropDown
273
+ placeholder={t('PLACE_GROUP', 'Place group')}
274
+ options={getPlacesGroups()}
275
+ onSelect={(group: any) => setPlaceGroupSelected(group)}
276
+ defaultValue={placeGroupSelected ?? cart?.place}
277
+ isModal
278
+ />
279
+ </PlaceGroupContainer>
280
+ {placeGroupSelected && (
281
+ <View>
282
+ <OText size={16} mBottom={10}>{t('SELECT_YOUR_SPOT', 'Select your spot')}</OText>
283
+ <ODropDown
284
+ onSelect={(place: any) => handlerChangePlace(place)}
285
+ placeholder={t('SELECT_YOUR_SPOT', 'Select your spot')}
286
+ options={getPlaces()}
287
+ defaultValue={placesState?.places?.find((place: any) => place?.id === cart?.place_id)}
288
+ isModal
289
+ />
290
+ </View>
291
+ )}
292
+ </>
100
293
  )}
101
294
  </>
102
295
  )}
@@ -105,9 +298,18 @@ const PlaceSpotUI = (props: PlaceSpotParams) => {
105
298
  }
106
299
 
107
300
  export const PlaceSpot = (props: PlaceSpotParams) => {
301
+ const [, t] = useLanguage()
302
+
108
303
  const placeSpotProps = {
109
304
  ...props,
110
- UIComponent: PlaceSpotUI
305
+ UIComponent: PlaceSpotUI,
306
+ orderTypes: {
307
+ 1: t('DELIVERY', 'Delivery'),
308
+ 2: t('PICKUP', 'Pickup'),
309
+ 3: t('EAT_IN', 'Eat in'),
310
+ 4: t('CURBSIDE', 'Curbside'),
311
+ 5: t('DRIVE_THRU', 'Drive thru')
312
+ }
111
313
  }
112
314
 
113
315
  return <PlaceSpotController {...placeSpotProps} />
@@ -1,8 +1,6 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const PlaceSpotContainer = styled.View`
4
- min-height: 300px;
5
- padding: 20px;
6
4
  `
7
5
 
8
6
  export const PlaceGroupContainer = styled.View`
@@ -19,7 +19,8 @@ export const PreviousOrders = (props: PreviousOrdersParams) => {
19
19
  handleReorder,
20
20
  reorderLoading,
21
21
  orderID,
22
- handleUpdateOrderList
22
+ handleUpdateOrderList,
23
+ loading
23
24
  } = props;
24
25
 
25
26
  const theme = useTheme();
@@ -42,7 +43,7 @@ export const PreviousOrders = (props: PreviousOrdersParams) => {
42
43
  handleUpdateOrderList={handleUpdateOrderList}
43
44
  />
44
45
  ))}
45
- {pagination.totalPages && pagination.currentPage < pagination.totalPages && (
46
+ {!loading && pagination.totalPages && pagination.currentPage < pagination.totalPages && (
46
47
  <WrappButton>
47
48
  <OButton
48
49
  onClick={loadMoreOrders}