ordering-ui-react-native 0.21.28 → 0.21.29-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 (239) hide show
  1. package/package.json +7 -6
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/PaymentOptionsWebView/index.tsx +1 -0
  5. package/src/components/StripeMethodForm/index.tsx +6 -4
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/types/index.tsx +3 -1
  8. package/src/utils/index.tsx +2 -2
  9. package/themes/business/index.tsx +4 -0
  10. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
  11. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  12. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  13. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  14. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  15. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  16. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  17. package/themes/business/src/components/Chat/index.tsx +23 -14
  18. package/themes/business/src/components/DriverMap/index.tsx +36 -23
  19. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  20. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  21. package/themes/business/src/components/Home/index.tsx +5 -1
  22. package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
  23. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  24. package/themes/business/src/components/MapView/index.tsx +11 -7
  25. package/themes/business/src/components/MessagesOption/index.tsx +2 -1
  26. package/themes/business/src/components/NewOrderNotification/index.tsx +143 -101
  27. package/themes/business/src/components/OrderDetails/Business.tsx +50 -2
  28. package/themes/business/src/components/OrderDetails/Delivery.tsx +23 -11
  29. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +61 -54
  30. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +58 -24
  31. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  32. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
  33. package/themes/business/src/components/OrderSummary/index.tsx +240 -76
  34. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  35. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  36. package/themes/business/src/components/OrdersOption/index.tsx +125 -130
  37. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  38. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +36 -38
  39. package/themes/business/src/components/PreviousOrders/OrderList.tsx +18 -13
  40. package/themes/business/src/components/PreviousOrders/index.tsx +80 -66
  41. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  42. package/themes/business/src/components/PrinterSettings/index.tsx +279 -0
  43. package/themes/business/src/components/PrinterSettings/styles.tsx +17 -0
  44. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  45. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  46. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  47. package/themes/business/src/components/Sessions/index.tsx +187 -0
  48. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  49. package/themes/business/src/components/StoresList/index.tsx +5 -3
  50. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  51. package/themes/business/src/components/UserProfileForm/index.tsx +107 -53
  52. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  53. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  54. package/themes/business/src/components/shared/OInput.tsx +2 -0
  55. package/themes/business/src/hooks/useLocation.tsx +5 -4
  56. package/themes/business/src/types/index.tsx +15 -2
  57. package/themes/business/src/utils/index.tsx +5 -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/Checkout/index.tsx +6 -0
  62. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -4
  63. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  64. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  65. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  66. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  67. package/themes/original/index.tsx +9 -4
  68. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  69. package/themes/original/src/components/AddressForm/index.tsx +22 -12
  70. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  71. package/themes/original/src/components/AddressList/index.tsx +8 -4
  72. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  73. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  74. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  75. package/themes/original/src/components/BusinessBasicInformation/index.tsx +7 -10
  76. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  77. package/themes/original/src/components/BusinessController/index.tsx +18 -10
  78. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  79. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  80. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  81. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  82. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  83. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  84. package/themes/original/src/components/BusinessListingSearch/index.tsx +47 -358
  85. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  86. package/themes/original/src/components/BusinessPreorder/index.tsx +2 -3
  87. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  88. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  89. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  90. package/themes/original/src/components/BusinessProductsListing/index.tsx +35 -19
  91. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  92. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  93. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  94. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  95. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  97. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  98. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +24 -404
  99. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  100. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  101. package/themes/original/src/components/Cart/index.tsx +32 -9
  102. package/themes/original/src/components/CartContent/index.tsx +96 -58
  103. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  104. package/themes/original/src/components/Checkout/index.tsx +177 -68
  105. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  106. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  107. package/themes/original/src/components/DatePicker/index.tsx +33 -0
  108. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  109. package/themes/original/src/components/Favorite/index.tsx +4 -9
  110. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  111. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  112. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  113. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  114. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  115. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  116. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  117. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  118. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  119. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  120. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  121. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  122. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  123. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  124. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  125. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  126. package/themes/original/src/components/GoogleMap/index.tsx +6 -5
  127. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  128. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  129. package/themes/original/src/components/Home/index.tsx +2 -1
  130. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  131. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  132. package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -16
  133. package/themes/original/src/components/LoginForm/index.tsx +3 -3
  134. package/themes/original/src/components/Messages/index.tsx +9 -7
  135. package/themes/original/src/components/Messages/styles.tsx +1 -1
  136. package/themes/original/src/components/MomentOption/index.tsx +4 -3
  137. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  138. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +1 -0
  139. package/themes/original/src/components/MultiCheckout/index.tsx +208 -21
  140. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  141. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  142. package/themes/original/src/components/MyOrders/index.tsx +24 -29
  143. package/themes/original/src/components/NavBar/index.tsx +3 -1
  144. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  145. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  146. package/themes/original/src/components/Notifications/index.tsx +4 -8
  147. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  148. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
  149. package/themes/original/src/components/OrderDetails/index.tsx +706 -667
  150. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  151. package/themes/original/src/components/OrderProgress/index.tsx +28 -6
  152. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  153. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  154. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  155. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  156. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  157. package/themes/original/src/components/OrdersOption/index.tsx +3 -5
  158. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  159. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  160. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  161. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  162. package/themes/original/src/components/PaymentOptions/index.tsx +72 -6
  163. package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
  164. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  165. package/themes/original/src/components/ProductForm/index.tsx +68 -156
  166. package/themes/original/src/components/ProductItemAccordion/index.tsx +54 -44
  167. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  168. package/themes/original/src/components/ProductOptionSubOption/index.tsx +105 -91
  169. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  170. package/themes/original/src/components/Promotions/index.tsx +8 -11
  171. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  172. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  173. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  174. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  175. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  176. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  177. package/themes/original/src/components/SignupForm/index.tsx +61 -59
  178. package/themes/original/src/components/SingleOrderCard/index.tsx +3 -2
  179. package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
  180. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  181. package/themes/original/src/components/StripeCardsList/index.tsx +17 -36
  182. package/themes/original/src/components/StripeElementsForm/index.tsx +74 -59
  183. package/themes/original/src/components/StripeElementsForm/naked.tsx +47 -0
  184. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  185. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  186. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  187. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  188. package/themes/original/src/components/UserFormDetails/index.tsx +123 -75
  189. package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
  190. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  191. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  192. package/themes/original/src/components/Wallets/index.tsx +3 -4
  193. package/themes/original/src/components/Wallets/styles.tsx +1 -1
  194. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  195. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  196. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  197. package/themes/original/src/components/shared/OButton.tsx +5 -5
  198. package/themes/original/src/components/shared/OInput.tsx +1 -4
  199. package/themes/original/src/components/shared/OModal.tsx +12 -14
  200. package/themes/original/src/layouts/Container.tsx +5 -3
  201. package/themes/original/src/types/index.tsx +1 -0
  202. package/themes/original/src/utils/index.tsx +125 -1
  203. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  204. package/src/navigators/BottomNavigator.tsx +0 -117
  205. package/src/navigators/CheckoutNavigator.tsx +0 -66
  206. package/src/navigators/HomeNavigator.tsx +0 -202
  207. package/src/navigators/NavigationRef.tsx +0 -7
  208. package/src/navigators/RootNavigator.tsx +0 -269
  209. package/src/pages/Account.tsx +0 -34
  210. package/src/pages/AddressForm.tsx +0 -62
  211. package/src/pages/AddressList.tsx +0 -24
  212. package/src/pages/BusinessProductsList.tsx +0 -81
  213. package/src/pages/BusinessesListing.tsx +0 -43
  214. package/src/pages/CartList.tsx +0 -49
  215. package/src/pages/Checkout.tsx +0 -101
  216. package/src/pages/ForgotPassword.tsx +0 -24
  217. package/src/pages/Help.tsx +0 -23
  218. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  219. package/src/pages/HelpGuide.tsx +0 -23
  220. package/src/pages/HelpOrder.tsx +0 -23
  221. package/src/pages/Home.tsx +0 -36
  222. package/src/pages/IntroductoryTutorial.tsx +0 -170
  223. package/src/pages/Login.tsx +0 -47
  224. package/src/pages/MomentOption.tsx +0 -30
  225. package/src/pages/MultiCheckout.tsx +0 -31
  226. package/src/pages/MultiOrdersDetails.tsx +0 -27
  227. package/src/pages/MyOrders.tsx +0 -40
  228. package/src/pages/NetworkError.tsx +0 -24
  229. package/src/pages/NotFound.tsx +0 -22
  230. package/src/pages/OrderDetails.tsx +0 -25
  231. package/src/pages/ProductDetails.tsx +0 -55
  232. package/src/pages/Profile.tsx +0 -36
  233. package/src/pages/ReviewDriver.tsx +0 -30
  234. package/src/pages/ReviewOrder.tsx +0 -32
  235. package/src/pages/ReviewProducts.tsx +0 -30
  236. package/src/pages/Sessions.tsx +0 -22
  237. package/src/pages/Signup.tsx +0 -53
  238. package/src/pages/SpinnerLoader.tsx +0 -10
  239. package/src/pages/Splash.tsx +0 -21
@@ -6,18 +6,14 @@ import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
6
6
  import FeatherIcon from 'react-native-vector-icons/Feather';
7
7
  import FontistoIcon from 'react-native-vector-icons/Fontisto'
8
8
  import AntDesignIcon from 'react-native-vector-icons/AntDesign'
9
- import TrackPlayer, {
10
- RepeatMode,
11
- Capability,
12
- AppKilledPlaybackBehavior
13
- } from 'react-native-track-player';
14
9
 
15
10
  import { useTheme } from 'styled-components/native';
16
11
  import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
17
12
  import { NotificationSetting } from '../../../../../src/components/NotificationSetting'
18
13
  import { NewOrderNotification } from '../NewOrderNotification';
14
+ import { WebsocketStatus } from '../WebsocketStatus'
19
15
 
20
- import { OText, OButton, OModal, OIconButton, OInput, OIcon } from '../shared';
16
+ import { OText, OButton, OModal, OInput, OIcon } from '../shared';
21
17
  import { NotFoundSource } from '../NotFoundSource';
22
18
  import {
23
19
  FiltersTab,
@@ -54,6 +50,7 @@ const { useDeviceOrientation, PORTRAIT } = DeviceOrientationMethods
54
50
 
55
51
  const OrdersOptionUI = (props: OrdersOptionParams) => {
56
52
  const {
53
+ navigation,
57
54
  setCurrentFilters,
58
55
  tabs,
59
56
  currentTabSelected,
@@ -79,6 +76,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
79
76
 
80
77
  const defaultSearchList = {
81
78
  id: '',
79
+ external_id: '',
82
80
  state: '',
83
81
  city: '',
84
82
  business: '',
@@ -98,108 +96,11 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
98
96
  const [{ parseDate }] = useUtils()
99
97
  const [configState] = useConfig()
100
98
  const [orientationState] = useDeviceOrientation();
101
- const [, { showToast }] = useToast();
102
99
  const [openSearchModal, setOpenSearchModal] = useState(false)
103
100
  const [openSLASettingModal, setOpenSLASettingModal] = useState(false)
104
101
  const [slaSettingTime, setSlaSettingTime] = useState(6000)
105
102
  const [currentDeliveryType, setCurrentDeliveryType] = useState('Delivery')
106
103
  const [search, setSearch] = useState(defaultSearchList)
107
- const [selectedTabStatus, setSelectedTabStatus] = useState<any>([])
108
- const [hour, setHour] = useState(0)
109
- const [minute, setMinute] = useState(0)
110
- const [openedSelect, setOpenedSelect] = useState('')
111
- const WIDTH_SCREEN = orientationState?.dimensions?.width
112
- const HEIGHT_SCREEN = orientationState?.dimensions?.height
113
- const IS_PORTRAIT = orientationState.orientation === PORTRAIT
114
-
115
- const URL_SOUND = 'https://d33aymufw4jvwf.cloudfront.net/notification.mp3' ?? theme.sounds.notification
116
-
117
- const setupPlayer = async (options: any) => {
118
- const setup = async () => {
119
- try {
120
- await TrackPlayer.setupPlayer(options);
121
- } catch (error) {
122
- return (error as Error & { code?: string }).code;
123
- }
124
- }
125
- while ((await setup()) === 'android_cannot_setup_player_in_background') {
126
- await new Promise<void>((resolve) => setTimeout(resolve, 1));
127
- }
128
- };
129
-
130
- const SetupService = async () => {
131
- await setupPlayer({ autoHandleInterruptions: true });
132
- await TrackPlayer.updateOptions({
133
- android: {
134
- appKilledPlaybackBehavior:
135
- AppKilledPlaybackBehavior.StopPlaybackAndRemoveNotification,
136
- },
137
- capabilities: [
138
- Capability.Play,
139
- Capability.Pause,
140
- Capability.SkipToNext,
141
- Capability.SkipToPrevious,
142
- Capability.SeekTo,
143
- ],
144
- compactCapabilities: [
145
- Capability.Play,
146
- Capability.Pause,
147
- Capability.SkipToNext,
148
- ],
149
- progressUpdateEventInterval: 2,
150
- });
151
- await TrackPlayer.setRepeatMode(RepeatMode.Track);
152
- };
153
-
154
- const QueueInitialTracksService = async () => {
155
- await TrackPlayer.add([
156
- {
157
- id: 'notification',
158
- url: URL_SOUND,
159
- title: 'notification'
160
- },
161
- ]);
162
- }
163
-
164
- function useSetupPlayer() {
165
- const [playerReady, setPlayerReady] = useState<boolean>(false)
166
-
167
- useEffect(() => {
168
- let unmounted = false;
169
- (async () => {
170
- await SetupService()
171
- if (unmounted) return
172
- setPlayerReady(true)
173
- const queue = await TrackPlayer.getQueue()
174
- if (unmounted) return
175
- if (queue.length <= 0) {
176
- await QueueInitialTracksService()
177
- }
178
- })();
179
- return () => {
180
- unmounted = true;
181
- };
182
- }, []);
183
- return playerReady;
184
- }
185
-
186
- const isPlayerReady = useSetupPlayer()
187
-
188
- const preorderTypeList = [
189
- { key: null, name: t('SLA', 'SLA\'s') },
190
- { key: 'in_time', name: t('OK', 'Ok') },
191
- { key: 'at_risk', name: t('AT_RISK', 'At Risk') },
192
- { key: 'delayed', name: t('DELAYED', 'Delayed') }
193
- ]
194
-
195
- const defaultOrderTypes = [
196
- { key: 1, name: t('DELIVERY', 'Delivery') },
197
- { key: 2, name: t('PICKUP', 'Pickup') },
198
- { key: 3, name: t('EAT_IN', 'Eat in') },
199
- { key: 4, name: t('CURBSIDE', 'Curbside') },
200
- { key: 5, name: t('DRIVE_THRU', 'Drive thru') }
201
- ]
202
-
203
104
  const deliveryStatus = [
204
105
  {
205
106
  key: t('OK', 'Ok'),
@@ -223,6 +124,27 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
223
124
  backColor: '#E63757'
224
125
  }
225
126
  ]
127
+ const combineTabs = configState?.configs?.combine_pending_and_progress_orders?.value === '1'
128
+ const [selectedTabStatus, setSelectedTabStatus] = useState<any>(deliveryStatus)
129
+ const [openedSelect, setOpenedSelect] = useState('')
130
+
131
+ const HEIGHT_SCREEN = orientationState?.dimensions?.height
132
+ const IS_PORTRAIT = orientationState.orientation === PORTRAIT
133
+
134
+ const preorderTypeList = [
135
+ { key: null, name: t('SLA', 'SLA\'s') },
136
+ { key: 'in_time', name: t('OK', 'Ok') },
137
+ { key: 'at_risk', name: t('AT_RISK', 'At Risk') },
138
+ { key: 'delayed', name: t('DELAYED', 'Delayed') }
139
+ ]
140
+
141
+ const defaultOrderTypes = [
142
+ { key: 1, name: t('DELIVERY', 'Delivery') },
143
+ { key: 2, name: t('PICKUP', 'Pickup') },
144
+ { key: 3, name: t('EAT_IN', 'Eat in') },
145
+ { key: 4, name: t('CURBSIDE', 'Curbside') },
146
+ { key: 5, name: t('DRIVE_THRU', 'Drive thru') }
147
+ ]
226
148
 
227
149
  const styles = StyleSheet.create({
228
150
  header: {
@@ -464,15 +386,21 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
464
386
  setTags({ values: [] })
465
387
  }, [currentTabSelected])
466
388
 
467
- useEffect(() => {
468
- setSelectedTabStatus(deliveryStatus)
469
- }, [])
389
+ useEffect(() => {
390
+ const unsubcribe = navigation.addListener('focus', () => {
391
+ currentTabSelected === 'logisticOrders' ? loadLogisticOrders() : loadOrders && loadOrders({ newFetch: true })
392
+ })
393
+ return unsubcribe
394
+ }, [navigation, loadOrders, loadLogisticOrders])
470
395
 
471
396
  return (
472
397
  <>
473
398
  <View style={styles.header}>
474
399
  <OText style={styles.title}>{t('MY_ORDERS', 'My orders')}</OText>
475
400
  <IconWrapper>
401
+ <View style={{ marginRight: 10 }}>
402
+ <WebsocketStatus />
403
+ </View>
476
404
  <FeatherIcon
477
405
  name='refresh-cw'
478
406
  color={theme.colors.backgroundDark}
@@ -490,7 +418,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
490
418
  </View>
491
419
  {configState?.configs?.order_deadlines_enabled?.value === '1' && (
492
420
  <View style={styles.SLAwrapper}>
493
- <View style={{ flex: 0.5 }}>
421
+ {/* <View style={{ flex: 0.5 }}>
494
422
  <OButton
495
423
  text={t('SLA_SETTING', 'SLA’s Settings')}
496
424
  textStyle={{ color: theme.colors.backArrow }}
@@ -504,9 +432,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
504
432
  }}
505
433
  onClick={onClickSetting}
506
434
  />
507
- </View>
508
- <View style={{ width: 10, height: '100%' }} />
509
- <View style={{ flex: 0.5, justifyContent: 'center' }}>
435
+ </View> */}
436
+ {/* <View style={{ width: 10, height: '100%' }} /> */}
437
+ {/* <View style={{ flex: 0.5, justifyContent: 'center' }}>
510
438
  <SelectDropdown
511
439
  defaultButtonText={t('SLA', 'SLA\'s')}
512
440
  data={preorderTypeList}
@@ -536,7 +464,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
536
464
  );
537
465
  }}
538
466
  />
539
- </View>
467
+ </View> */}
540
468
  </View>
541
469
  )}
542
470
  <FiltersTab>
@@ -548,7 +476,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
548
476
  nestedScrollEnabled={true}
549
477
  >
550
478
  <TabsContainer>
551
- {(isLogisticActivated && !isBusinessApp) && (
479
+ {(isLogisticActivated && !isBusinessApp && !combineTabs) && (
552
480
  <Pressable
553
481
  style={styles.pressable}
554
482
  onPress={() => setCurrentTabSelected('logisticOrders')}>
@@ -689,6 +617,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
689
617
  orderTitle={props.orderDetailsProps?.orderTitle}
690
618
  handleChangeOrderStatus={handleChangeOrderStatus}
691
619
  handleSendCustomerReview={handleSendCustomerReview}
620
+ isBusinessApp={isBusinessApp}
692
621
  />
693
622
  )}
694
623
  {!logisticOrders?.error?.length &&
@@ -699,6 +628,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
699
628
  onNavigationRedirect={onNavigationRedirect}
700
629
  getOrderStatus={getOrderStatus}
701
630
  handleClickLogisticOrder={handleClickLogisticOrder}
631
+ isBusinessApp={isBusinessApp}
702
632
  isLogisticOrder
703
633
  />
704
634
  )
@@ -780,10 +710,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
780
710
  </View>
781
711
 
782
712
  {isBusinessApp && (
783
- <NewOrderNotification
784
- isBusinessApp={isBusinessApp}
785
- isPlayerReady={isPlayerReady}
786
- />
713
+ <NewOrderNotification isBusinessApp={isBusinessApp} />
787
714
  )}
788
715
 
789
716
  {(openSearchModal || openSLASettingModal) && (
@@ -797,6 +724,39 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
797
724
  {openSearchModal && (
798
725
  <SearchModalContent>
799
726
  <ModalTitle>{t('SEARCH_ORDERS', 'Search orders')}</ModalTitle>
727
+ <InputContainer style={{ marginBottom: 24 }}>
728
+ <SelectDropdown
729
+ defaultButtonText={search?.timeStatus
730
+ ? preorderTypeList.find(type => type.key === search?.timeStatus)?.name
731
+ : t('SLA', 'SLA\'s')}
732
+ data={preorderTypeList}
733
+ onSelect={(selectedItem, index) => {
734
+ setSearch({ ...search, timeStatus: selectedItem?.key })
735
+ }}
736
+ buttonTextAfterSelection={(selectedItem, index) => {
737
+ return selectedItem.name
738
+ }}
739
+ rowTextForSelection={(item, index) => {
740
+ return item.key
741
+ }}
742
+ buttonStyle={styles.selectOption}
743
+ buttonTextStyle={styles.buttonTextStyle}
744
+ renderDropdownIcon={isOpened => {
745
+ return <FeatherIcon name={isOpened ? 'chevron-up' : 'chevron-down'} color={'#444'} size={18} />;
746
+ }}
747
+ dropdownStyle={styles.dropdownStyle}
748
+ dropdownOverlayColor='transparent'
749
+ rowStyle={styles.rowStyle}
750
+ renderCustomizedRowChild={(item, index) => {
751
+ return (
752
+ <SlaOption>
753
+ {index !== 0 && <OrderStatus timeState={item?.key} />}
754
+ <View><OText size={14} color={'#748194'} >{item?.name}</OText></View>
755
+ </SlaOption>
756
+ );
757
+ }}
758
+ />
759
+ </InputContainer>
800
760
  <InputContainer>
801
761
  <OInput
802
762
  value={search.id}
@@ -812,6 +772,21 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
812
772
  onPress={() => setSearch({ ...search, id: '' })}
813
773
  />
814
774
  </InputContainer>
775
+ <InputContainer>
776
+ <OInput
777
+ value={search.external_id}
778
+ onChange={(value: any) => setSearch({ ...search, external_id: value })}
779
+ style={styles.inputStyle}
780
+ placeholder={t('EXTERNAL_ID', 'External id')}
781
+ autoCorrect={false}
782
+ />
783
+ <AntDesignIcon
784
+ name='close'
785
+ size={20}
786
+ style={{ position: 'absolute', right: 12, top: 13 }}
787
+ onPress={() => setSearch({ ...search, external_id: '' })}
788
+ />
789
+ </InputContainer>
815
790
  <OrdersOptionDate
816
791
  {...props}
817
792
  search={search}
@@ -1001,7 +976,7 @@ export const Timer = () => {
1001
976
  return (
1002
977
  <TimerInputWrapper>
1003
978
  <OText style={styles.settingTime} color={theme.colors.disabled}>{configs?.order_deadlines_delayed_time?.value}</OText>
1004
- <OText>{t('MIN', 'min')}</OText>
979
+ <OText>{t('TIME_MIN', 'min')}</OText>
1005
980
  </TimerInputWrapper>
1006
981
  )
1007
982
  }
@@ -1009,8 +984,8 @@ export const Timer = () => {
1009
984
  export const OrdersOption = (props: OrdersOptionParams) => {
1010
985
  const [, t] = useLanguage();
1011
986
  const [configState] = useConfig()
1012
- const theme = useTheme()
1013
987
  const [checkNotificationStatus, setCheckNotificationStatus] = useState({ open: false, checked: false })
988
+ const combineTabs = configState?.configs?.combine_pending_and_progress_orders?.value === '1'
1014
989
  const ordersProps = {
1015
990
  ...props,
1016
991
  UIComponent: OrdersOptionUI,
@@ -1097,32 +1072,52 @@ export const OrdersOption = (props: OrdersOptionParams) => {
1097
1072
  text: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
1098
1073
  }
1099
1074
  ],
1100
- tabs: [
1075
+ tabs: combineTabs ? [
1101
1076
  {
1102
1077
  key: 0,
1103
- text: t('PENDING', 'Pending'),
1104
- tags: props?.orderGroupStatusCustom?.pending ?? [0, 13],
1105
- title: 'pending'
1078
+ text: t('ACTIVE', 'Active'),
1079
+ tags: props?.orderGroupStatusCustom?.active ?? [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23],
1080
+ title: 'active',
1106
1081
  },
1107
1082
  {
1108
1083
  key: 1,
1109
- text: t('IN_PROGRESS', 'In Progress'),
1110
- tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23],
1111
- title: 'inProgress',
1112
- },
1113
- {
1114
- key: 2,
1115
1084
  text: t('COMPLETED', 'Completed'),
1116
1085
  tags: props?.orderGroupStatusCustom?.completed ?? [1, 11, 15],
1117
1086
  title: 'completed',
1118
1087
  },
1119
1088
  {
1120
- key: 3,
1089
+ key: 2,
1121
1090
  text: t('CANCELLED', 'Cancelled'),
1122
1091
  tags: props?.orderGroupStatusCustom?.cancelled ?? [2, 5, 6, 10, 12, 16, 17],
1123
1092
  title: 'cancelled',
1124
1093
  },
1125
- ]
1094
+ ] :
1095
+ [
1096
+ {
1097
+ key: 0,
1098
+ text: t('PENDING', 'Pending'),
1099
+ tags: props?.orderGroupStatusCustom?.pending ?? [0, 13],
1100
+ title: 'pending'
1101
+ },
1102
+ {
1103
+ key: 1,
1104
+ text: t('IN_PROGRESS', 'In Progress'),
1105
+ tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23],
1106
+ title: 'inProgress',
1107
+ },
1108
+ {
1109
+ key: 2,
1110
+ text: t('COMPLETED', 'Completed'),
1111
+ tags: props?.orderGroupStatusCustom?.completed ?? [1, 11, 15],
1112
+ title: 'completed',
1113
+ },
1114
+ {
1115
+ key: 3,
1116
+ text: t('CANCELLED', 'Cancelled'),
1117
+ tags: props?.orderGroupStatusCustom?.cancelled ?? [2, 5, 6, 10, 12, 16, 17],
1118
+ title: 'cancelled',
1119
+ },
1120
+ ]
1126
1121
  };
1127
1122
 
1128
1123
  return (<>
@@ -6,7 +6,7 @@ import { useTheme } from 'styled-components/native';
6
6
  import { Wrapper } from './styles';
7
7
  import { OText, OIcon } from '../shared';
8
8
  import { PhoneInputParams } from '../../types';
9
- import { transformCountryCode } from '../../utils';
9
+ import { transformCountryCode, findExitingCode } from '../../utils';
10
10
 
11
11
  export const PhoneInputNumber = (props: PhoneInputParams) => {
12
12
  const {
@@ -97,10 +97,13 @@ export const PhoneInputNumber = (props: PhoneInputParams) => {
97
97
  containerStyle={{ width: '100%' }}
98
98
  ref={phoneInput}
99
99
  defaultValue={userphoneNumber || defaultValue}
100
- defaultCode={
101
- defaultCode
102
- ? transformCountryCode(defaultCode)
103
- : configs?.default_country_code?.value
100
+ defaultCode={defaultCode ?
101
+ !isNaN(defaultCode)
102
+ ? transformCountryCode(defaultCode)
103
+ : findExitingCode(defaultCode)
104
+ : !isNaN((configs?.default_country_code?.value || '')?.replace(/\+/g, ''))
105
+ ? transformCountryCode((configs?.default_country_code?.value || '')?.replace(/\+/g, ''))
106
+ : findExitingCode(configs?.default_country_code?.value?.toUpperCase())
104
107
  }
105
108
  onChangeFormattedText={(text: string) => handleChangeNumber(text)}
106
109
  countryPickerProps={{
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { Platform, PlatformIOSStatic, StyleSheet, TouchableOpacity, View } from 'react-native';
2
+ import { Platform, PlatformIOSStatic, Pressable, StyleSheet, View } from 'react-native';
3
3
  import DeviceInfo from 'react-native-device-info';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import { useLanguage, useUtils, useConfig } from 'ordering-components/native';
@@ -47,6 +47,7 @@ export const OrderItem = React.memo((props: any) => {
47
47
  timer: configState?.configs?.order_deadlines_enabled?.value === '1',
48
48
  slaBar: configState?.configs?.order_deadlines_enabled?.value === '1',
49
49
  })
50
+ const showExternalId = configState?.configs?.change_order_id?.value === '1'
50
51
 
51
52
  const IS_PORTRAIT = orientationState.orientation === PORTRAIT
52
53
  const platformIOS = Platform as PlatformIOSStatic
@@ -76,7 +77,7 @@ export const OrderItem = React.memo((props: any) => {
76
77
  marginLeft: 3,
77
78
  },
78
79
  title: {
79
- marginBottom: 6,
80
+ marginBottom: showExternalId ? 0 : 6,
80
81
  fontFamily: 'Poppins',
81
82
  fontStyle: 'normal',
82
83
  fontWeight: '600',
@@ -84,7 +85,7 @@ export const OrderItem = React.memo((props: any) => {
84
85
  color: theme.colors.textGray,
85
86
  },
86
87
  date: {
87
- marginBottom: 6,
88
+ marginBottom: showExternalId ? 0 : 6,
88
89
  fontFamily: 'Poppins',
89
90
  fontStyle: 'normal',
90
91
  fontWeight: 'normal',
@@ -100,12 +101,13 @@ export const OrderItem = React.memo((props: any) => {
100
101
  });
101
102
 
102
103
  const getDelayMinutes = (order: any) => {
103
- const cdtToutc = moment(order?.delivery_datetime).utc().format('YYYY-MM-DD HH:mm:ss')
104
+ const offset = 300
105
+ const cdtToutc = moment(order?.delivery_datetime).add(offset, 'minutes').format('YYYY-MM-DD HH:mm:ss')
104
106
  const _delivery = order?.delivery_datetime_utc
105
- ? parseDate(order?.delivery_datetime_utc)
106
- : parseDate(cdtToutc)
107
+ ? parseDate(order?.delivery_datetime_utc, { outputFormat: 'YYYY-MM-DD HH:mm:ss' })
108
+ : parseDate(cdtToutc, { outputFormat: 'YYYY-MM-DD HH:mm:ss' })
107
109
  const _eta = order?.eta_time
108
- const diffTimeAsSeconds = moment(_delivery, 'YYYY-MM-DD hh:mm A').add(_eta, 'minutes').diff(moment().utc(), 'seconds')
110
+ const diffTimeAsSeconds = moment(_delivery).add(_eta, 'minutes').diff(moment().utc(), 'seconds')
109
111
  return Math.ceil(diffTimeAsSeconds / 60)
110
112
  }
111
113
 
@@ -119,7 +121,7 @@ export const OrderItem = React.memo((props: any) => {
119
121
  let restHours: string | number = Math.floor(restMinOfTargetedMin / 60)
120
122
  let restMins: string | number = restMinOfTargetedMin - 60 * restHours
121
123
  // make standard time format
122
- day = day === 0 ? '' : day + 'day '
124
+ day = day === 0 ? '' : `${day + ' ' + t('DAY', 'day') + ' '}`
123
125
  restHours = restHours < 10 ? '0' + restHours : restHours
124
126
  restMins = restMins < 10 ? '0' + restMins : restMins
125
127
 
@@ -127,12 +129,6 @@ export const OrderItem = React.memo((props: any) => {
127
129
  return finalTaget
128
130
  }
129
131
 
130
- const getStatusClassName = (minutes: number) => {
131
- if (isNaN(Number(minutes))) return 'in_time'
132
- const delayTime = configState?.configs?.order_deadlines_delayed_time?.value
133
- return minutes > 0 ? 'in_time' : Math.abs(minutes) <= delayTime ? 'at_risk' : 'delayed'
134
- }
135
-
136
132
  useEffect(() => {
137
133
  const slaSettings = configState?.configs?.order_deadlines_enabled?.value === '1'
138
134
  setAllowColumns({
@@ -143,8 +139,7 @@ export const OrderItem = React.memo((props: any) => {
143
139
  }, [configState.loading])
144
140
 
145
141
  return (
146
- <TouchableOpacity
147
- activeOpacity={1}
142
+ <Pressable
148
143
  disabled={order?.locked && isLogisticOrder}
149
144
  style={styles.cardButton}
150
145
  onPress={() => handlePressOrder({ ...order, logistic_order_id: _order?.id })}
@@ -152,24 +147,16 @@ export const OrderItem = React.memo((props: any) => {
152
147
  <Card key={order.id}>
153
148
  {!!allowColumns?.slaBar && (
154
149
  <Timestatus
155
- style={{
156
- backgroundColor: getStatusClassName(getDelayMinutes(order)) === 'in_time'
157
- ? '#00D27A'
158
- : getStatusClassName(getDelayMinutes(order)) === 'at_risk'
159
- ? '#FFC700'
160
- : getStatusClassName(getDelayMinutes(order)) === 'delayed'
161
- ? '#E63757'
162
- : ''
163
- }}
150
+ timeState={order?.time_status}
164
151
  />
165
152
  )}
166
153
  <Logo style={styles.logo}>
167
154
  <FastImage
168
155
  style={styles.icon}
169
- source={order.business?.logo ? {
170
- uri: optimizeImage(order.business?.logo, 'h_100,c_limit'),
156
+ source={order.business?.logo?.includes('https') ? {
157
+ uri: order.business?.logo,
171
158
  priority: FastImage.priority.normal,
172
- } : theme?.images?.dummies?.businessLogo}
159
+ } : order.business?.logo ?? theme?.images?.dummies?.businessLogo}
173
160
  resizeMode={FastImage.resizeMode.cover}
174
161
  />
175
162
  </Logo>
@@ -193,32 +180,43 @@ export const OrderItem = React.memo((props: any) => {
193
180
  />
194
181
  </NotificationIcon>
195
182
  )}
196
- <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
197
- <OText
183
+ <View style={{ flexDirection: `${showExternalId ? 'column' : 'row'}`, flexWrap: 'wrap' }}>
184
+ {!order?.order_group_id && showExternalId && !order?.order_group && (
185
+ <OText
186
+ style={styles.date}
187
+ color={theme.colors.unselectText}
188
+ numberOfLines={1}
189
+ adjustsFontSizeToFit
190
+ >
191
+ {order?.external_id ?? t('NO_EXTERNAL_ID', 'No external Id ') + t('NO', 'Order No.') + order?.id}
192
+ </OText>
193
+ )}
194
+ {!showExternalId && <OText
198
195
  style={styles.date}
199
196
  color={theme.colors.unselectText}
200
197
  numberOfLines={1}
201
198
  adjustsFontSizeToFit
202
199
  >
203
- {(!!order?.order_group_id && order?.order_group && isLogisticOrder
200
+ {((!!order?.order_group_id && order?.order_group && isLogisticOrder
204
201
  ? `${order?.order_group?.orders?.length} ${t('ORDERS', 'Orders')}`
205
- : (t('NO', 'Order No.') + order.id)
206
- ) + ' · '}
202
+ : (t('NO', 'Order No.') + order?.id)
203
+ ) + ' · ')}
207
204
  {order?.delivery_datetime_utc
208
205
  ? parseDate(order?.delivery_datetime_utc)
209
206
  : parseDate(order?.delivery_datetime, { utc: false })}
210
207
  </OText>
208
+ }
211
209
  {((currentTabSelected === 'pending' || currentTabSelected === 'inProgress') && allowColumns?.timer) && (
212
210
  <>
213
- <OText> · </OText>
211
+ {!showExternalId && <OText> · </OText>}
214
212
  <OText
215
213
  style={styles.date}
216
214
  color={
217
- getStatusClassName(getDelayMinutes(order)) === 'in_time'
215
+ order?.time_status === 'in_time'
218
216
  ? '#00D27A'
219
- : getStatusClassName(getDelayMinutes(order)) === 'at_risk'
217
+ : order?.time_status === 'at_risk'
220
218
  ? '#FFC700'
221
- : getStatusClassName(getDelayMinutes(order)) === 'delayed'
219
+ : order?.time_status === 'delayed'
222
220
  ? '#E63757'
223
221
  : ''}
224
222
  >
@@ -250,6 +248,6 @@ export const OrderItem = React.memo((props: any) => {
250
248
  )}
251
249
  </Information>
252
250
  </Card>
253
- </TouchableOpacity>
251
+ </Pressable>
254
252
  )
255
253
  }, OrderItemPropsAreEqual)
@@ -2,13 +2,13 @@ import React from 'react'
2
2
  import { View } from 'react-native'
3
3
  import { useTheme } from 'styled-components/native'
4
4
  import { OButton } from '../shared';
5
- import { useLanguage } from 'ordering-components/native'
5
+ import { useLanguage, useConfig } from 'ordering-components/native'
6
6
  import { OrderItem } from './OrderItem';
7
7
  import { AcceptOrRejectOrder as AcceptOrRejectOrderStyle } from './styles';
8
8
 
9
9
  function OrderListPropsAreEqual(prevProps: any, nextProps: any) {
10
10
  return JSON.stringify(prevProps.order) === JSON.stringify(nextProps.order) &&
11
- JSON.stringify(prevProps._order) === JSON.stringify(nextProps._order) &&
11
+ JSON.stringify(prevProps._order) === JSON.stringify(nextProps._order) &&
12
12
  JSON.stringify(prevProps.currentOrdenSelected) === JSON.stringify(nextProps.currentOrdenSelected) &&
13
13
  prevProps.currentTabSelected === nextProps.currentTabSelected
14
14
  }
@@ -28,6 +28,9 @@ export const OrdersList = React.memo((props: any) => {
28
28
 
29
29
  const theme = useTheme()
30
30
  const [, t] = useLanguage()
31
+ const [{ configs }] = useConfig();
32
+
33
+ const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1'
31
34
 
32
35
  return (
33
36
  <View
@@ -59,16 +62,18 @@ export const OrdersList = React.memo((props: any) => {
59
62
  />
60
63
  ) : (
61
64
  <>
62
- <OButton
63
- text={t('REJECT', 'Reject')}
64
- onClick={() => handleClickLogisticOrder(2, _order?.id)}
65
- bgColor={theme.colors.red}
66
- borderColor={theme.colors.red}
67
- imgRightSrc={null}
68
- style={{ borderRadius: 7, height: 40 }}
69
- parentStyle={{ width: '45%' }}
70
- textStyle={{ color: theme.colors.white }}
71
- />
65
+ {!isHideRejectButtons && (
66
+ <OButton
67
+ text={t('REJECT', 'Reject')}
68
+ onClick={() => handleClickLogisticOrder(2, _order?.id)}
69
+ bgColor={theme.colors.red}
70
+ borderColor={theme.colors.red}
71
+ imgRightSrc={null}
72
+ style={{ borderRadius: 7, height: 40 }}
73
+ parentStyle={{ width: '45%' }}
74
+ textStyle={{ color: theme.colors.white }}
75
+ />
76
+ )}
72
77
  <OButton
73
78
  text={t('ACCEPT', 'Accept')}
74
79
  onClick={() => handleClickLogisticOrder(1, _order?.id)}
@@ -76,7 +81,7 @@ export const OrdersList = React.memo((props: any) => {
76
81
  borderColor={theme.colors.green}
77
82
  imgRightSrc={null}
78
83
  style={{ borderRadius: 7, height: 40 }}
79
- parentStyle={{ width: '45%' }}
84
+ parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
80
85
  textStyle={{ color: theme.colors.white }}
81
86
  />
82
87
  </>