ordering-ui-react-native 0.12.55 → 0.12.59

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 (202) hide show
  1. package/package.json +1 -1
  2. package/src/components/Cart/index.tsx +50 -16
  3. package/src/components/OrderDetails/index.tsx +8 -0
  4. package/src/components/OrderSummary/index.tsx +38 -3
  5. package/src/layouts/Container.tsx +1 -1
  6. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +8 -0
  7. package/themes/business/src/components/OrderDetails/styles.tsx +1 -0
  8. package/themes/business/src/layouts/Container.tsx +3 -1
  9. package/themes/doordash/src/components/Cart/index.tsx +37 -2
  10. package/themes/doordash/src/components/OrderDetails/index.tsx +8 -0
  11. package/themes/doordash/src/components/OrderSummary/index.tsx +37 -3
  12. package/themes/doordash/src/layouts/Container.tsx +1 -1
  13. package/themes/instacart/src/components/Cart/index.tsx +37 -3
  14. package/themes/instacart/src/components/OrderDetails/index.tsx +8 -0
  15. package/themes/instacart/src/components/OrderSummary/index.tsx +37 -4
  16. package/themes/instacart/src/layouts/Container.tsx +1 -1
  17. package/themes/kiosk/src/layouts/Container.tsx +2 -1
  18. package/themes/original/src/components/Cart/index.tsx +268 -234
  19. package/themes/original/src/components/OrderDetails/index.tsx +723 -715
  20. package/themes/original/src/components/OrderSummary/index.tsx +37 -3
  21. package/themes/original/src/layouts/Container.tsx +1 -1
  22. package/themes/single-business/src/components/Cart/index.tsx +127 -16
  23. package/themes/single-business/src/components/Cart/styles.tsx +39 -0
  24. package/themes/single-business/src/components/CartContent/index.tsx +56 -52
  25. package/themes/single-business/src/components/CartContent/styles.tsx +2 -16
  26. package/themes/single-business/src/components/OrderDetails/index.tsx +724 -708
  27. package/themes/single-business/src/components/OrderSummary/index.tsx +189 -154
  28. package/themes/single-business/src/layouts/Container.tsx +1 -1
  29. package/themes/uber-eats/src/components/Cart/index.tsx +37 -3
  30. package/themes/uber-eats/src/components/OrderDetails/index.tsx +8 -0
  31. package/themes/uber-eats/src/components/OrderSummary/index.tsx +40 -6
  32. package/themes/uber-eats/src/layouts/Container.tsx +1 -1
  33. package/themes/franchises/index.tsx +0 -111
  34. package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
  35. package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
  36. package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
  37. package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
  38. package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
  39. package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
  40. package/themes/franchises/src/components/AddressList/index.tsx +0 -338
  41. package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
  42. package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
  43. package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
  44. package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
  45. package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
  46. package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
  47. package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
  48. package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
  49. package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
  50. package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
  51. package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
  52. package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
  53. package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
  54. package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
  55. package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
  56. package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
  57. package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
  58. package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
  59. package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
  60. package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
  61. package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
  62. package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
  63. package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
  64. package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
  65. package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
  66. package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
  67. package/themes/franchises/src/components/Cart/index.tsx +0 -298
  68. package/themes/franchises/src/components/Cart/styles.tsx +0 -28
  69. package/themes/franchises/src/components/CartContent/index.tsx +0 -60
  70. package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
  71. package/themes/franchises/src/components/Checkout/index.tsx +0 -664
  72. package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
  73. package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
  74. package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
  75. package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
  76. package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
  77. package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
  78. package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
  79. package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
  80. package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
  81. package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
  82. package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
  83. package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
  84. package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
  85. package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
  86. package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
  87. package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
  88. package/themes/franchises/src/components/Help/index.tsx +0 -56
  89. package/themes/franchises/src/components/Help/styles.tsx +0 -11
  90. package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
  91. package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
  92. package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
  93. package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
  94. package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
  95. package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
  96. package/themes/franchises/src/components/Home/index.tsx +0 -102
  97. package/themes/franchises/src/components/Home/styles.tsx +0 -18
  98. package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
  99. package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
  100. package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
  101. package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
  102. package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
  103. package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
  104. package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
  105. package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
  106. package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
  107. package/themes/franchises/src/components/Messages/index.tsx +0 -359
  108. package/themes/franchises/src/components/Messages/styles.tsx +0 -20
  109. package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
  110. package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
  111. package/themes/franchises/src/components/NavBar/index.tsx +0 -129
  112. package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
  113. package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
  114. package/themes/franchises/src/components/Notifications/index.tsx +0 -120
  115. package/themes/franchises/src/components/Notifications/styles.ts +0 -21
  116. package/themes/franchises/src/components/OrderDetails/index.tsx +0 -820
  117. package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
  118. package/themes/franchises/src/components/OrderSummary/index.tsx +0 -232
  119. package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
  120. package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
  121. package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
  122. package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
  123. package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
  124. package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
  125. package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
  126. package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
  127. package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
  128. package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
  129. package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
  130. package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
  131. package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
  132. package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
  133. package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
  134. package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
  135. package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
  136. package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
  137. package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
  138. package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
  139. package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
  140. package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
  141. package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
  142. package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
  143. package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
  144. package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
  145. package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
  146. package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
  147. package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
  148. package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
  149. package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
  150. package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
  151. package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
  152. package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
  153. package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
  154. package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
  155. package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
  156. package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
  157. package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
  158. package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
  159. package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
  160. package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
  161. package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
  162. package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
  163. package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
  164. package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
  165. package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
  166. package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
  167. package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
  168. package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
  169. package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
  170. package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
  171. package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
  172. package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
  173. package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
  174. package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
  175. package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
  176. package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
  177. package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
  178. package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
  179. package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
  180. package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
  181. package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
  182. package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
  183. package/themes/franchises/src/components/shared/OButton.tsx +0 -132
  184. package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
  185. package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
  186. package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
  187. package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
  188. package/themes/franchises/src/components/shared/OInput.tsx +0 -113
  189. package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
  190. package/themes/franchises/src/components/shared/OModal.tsx +0 -172
  191. package/themes/franchises/src/components/shared/OText.tsx +0 -52
  192. package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
  193. package/themes/franchises/src/components/shared/OToast.tsx +0 -93
  194. package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
  195. package/themes/franchises/src/components/shared/index.tsx +0 -29
  196. package/themes/franchises/src/config/constants.tsx +0 -57
  197. package/themes/franchises/src/layouts/Container.tsx +0 -23
  198. package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
  199. package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
  200. package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
  201. package/themes/franchises/src/types/index.tsx +0 -445
  202. package/themes/franchises/src/utils/index.tsx +0 -222
@@ -4,37 +4,37 @@ import Spinner from 'react-native-loading-spinner-overlay';
4
4
  import LinearGradient from 'react-native-linear-gradient';
5
5
  import { Messages } from '../Messages';
6
6
  import {
7
- useLanguage,
8
- OrderDetails as OrderDetailsConTableoller,
9
- useUtils,
10
- useConfig,
11
- useSession,
7
+ useLanguage,
8
+ OrderDetails as OrderDetailsConTableoller,
9
+ useUtils,
10
+ useConfig,
11
+ useSession,
12
12
  } from 'ordering-components/native';
13
13
  import { useTheme } from 'styled-components/native';
14
14
  import {
15
- OrderDetailsContainer,
16
- Header,
17
- OrderContent,
18
- OrderBusiness,
19
- Logo,
20
- OrderData,
21
- OrderInfo,
22
- OrderStatus,
23
- StaturBar,
24
- StatusImage,
25
- OrderCustomer,
26
- CustomerPhoto,
27
- InfoBlock,
28
- HeaderInfo,
29
- Customer,
30
- OrderProducts,
31
- Table,
32
- OrderBill,
33
- Total,
34
- NavBack,
35
- Icons,
36
- OrderDriver,
37
- Map,
15
+ OrderDetailsContainer,
16
+ Header,
17
+ OrderContent,
18
+ OrderBusiness,
19
+ Logo,
20
+ OrderData,
21
+ OrderInfo,
22
+ OrderStatus,
23
+ StaturBar,
24
+ StatusImage,
25
+ OrderCustomer,
26
+ CustomerPhoto,
27
+ InfoBlock,
28
+ HeaderInfo,
29
+ Customer,
30
+ OrderProducts,
31
+ Table,
32
+ OrderBill,
33
+ Total,
34
+ NavBack,
35
+ Icons,
36
+ OrderDriver,
37
+ Map,
38
38
  } from './styles';
39
39
  import { OButton, OIcon, OModal, OText } from '../shared';
40
40
  import { ProductItemAccordion } from '../ProductItemAccordion';
@@ -48,286 +48,286 @@ import AntIcon from 'react-native-vector-icons/AntDesign'
48
48
  import { TaxInformation } from '../TaxInformation';
49
49
 
50
50
  export const OrderDetailsUI = (props: OrderDetailsParams) => {
51
- const {
52
- navigation,
53
- messages,
54
- setMessages,
55
- readMessages,
56
- messagesReadList,
57
- isFromCheckout,
58
- driverLocation,
59
- } = props;
51
+ const {
52
+ navigation,
53
+ messages,
54
+ setMessages,
55
+ readMessages,
56
+ messagesReadList,
57
+ isFromCheckout,
58
+ driverLocation,
59
+ } = props;
60
60
 
61
- const theme = useTheme();
61
+ const theme = useTheme();
62
62
 
63
- const styles = StyleSheet.create({
64
- rowDirection: {
65
- flexDirection: 'row',
66
- },
67
- statusBar: {
68
- height: 12,
69
- },
70
- logo: {
71
- width: 75,
72
- height: 75,
73
- borderRadius: 10,
74
- },
75
- textBold: {
76
- fontWeight: 'bold',
77
- },
78
- btnBackArrow: {
79
- borderWidth: 0,
80
- backgroundColor: theme.colors.clear,
81
- borderColor: theme.colors.clear,
82
- shadowColor: theme.colors.clear,
83
- alignItems: 'flex-start',
84
- justifyContent: 'flex-start',
85
- paddingLeft: 0,
86
- height: 30,
87
- width: 40,
88
- },
89
- });
63
+ const styles = StyleSheet.create({
64
+ rowDirection: {
65
+ flexDirection: 'row',
66
+ },
67
+ statusBar: {
68
+ height: 12,
69
+ },
70
+ logo: {
71
+ width: 75,
72
+ height: 75,
73
+ borderRadius: 10,
74
+ },
75
+ textBold: {
76
+ fontWeight: 'bold',
77
+ },
78
+ btnBackArrow: {
79
+ borderWidth: 0,
80
+ backgroundColor: theme.colors.clear,
81
+ borderColor: theme.colors.clear,
82
+ shadowColor: theme.colors.clear,
83
+ alignItems: 'flex-start',
84
+ justifyContent: 'flex-start',
85
+ paddingLeft: 0,
86
+ height: 30,
87
+ width: 40,
88
+ },
89
+ });
90
90
 
91
- const [, t] = useLanguage();
92
- const [{ parsePrice, parseNumber, parseDate }] = useUtils();
93
- const [{ user }] = useSession();
94
- const [{ configs }] = useConfig();
91
+ const [, t] = useLanguage();
92
+ const [{ parsePrice, parseNumber, parseDate }] = useUtils();
93
+ const [{ user }] = useSession();
94
+ const [{ configs }] = useConfig();
95
95
 
96
- const [openModalForBusiness, setOpenModalForBusiness] = useState(false);
97
- const [openModalForDriver, setOpenModalForDriver] = useState(false);
98
- const [unreadAlert, setUnreadAlert] = useState({
99
- business: false,
100
- driver: false,
101
- });
96
+ const [openModalForBusiness, setOpenModalForBusiness] = useState(false);
97
+ const [openModalForDriver, setOpenModalForDriver] = useState(false);
98
+ const [unreadAlert, setUnreadAlert] = useState({
99
+ business: false,
100
+ driver: false,
101
+ });
102
102
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, data: null })
103
103
 
104
- const { order, businessData } = props.order;
104
+ const { order, businessData } = props.order;
105
105
 
106
- const getOrderStatus = (s: string) => {
107
- const status = parseInt(s);
108
- const orderStatus = [
109
- {
110
- key: 0,
111
- value: t('PENDING', 'Pending'),
112
- slug: 'PENDING',
113
- percentage: 0.25,
114
- image: theme.images.order.status0,
115
- },
116
- {
117
- key: 1,
118
- value: t('COMPLETED', 'Completed'),
119
- slug: 'COMPLETED',
120
- percentage: 1,
121
- image: theme.images.order.status1,
122
- },
123
- {
124
- key: 2,
125
- value: t('REJECTED', 'Rejected'),
126
- slug: 'REJECTED',
127
- percentage: 0,
128
- image: theme.images.order.status2,
129
- },
130
- {
131
- key: 3,
132
- value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
133
- slug: 'DRIVER_IN_BUSINESS',
134
- percentage: 0.6,
135
- image: theme.images.order.status3,
136
- },
137
- {
138
- key: 4,
139
- value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
140
- slug: 'PREPARATION_COMPLETED',
141
- percentage: 0.7,
142
- image: theme.images.order.status4,
143
- },
144
- {
145
- key: 5,
146
- value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
147
- slug: 'REJECTED_BY_BUSINESS',
148
- percentage: 0,
149
- image: theme.images.order.status5,
150
- },
151
- {
152
- key: 6,
153
- value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
154
- slug: 'REJECTED_BY_DRIVER',
155
- percentage: 0,
156
- image: theme.images.order.status6,
157
- },
158
- {
159
- key: 7,
160
- value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
161
- slug: 'ACCEPTED_BY_BUSINESS',
162
- percentage: 0.35,
163
- image: theme.images.order.status7,
164
- },
165
- {
166
- key: 8,
167
- value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
168
- slug: 'ACCEPTED_BY_DRIVER',
169
- percentage: 0.45,
170
- image: theme.images.order.status8,
171
- },
172
- {
173
- key: 9,
174
- value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
175
- slug: 'PICK_UP_COMPLETED_BY_DRIVER',
176
- percentage: 0.8,
177
- image: theme.images.order.status9,
178
- },
179
- {
180
- key: 10,
181
- value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
182
- slug: 'PICK_UP_FAILED_BY_DRIVER',
183
- percentage: 0,
184
- image: theme.images.order.status10,
185
- },
186
- {
187
- key: 11,
188
- value: t(
189
- 'DELIVERY_COMPLETED_BY_DRIVER',
190
- 'Delivery completed by driver',
191
- ),
192
- slug: 'DELIVERY_COMPLETED_BY_DRIVER',
193
- percentage: 1,
194
- image: theme.images.order.status11,
195
- },
196
- {
197
- key: 12,
198
- value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
199
- slug: 'DELIVERY_FAILED_BY_DRIVER',
200
- percentage: 0,
201
- image: theme.images.order.status12,
202
- },
203
- {
204
- key: 13,
205
- value: t('PREORDER', 'PreOrder'),
206
- slug: 'PREORDER',
207
- percentage: 0,
208
- image: theme.images.order.status13,
209
- },
210
- {
211
- key: 14,
212
- value: t('ORDER_NOT_READY', 'Order not ready'),
213
- slug: 'ORDER_NOT_READY',
214
- percentage: 0,
215
- image: theme.images.order.status13,
216
- },
217
- {
218
- key: 15,
219
- value: t(
220
- 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
221
- 'Order picked up completed by customer',
222
- ),
223
- slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
224
- percentage: 100,
225
- image: theme.images.order.status1,
226
- },
227
- {
228
- key: 16,
229
- value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
230
- slug: 'CANCELLED_BY_CUSTOMER',
231
- percentage: 0,
232
- image: theme.images.order.status2,
233
- },
234
- {
235
- key: 17,
236
- value: t(
237
- 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
238
- 'Order not picked up by customer',
239
- ),
240
- slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
241
- percentage: 0,
242
- image: theme.images.order.status2,
243
- },
244
- {
245
- key: 18,
246
- value: t(
247
- 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
248
- 'Driver almost arrived to business',
249
- ),
250
- slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
251
- percentage: 0.15,
252
- image: theme.images.order.status3,
253
- },
254
- {
255
- key: 19,
256
- value: t(
257
- 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
258
- 'Driver almost arrived to customer',
259
- ),
260
- slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
261
- percentage: 0.9,
262
- image: theme.images.order.status11,
263
- },
264
- {
265
- key: 20,
266
- value: t(
267
- 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
268
- 'Customer almost arrived to business',
269
- ),
270
- slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
271
- percentage: 90,
272
- image: theme.images.order.status7,
273
- },
274
- {
275
- key: 21,
276
- value: t(
277
- 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
278
- 'Customer arrived to business',
279
- ),
280
- slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
281
- percentage: 95,
282
- image: theme.images.order.status7,
283
- },
284
- ];
106
+ const getOrderStatus = (s: string) => {
107
+ const status = parseInt(s);
108
+ const orderStatus = [
109
+ {
110
+ key: 0,
111
+ value: t('PENDING', 'Pending'),
112
+ slug: 'PENDING',
113
+ percentage: 0.25,
114
+ image: theme.images.order.status0,
115
+ },
116
+ {
117
+ key: 1,
118
+ value: t('COMPLETED', 'Completed'),
119
+ slug: 'COMPLETED',
120
+ percentage: 1,
121
+ image: theme.images.order.status1,
122
+ },
123
+ {
124
+ key: 2,
125
+ value: t('REJECTED', 'Rejected'),
126
+ slug: 'REJECTED',
127
+ percentage: 0,
128
+ image: theme.images.order.status2,
129
+ },
130
+ {
131
+ key: 3,
132
+ value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
133
+ slug: 'DRIVER_IN_BUSINESS',
134
+ percentage: 0.6,
135
+ image: theme.images.order.status3,
136
+ },
137
+ {
138
+ key: 4,
139
+ value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
140
+ slug: 'PREPARATION_COMPLETED',
141
+ percentage: 0.7,
142
+ image: theme.images.order.status4,
143
+ },
144
+ {
145
+ key: 5,
146
+ value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
147
+ slug: 'REJECTED_BY_BUSINESS',
148
+ percentage: 0,
149
+ image: theme.images.order.status5,
150
+ },
151
+ {
152
+ key: 6,
153
+ value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
154
+ slug: 'REJECTED_BY_DRIVER',
155
+ percentage: 0,
156
+ image: theme.images.order.status6,
157
+ },
158
+ {
159
+ key: 7,
160
+ value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
161
+ slug: 'ACCEPTED_BY_BUSINESS',
162
+ percentage: 0.35,
163
+ image: theme.images.order.status7,
164
+ },
165
+ {
166
+ key: 8,
167
+ value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
168
+ slug: 'ACCEPTED_BY_DRIVER',
169
+ percentage: 0.45,
170
+ image: theme.images.order.status8,
171
+ },
172
+ {
173
+ key: 9,
174
+ value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
175
+ slug: 'PICK_UP_COMPLETED_BY_DRIVER',
176
+ percentage: 0.8,
177
+ image: theme.images.order.status9,
178
+ },
179
+ {
180
+ key: 10,
181
+ value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
182
+ slug: 'PICK_UP_FAILED_BY_DRIVER',
183
+ percentage: 0,
184
+ image: theme.images.order.status10,
185
+ },
186
+ {
187
+ key: 11,
188
+ value: t(
189
+ 'DELIVERY_COMPLETED_BY_DRIVER',
190
+ 'Delivery completed by driver',
191
+ ),
192
+ slug: 'DELIVERY_COMPLETED_BY_DRIVER',
193
+ percentage: 1,
194
+ image: theme.images.order.status11,
195
+ },
196
+ {
197
+ key: 12,
198
+ value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
199
+ slug: 'DELIVERY_FAILED_BY_DRIVER',
200
+ percentage: 0,
201
+ image: theme.images.order.status12,
202
+ },
203
+ {
204
+ key: 13,
205
+ value: t('PREORDER', 'PreOrder'),
206
+ slug: 'PREORDER',
207
+ percentage: 0,
208
+ image: theme.images.order.status13,
209
+ },
210
+ {
211
+ key: 14,
212
+ value: t('ORDER_NOT_READY', 'Order not ready'),
213
+ slug: 'ORDER_NOT_READY',
214
+ percentage: 0,
215
+ image: theme.images.order.status13,
216
+ },
217
+ {
218
+ key: 15,
219
+ value: t(
220
+ 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
221
+ 'Order picked up completed by customer',
222
+ ),
223
+ slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
224
+ percentage: 100,
225
+ image: theme.images.order.status1,
226
+ },
227
+ {
228
+ key: 16,
229
+ value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
230
+ slug: 'CANCELLED_BY_CUSTOMER',
231
+ percentage: 0,
232
+ image: theme.images.order.status2,
233
+ },
234
+ {
235
+ key: 17,
236
+ value: t(
237
+ 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
238
+ 'Order not picked up by customer',
239
+ ),
240
+ slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
241
+ percentage: 0,
242
+ image: theme.images.order.status2,
243
+ },
244
+ {
245
+ key: 18,
246
+ value: t(
247
+ 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
248
+ 'Driver almost arrived to business',
249
+ ),
250
+ slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
251
+ percentage: 0.15,
252
+ image: theme.images.order.status3,
253
+ },
254
+ {
255
+ key: 19,
256
+ value: t(
257
+ 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
258
+ 'Driver almost arrived to customer',
259
+ ),
260
+ slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
261
+ percentage: 0.9,
262
+ image: theme.images.order.status11,
263
+ },
264
+ {
265
+ key: 20,
266
+ value: t(
267
+ 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
268
+ 'Customer almost arrived to business',
269
+ ),
270
+ slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
271
+ percentage: 90,
272
+ image: theme.images.order.status7,
273
+ },
274
+ {
275
+ key: 21,
276
+ value: t(
277
+ 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
278
+ 'Customer arrived to business',
279
+ ),
280
+ slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
281
+ percentage: 95,
282
+ image: theme.images.order.status7,
283
+ },
284
+ ];
285
285
 
286
- const objectStatus = orderStatus.find((o) => o.key === status);
286
+ const objectStatus = orderStatus.find((o) => o.key === status);
287
287
 
288
- return objectStatus && objectStatus;
289
- };
288
+ return objectStatus && objectStatus;
289
+ };
290
290
 
291
- const handleOpenMessagesForBusiness = () => {
292
- setOpenModalForBusiness(true);
293
- readMessages && readMessages();
294
- setUnreadAlert({ ...unreadAlert, business: false });
295
- };
291
+ const handleOpenMessagesForBusiness = () => {
292
+ setOpenModalForBusiness(true);
293
+ readMessages && readMessages();
294
+ setUnreadAlert({ ...unreadAlert, business: false });
295
+ };
296
296
 
297
- const handleOpenMessagesForDriver = () => {
298
- setOpenModalForDriver(true);
299
- readMessages && readMessages();
300
- setUnreadAlert({ ...unreadAlert, driver: false });
301
- };
297
+ const handleOpenMessagesForDriver = () => {
298
+ setOpenModalForDriver(true);
299
+ readMessages && readMessages();
300
+ setUnreadAlert({ ...unreadAlert, driver: false });
301
+ };
302
302
 
303
- const unreadMessages = () => {
304
- const length = messages?.messages.length;
305
- const unreadLength = order?.unread_count;
306
- const unreadedMessages = messages.messages.slice(
307
- length - unreadLength,
308
- length,
309
- );
310
- const business = unreadedMessages.some((message: any) =>
311
- message?.can_see?.includes(2),
312
- );
313
- const driver = unreadedMessages.some((message: any) =>
314
- message?.can_see?.includes(4),
315
- );
316
- setUnreadAlert({ business, driver });
317
- };
303
+ const unreadMessages = () => {
304
+ const length = messages?.messages.length;
305
+ const unreadLength = order?.unread_count;
306
+ const unreadedMessages = messages.messages.slice(
307
+ length - unreadLength,
308
+ length,
309
+ );
310
+ const business = unreadedMessages.some((message: any) =>
311
+ message?.can_see?.includes(2),
312
+ );
313
+ const driver = unreadedMessages.some((message: any) =>
314
+ message?.can_see?.includes(4),
315
+ );
316
+ setUnreadAlert({ business, driver });
317
+ };
318
318
 
319
- const handleCloseModal = () => {
320
- setOpenModalForBusiness(false);
321
- setOpenModalForDriver(false);
322
- };
319
+ const handleCloseModal = () => {
320
+ setOpenModalForBusiness(false);
321
+ setOpenModalForDriver(false);
322
+ };
323
323
 
324
- const handleArrowBack: any = () => {
325
- if (!isFromCheckout) {
326
- navigation?.canGoBack() && navigation.goBack();
327
- return;
328
- }
329
- navigation.navigate('BottomTab');
330
- };
324
+ const handleArrowBack: any = () => {
325
+ if (!isFromCheckout) {
326
+ navigation?.canGoBack() && navigation.goBack();
327
+ return;
328
+ }
329
+ navigation.navigate('BottomTab');
330
+ };
331
331
 
332
332
  const getIncludedTaxes = () => {
333
333
  if (order?.taxes?.length === 0) {
@@ -339,362 +339,362 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
339
339
  }
340
340
  }
341
341
 
342
- useEffect(() => {
343
- BackHandler.addEventListener('hardwareBackPress', handleArrowBack);
344
- return () => {
345
- BackHandler.removeEventListener('hardwareBackPress', handleArrowBack);
346
- };
347
- }, []);
342
+ useEffect(() => {
343
+ BackHandler.addEventListener('hardwareBackPress', handleArrowBack);
344
+ return () => {
345
+ BackHandler.removeEventListener('hardwareBackPress', handleArrowBack);
346
+ };
347
+ }, []);
348
348
 
349
- useEffect(() => {
350
- if (messagesReadList?.length) {
351
- openModalForBusiness
352
- ? setUnreadAlert({ ...unreadAlert, business: false })
353
- : setUnreadAlert({ ...unreadAlert, driver: false });
354
- }
355
- }, [messagesReadList]);
349
+ useEffect(() => {
350
+ if (messagesReadList?.length) {
351
+ openModalForBusiness
352
+ ? setUnreadAlert({ ...unreadAlert, business: false })
353
+ : setUnreadAlert({ ...unreadAlert, driver: false });
354
+ }
355
+ }, [messagesReadList]);
356
356
 
357
- const locations = [
358
- {
359
- ...order?.driver?.location,
360
- title: t('DRIVER', 'Driver'),
361
- icon:
362
- order?.driver?.photo ||
363
- 'https://res.cloudinary.com/demo/image/fetch/c_thumb,g_face,r_max/https://www.freeiconspng.com/thumbs/driver-icon/driver-icon-14.png',
364
- },
365
- {
366
- ...order?.business?.location,
367
- title: order?.business?.name,
368
- icon: order?.business?.logo || theme.images.dummies.businessLogo,
369
- },
370
- {
371
- ...order?.customer?.location,
372
- title: t('YOUR_LOCATION', 'Your Location'),
373
- icon:
374
- order?.customer?.photo ||
375
- 'https://res.cloudinary.com/demo/image/upload/c_thumb,g_face,r_max/d_avatar.png/non_existing_id.png',
376
- },
377
- ];
357
+ const locations = [
358
+ {
359
+ ...order?.driver?.location,
360
+ title: t('DRIVER', 'Driver'),
361
+ icon:
362
+ order?.driver?.photo ||
363
+ 'https://res.cloudinary.com/demo/image/fetch/c_thumb,g_face,r_max/https://www.freeiconspng.com/thumbs/driver-icon/driver-icon-14.png',
364
+ },
365
+ {
366
+ ...order?.business?.location,
367
+ title: order?.business?.name,
368
+ icon: order?.business?.logo || theme.images.dummies.businessLogo,
369
+ },
370
+ {
371
+ ...order?.customer?.location,
372
+ title: t('YOUR_LOCATION', 'Your Location'),
373
+ icon:
374
+ order?.customer?.photo ||
375
+ 'https://res.cloudinary.com/demo/image/upload/c_thumb,g_face,r_max/d_avatar.png/non_existing_id.png',
376
+ },
377
+ ];
378
378
 
379
- useEffect(() => {
380
- if (driverLocation) {
381
- locations[0] = driverLocation;
382
- }
383
- }, [driverLocation]);
379
+ useEffect(() => {
380
+ if (driverLocation) {
381
+ locations[0] = driverLocation;
382
+ }
383
+ }, [driverLocation]);
384
384
 
385
- return (
386
- <OrderDetailsContainer keyboardShouldPersistTaps="handled">
387
- <Spinner visible={!order || Object.keys(order).length === 0} />
388
- {order && Object.keys(order).length > 0 && (
389
- <>
390
- <Header>
391
- <OButton
392
- imgLeftSrc={theme.images.general.arrow_left}
393
- imgRightSrc={null}
394
- style={styles.btnBackArrow}
395
- onClick={() => handleArrowBack()}
396
- imgLeftStyle={{ tintColor: theme.colors.disabled }}
397
- />
398
- <OrderInfo>
399
- <OrderData>
400
- <OText
401
- size={20}
402
- lineHeight={30}
403
- weight={'600'}
404
- color={theme.colors.textNormal}>
405
- {t('ORDER', 'Order')} #{order?.id}
406
- </OText>
407
- <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
408
- {order?.delivery_datetime_utc
409
- ? parseDate(order?.delivery_datetime_utc)
410
- : parseDate(order?.delivery_datetime, { utc: false })}
411
- </OText>
412
- <TouchableOpacity
413
- activeOpacity={0.7}
414
- style={{ marginTop: 6 }}
415
- onPress={() => { }}>
416
- <OText
417
- size={10}
418
- lineHeight={15}
419
- color={theme.colors.textSecondary}
420
- style={{ textDecorationLine: 'underline' }}>
421
- {t('REVIEW_ORDER', 'Review order')}
422
- </OText>
423
- </TouchableOpacity>
385
+ return (
386
+ <OrderDetailsContainer keyboardShouldPersistTaps="handled">
387
+ <Spinner visible={!order || Object.keys(order).length === 0} />
388
+ {order && Object.keys(order).length > 0 && (
389
+ <>
390
+ <Header>
391
+ <OButton
392
+ imgLeftSrc={theme.images.general.arrow_left}
393
+ imgRightSrc={null}
394
+ style={styles.btnBackArrow}
395
+ onClick={() => handleArrowBack()}
396
+ imgLeftStyle={{ tintColor: theme.colors.disabled }}
397
+ />
398
+ <OrderInfo>
399
+ <OrderData>
400
+ <OText
401
+ size={20}
402
+ lineHeight={30}
403
+ weight={'600'}
404
+ color={theme.colors.textNormal}>
405
+ {t('ORDER', 'Order')} #{order?.id}
406
+ </OText>
407
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
408
+ {order?.delivery_datetime_utc
409
+ ? parseDate(order?.delivery_datetime_utc)
410
+ : parseDate(order?.delivery_datetime, { utc: false })}
411
+ </OText>
412
+ <TouchableOpacity
413
+ activeOpacity={0.7}
414
+ style={{ marginTop: 6 }}
415
+ onPress={() => { }}>
416
+ <OText
417
+ size={10}
418
+ lineHeight={15}
419
+ color={theme.colors.textSecondary}
420
+ style={{ textDecorationLine: 'underline' }}>
421
+ {t('REVIEW_ORDER', 'Review order')}
422
+ </OText>
423
+ </TouchableOpacity>
424
424
 
425
- <StaturBar>
426
- <LinearGradient
427
- start={{ x: 0.0, y: 0.0 }}
428
- end={{
429
- x: getOrderStatus(order?.status)?.percentage || 0,
430
- y: 0,
431
- }}
432
- locations={[0.9999, 0.9999]}
433
- colors={[theme.colors.primary, theme.colors.backgroundGray100]}
434
- style={styles.statusBar}
435
- />
436
- </StaturBar>
437
- <OText
438
- size={16}
439
- lineHeight={24}
440
- weight={'600'}
441
- color={theme.colors.textNormal}>
442
- {getOrderStatus(order?.status)?.value}
443
- </OText>
444
- </OrderData>
445
- <View
446
- style={{
447
- height: 8,
448
- backgroundColor: theme.colors.backgroundGray100,
449
- marginTop: 18,
450
- marginHorizontal: -40,
451
- }}
452
- />
453
- </OrderInfo>
454
- </Header>
455
- <OrderContent>
456
- <OrderBusiness>
457
- <OText
458
- size={16}
459
- lineHeight={24}
460
- weight={'500'}
461
- color={theme.colors.textNormal}
462
- mBottom={12}>
463
- {t('FROM', 'From')}
464
- </OText>
465
- <View
466
- style={{
467
- display: 'flex',
468
- flexDirection: 'column',
469
- alignItems: 'flex-start',
470
- }}>
471
- <View
472
- style={{
473
- flexDirection: 'row',
474
- alignItems: 'center',
475
- justifyContent: 'space-between',
476
- }}>
477
- <OText
478
- size={13}
479
- lineHeight={20}
480
- color={theme.colors.textNormal}
481
- style={{ flexGrow: 1, flexBasis: '80%' }}>
482
- {order?.business?.name}
483
- </OText>
484
- <Icons>
485
- <TouchableOpacity
486
- onPress={() =>
487
- props.navigation.navigate('Business', {
488
- store: businessData?.slug,
489
- })
490
- }
491
- style={{ paddingEnd: 5 }}>
492
- <OIcon
493
- src={theme.images.general.phone}
494
- width={16}
495
- color={theme.colors.disabled}
496
- />
497
- </TouchableOpacity>
498
- <TouchableOpacity
499
- style={{ paddingStart: 5 }}
500
- onPress={() => handleOpenMessagesForBusiness()}>
501
- <OIcon
502
- src={theme.images.general.chat}
503
- width={16}
504
- color={theme.colors.disabled}
505
- />
506
- </TouchableOpacity>
507
- </Icons>
508
- </View>
509
- <OText
510
- size={12}
511
- lineHeight={18}
512
- color={theme.colors.textNormal}
513
- mBottom={2}>
514
- {order?.business?.email}
515
- </OText>
516
- <OText
517
- size={12}
518
- lineHeight={18}
519
- color={theme.colors.textNormal}
520
- mBottom={2}>
521
- {order?.business?.cellphone}
522
- </OText>
523
- <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
524
- {order?.business?.address}
525
- </OText>
526
- </View>
527
- </OrderBusiness>
528
- <View
529
- style={{
530
- height: 8,
531
- backgroundColor: theme.colors.backgroundGray100,
532
- marginTop: 18,
533
- marginHorizontal: -40,
534
- }}
535
- />
536
- <OrderCustomer>
537
- <OText
538
- size={16}
539
- lineHeight={24}
540
- weight={'500'}
541
- color={theme.colors.textNormal}
542
- mBottom={12}>
543
- {t('TO', 'To')}
544
- </OText>
545
- <Customer>
546
- <InfoBlock>
547
- <OText
548
- size={12}
549
- lineHeight={18}
550
- color={theme.colors.textNormal}
551
- mBottom={2}>
552
- {order?.customer?.name} {order?.customer?.lastname}
553
- </OText>
554
- <OText
555
- size={12}
556
- lineHeight={18}
557
- color={theme.colors.textNormal}
558
- mBottom={2}>
559
- {order?.customer?.address}
560
- </OText>
561
- <OText
562
- size={12}
563
- lineHeight={18}
564
- color={theme.colors.textNormal}
565
- mBottom={2}>
566
- {order?.customer?.cellphone}
567
- </OText>
568
- </InfoBlock>
569
- </Customer>
570
- {order?.driver && (
571
- <>
572
- {order?.driver?.location && parseInt(order?.status) === 9 && (
573
- <Map>
574
- <GoogleMap
575
- location={order?.driver?.location}
576
- locations={locations}
577
- readOnly
578
- />
579
- </Map>
580
- )}
581
- </>
582
- )}
583
- </OrderCustomer>
584
- {order?.driver && (
585
- <>
586
- <View
587
- style={{
588
- height: 8,
589
- backgroundColor: theme.colors.backgroundGray100,
590
- marginTop: 18,
591
- marginHorizontal: -40,
592
- }}
593
- />
594
- <OrderDriver>
595
- <OText size={16} lineHeight={24} weight={'500'} style={{ marginBottom: 10 }}>{t('YOUR_DRIVER', 'Your Driver')}</OText>
596
- <Customer>
597
- <InfoBlock>
598
- <View
599
- style={{
600
- flexDirection: 'row',
601
- alignItems: 'center',
602
- justifyContent: 'space-between',
603
- }}>
604
- <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2} style={{ flexGrow: 1, flexBasis: '80%' }}>
605
- {order?.driver?.name} {order?.driver?.lastname}
606
- </OText>
607
- <Icons>
608
- <TouchableOpacity
609
- onPress={() => handleOpenMessagesForDriver()}>
610
- <OIcon
611
- src={theme.images.general.chat}
612
- width={16}
613
- color={theme.colors.disabled}
614
- />
615
- </TouchableOpacity>
616
- </Icons>
617
- </View>
618
- <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
619
- {order?.driver?.cellphone}
620
- </OText>
621
- </InfoBlock>
622
- </Customer>
623
- </OrderDriver>
624
- </>
625
- )}
626
- <View
627
- style={{
628
- height: 8,
629
- backgroundColor: theme.colors.backgroundGray100,
630
- marginTop: 18,
631
- marginHorizontal: -40,
632
- }}
633
- />
634
- <HeaderInfo>
635
- <OText
636
- size={24}
637
- color={theme.colors.textNormal}
638
- style={{ fontWeight: Platform.OS == 'ios' ? '600' : 'bold', marginBottom: 16 }}>
639
- {t(
640
- 'YOUR_ORDER_HAS_BEEN_RECEIVED',
641
- 'Your Order has been received',
642
- )}
643
- </OText>
644
- <OText color={theme.colors.textNormal} size={14} weight={'500'}>
645
- {t(
646
- 'ORDER_MESSAGE_HEADER_TEXT',
647
- 'Once business accepts your order, we will send you an email, thank you!',
648
- )}
649
- </OText>
650
- <OButton
651
- text={t('YOUR_ORDERS', 'Your Orders')}
652
- textStyle={{ fontSize: 14, color: theme.colors.primary }}
653
- imgRightSrc={null}
654
- borderColor={theme.colors.primary}
655
- bgColor={theme.colors.clear}
656
- style={{ borderRadius: 7.6, borderWidth: 1, height: 44, shadowOpacity: 0 }}
657
- parentStyle={{ marginTop: 29, width: '50%' }}
658
- onClick={() => navigation.navigate('BottomTab', { screen: 'MyOrders' })}
659
- />
660
- </HeaderInfo>
661
- <OrderProducts>
662
- {order?.products?.length &&
663
- order?.products.map((product: any, i: number) => (
664
- <ProductItemAccordion
665
- key={product?.id || i}
666
- product={product}
667
- isFromCheckout
668
- />
669
- ))}
670
- </OrderProducts>
671
- <OrderBill>
672
- <View style={{ height: 1, backgroundColor: theme.colors.border, marginBottom: 17 }} />
673
- <Table>
674
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL', 'Subtotal')}</OText>
675
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
425
+ <StaturBar>
426
+ <LinearGradient
427
+ start={{ x: 0.0, y: 0.0 }}
428
+ end={{
429
+ x: getOrderStatus(order?.status)?.percentage || 0,
430
+ y: 0,
431
+ }}
432
+ locations={[0.9999, 0.9999]}
433
+ colors={[theme.colors.primary, theme.colors.backgroundGray100]}
434
+ style={styles.statusBar}
435
+ />
436
+ </StaturBar>
437
+ <OText
438
+ size={16}
439
+ lineHeight={24}
440
+ weight={'600'}
441
+ color={theme.colors.textNormal}>
442
+ {getOrderStatus(order?.status)?.value}
443
+ </OText>
444
+ </OrderData>
445
+ <View
446
+ style={{
447
+ height: 8,
448
+ backgroundColor: theme.colors.backgroundGray100,
449
+ marginTop: 18,
450
+ marginHorizontal: -40,
451
+ }}
452
+ />
453
+ </OrderInfo>
454
+ </Header>
455
+ <OrderContent>
456
+ <OrderBusiness>
457
+ <OText
458
+ size={16}
459
+ lineHeight={24}
460
+ weight={'500'}
461
+ color={theme.colors.textNormal}
462
+ mBottom={12}>
463
+ {t('FROM', 'From')}
464
+ </OText>
465
+ <View
466
+ style={{
467
+ display: 'flex',
468
+ flexDirection: 'column',
469
+ alignItems: 'flex-start',
470
+ }}>
471
+ <View
472
+ style={{
473
+ flexDirection: 'row',
474
+ alignItems: 'center',
475
+ justifyContent: 'space-between',
476
+ }}>
477
+ <OText
478
+ size={13}
479
+ lineHeight={20}
480
+ color={theme.colors.textNormal}
481
+ style={{ flexGrow: 1, flexBasis: '80%' }}>
482
+ {order?.business?.name}
483
+ </OText>
484
+ <Icons>
485
+ <TouchableOpacity
486
+ onPress={() =>
487
+ props.navigation.navigate('Business', {
488
+ store: businessData?.slug,
489
+ })
490
+ }
491
+ style={{ paddingEnd: 5 }}>
492
+ <OIcon
493
+ src={theme.images.general.phone}
494
+ width={16}
495
+ color={theme.colors.disabled}
496
+ />
497
+ </TouchableOpacity>
498
+ <TouchableOpacity
499
+ style={{ paddingStart: 5 }}
500
+ onPress={() => handleOpenMessagesForBusiness()}>
501
+ <OIcon
502
+ src={theme.images.general.chat}
503
+ width={16}
504
+ color={theme.colors.disabled}
505
+ />
506
+ </TouchableOpacity>
507
+ </Icons>
508
+ </View>
509
+ <OText
510
+ size={12}
511
+ lineHeight={18}
512
+ color={theme.colors.textNormal}
513
+ mBottom={2}>
514
+ {order?.business?.email}
515
+ </OText>
516
+ <OText
517
+ size={12}
518
+ lineHeight={18}
519
+ color={theme.colors.textNormal}
520
+ mBottom={2}>
521
+ {order?.business?.cellphone}
522
+ </OText>
523
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
524
+ {order?.business?.address}
525
+ </OText>
526
+ </View>
527
+ </OrderBusiness>
528
+ <View
529
+ style={{
530
+ height: 8,
531
+ backgroundColor: theme.colors.backgroundGray100,
532
+ marginTop: 18,
533
+ marginHorizontal: -40,
534
+ }}
535
+ />
536
+ <OrderCustomer>
537
+ <OText
538
+ size={16}
539
+ lineHeight={24}
540
+ weight={'500'}
541
+ color={theme.colors.textNormal}
542
+ mBottom={12}>
543
+ {t('TO', 'To')}
544
+ </OText>
545
+ <Customer>
546
+ <InfoBlock>
547
+ <OText
548
+ size={12}
549
+ lineHeight={18}
550
+ color={theme.colors.textNormal}
551
+ mBottom={2}>
552
+ {order?.customer?.name} {order?.customer?.lastname}
553
+ </OText>
554
+ <OText
555
+ size={12}
556
+ lineHeight={18}
557
+ color={theme.colors.textNormal}
558
+ mBottom={2}>
559
+ {order?.customer?.address}
560
+ </OText>
561
+ <OText
562
+ size={12}
563
+ lineHeight={18}
564
+ color={theme.colors.textNormal}
565
+ mBottom={2}>
566
+ {order?.customer?.cellphone}
567
+ </OText>
568
+ </InfoBlock>
569
+ </Customer>
570
+ {order?.driver && (
571
+ <>
572
+ {order?.driver?.location && parseInt(order?.status) === 9 && (
573
+ <Map>
574
+ <GoogleMap
575
+ location={order?.driver?.location}
576
+ locations={locations}
577
+ readOnly
578
+ />
579
+ </Map>
580
+ )}
581
+ </>
582
+ )}
583
+ </OrderCustomer>
584
+ {order?.driver && (
585
+ <>
586
+ <View
587
+ style={{
588
+ height: 8,
589
+ backgroundColor: theme.colors.backgroundGray100,
590
+ marginTop: 18,
591
+ marginHorizontal: -40,
592
+ }}
593
+ />
594
+ <OrderDriver>
595
+ <OText size={16} lineHeight={24} weight={'500'} style={{ marginBottom: 10 }}>{t('YOUR_DRIVER', 'Your Driver')}</OText>
596
+ <Customer>
597
+ <InfoBlock>
598
+ <View
599
+ style={{
600
+ flexDirection: 'row',
601
+ alignItems: 'center',
602
+ justifyContent: 'space-between',
603
+ }}>
604
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2} style={{ flexGrow: 1, flexBasis: '80%' }}>
605
+ {order?.driver?.name} {order?.driver?.lastname}
606
+ </OText>
607
+ <Icons>
608
+ <TouchableOpacity
609
+ onPress={() => handleOpenMessagesForDriver()}>
610
+ <OIcon
611
+ src={theme.images.general.chat}
612
+ width={16}
613
+ color={theme.colors.disabled}
614
+ />
615
+ </TouchableOpacity>
616
+ </Icons>
617
+ </View>
618
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
619
+ {order?.driver?.cellphone}
620
+ </OText>
621
+ </InfoBlock>
622
+ </Customer>
623
+ </OrderDriver>
624
+ </>
625
+ )}
626
+ <View
627
+ style={{
628
+ height: 8,
629
+ backgroundColor: theme.colors.backgroundGray100,
630
+ marginTop: 18,
631
+ marginHorizontal: -40,
632
+ }}
633
+ />
634
+ <HeaderInfo>
635
+ <OText
636
+ size={24}
637
+ color={theme.colors.textNormal}
638
+ style={{ fontWeight: Platform.OS == 'ios' ? '600' : 'bold', marginBottom: 16 }}>
639
+ {t(
640
+ 'YOUR_ORDER_HAS_BEEN_RECEIVED',
641
+ 'Your Order has been received',
642
+ )}
643
+ </OText>
644
+ <OText color={theme.colors.textNormal} size={14} weight={'500'}>
645
+ {t(
646
+ 'ORDER_MESSAGE_HEADER_TEXT',
647
+ 'Once business accepts your order, we will send you an email, thank you!',
648
+ )}
649
+ </OText>
650
+ <OButton
651
+ text={t('YOUR_ORDERS', 'Your Orders')}
652
+ textStyle={{ fontSize: 14, color: theme.colors.primary }}
653
+ imgRightSrc={null}
654
+ borderColor={theme.colors.primary}
655
+ bgColor={theme.colors.clear}
656
+ style={{ borderRadius: 7.6, borderWidth: 1, height: 44, shadowOpacity: 0 }}
657
+ parentStyle={{ marginTop: 29, width: '50%' }}
658
+ onClick={() => navigation.navigate('BottomTab', { screen: 'MyOrders' })}
659
+ />
660
+ </HeaderInfo>
661
+ <OrderProducts>
662
+ {order?.products?.length &&
663
+ order?.products.map((product: any, i: number) => (
664
+ <ProductItemAccordion
665
+ key={product?.id || i}
666
+ product={product}
667
+ isFromCheckout
668
+ />
669
+ ))}
670
+ </OrderProducts>
671
+ <OrderBill>
672
+ <View style={{ height: 1, backgroundColor: theme.colors.border, marginBottom: 17 }} />
673
+ <Table>
674
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL', 'Subtotal')}</OText>
675
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
676
676
  {parsePrice(((order?.summary?.subtotal || order?.subtotal) + getIncludedTaxes()))}
677
- </OText>
678
- </Table>
679
- {(order?.summary?.discount > 0 || order?.discount > 0) && (
680
- <Table>
681
- {order?.offer_type === 1 ? (
682
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
683
- {t('DISCOUNT', 'Discount')}
684
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(
685
- order?.offer_rate,
686
- parsePrice,
687
- )}%)`}</OText>
688
- </OText>
689
- ) : (
690
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DISCOUNT', 'Discount')}</OText>
691
- )}
692
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
693
- - {parsePrice(order?.summary?.discount || order?.discount)}
694
- </OText>
695
- </Table>
696
- )}
697
- {
677
+ </OText>
678
+ </Table>
679
+ {(order?.summary?.discount > 0 || order?.discount > 0) && (
680
+ <Table>
681
+ {order?.offer_type === 1 ? (
682
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
683
+ {t('DISCOUNT', 'Discount')}
684
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(
685
+ order?.offer_rate,
686
+ parsePrice,
687
+ )}%)`}</OText>
688
+ </OText>
689
+ ) : (
690
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DISCOUNT', 'Discount')}</OText>
691
+ )}
692
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
693
+ - {parsePrice(order?.summary?.discount || order?.discount)}
694
+ </OText>
695
+ </Table>
696
+ )}
697
+ {
698
698
  order?.taxes?.length === 0 && order?.tax_type === 2 && (
699
699
  <Table>
700
700
  <OText size={12}>
@@ -732,72 +732,80 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
732
732
  ))
733
733
  }
734
734
  {
735
- order?.fees?.length > 0 && order?.fees?.filter((fee : any) => !(fee.fixed === 0 && fee.percentage === 0))?.map((fee: any) => (
736
- <Table key={fee.id}>
737
- <OSRow>
738
- <OText size={12} numberOfLines={1}>
739
- {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
740
- ({parsePrice(fee?.fixed)} + {fee.percentage}%){' '}
741
- </OText>
742
- <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee })}>
743
- <AntIcon name='exclamationcircleo' size={18} color={theme.colors.primary} />
744
- </TouchableOpacity>
745
- </OSRow>
746
- <OText size={12}>{parsePrice(fee?.fixed + fee?.summary?.percentage || 0)}</OText>
747
- </Table>
735
+ order?.fees?.length > 0 && order?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0))?.map((fee: any) => (
736
+ <Table key={fee.id}>
737
+ <OSRow>
738
+ <OText size={12} numberOfLines={1}>
739
+ {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
740
+ ({parsePrice(fee?.fixed)} + {fee.percentage}%){' '}
741
+ </OText>
742
+ <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee })}>
743
+ <AntIcon name='exclamationcircleo' size={18} color={theme.colors.primary} />
744
+ </TouchableOpacity>
745
+ </OSRow>
746
+ <OText size={12}>{parsePrice(fee?.fixed + fee?.summary?.percentage || 0)}</OText>
747
+ </Table>
748
748
  ))
749
749
  }
750
- {(order?.summary?.delivery_price > 0 ||
751
- order?.deliveryFee > 0) && (
752
- <Table>
753
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
754
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
755
- {parsePrice(
756
- order?.summary?.delivery_price || order?.deliveryFee,
757
- )}
758
- </OText>
759
- </Table>
760
- )}
761
- <Table>
762
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
763
- {t('DRIVER_TIP', 'Driver tip')}
764
- {(order?.summary?.driver_tip > 0 || order?.driver_tip > 0) &&
765
- parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
766
- !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
767
- `(${verifyDecimals(order?.driver_tip, parseNumber)}%)`}
768
- </OText>
769
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
770
- {parsePrice(
771
- order?.summary?.driver_tip || order?.totalDriverTip,
772
- )}
773
- </OText>
774
- </Table>
775
- <Total>
776
- <Table>
777
- <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
778
- <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>
779
- {parsePrice(order?.summary?.total || order?.total)}
780
- </OText>
781
- </Table>
782
- </Total>
783
- </OrderBill>
784
- </OrderContent>
785
- </>
786
- )}
787
- <OModal
788
- open={openModalForBusiness || openModalForDriver}
789
- entireModal
790
- customClose
791
- onClose={() => handleCloseModal()}>
792
- <Messages
793
- type={openModalForBusiness ? USER_TYPE.BUSINESS : USER_TYPE.DRIVER}
794
- orderId={order?.id}
795
- messages={messages}
796
- order={order}
797
- setMessages={setMessages}
798
- onClose={handleCloseModal}
799
- />
800
- </OModal>
750
+ {(order?.summary?.delivery_price > 0 ||
751
+ order?.deliveryFee > 0) && (
752
+ <Table>
753
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
754
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
755
+ {parsePrice(
756
+ order?.summary?.delivery_price || order?.deliveryFee,
757
+ )}
758
+ </OText>
759
+ </Table>
760
+ )}
761
+ <Table>
762
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
763
+ {t('DRIVER_TIP', 'Driver tip')}
764
+ {(order?.summary?.driver_tip > 0 || order?.driver_tip > 0) &&
765
+ parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
766
+ !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
767
+ `(${verifyDecimals(order?.driver_tip, parseNumber)}%)`}
768
+ </OText>
769
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
770
+ {parsePrice(
771
+ order?.summary?.driver_tip || order?.totalDriverTip,
772
+ )}
773
+ </OText>
774
+ </Table>
775
+ <Total>
776
+ <Table>
777
+ <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
778
+ <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>
779
+ {parsePrice(order?.summary?.total || order?.total)}
780
+ </OText>
781
+ </Table>
782
+ </Total>
783
+ {order?.comment && (
784
+ <Table>
785
+ <OText style={{ flex: 1 }}>{t('COMMENT', 'Comment')}</OText>
786
+ <OText style={{ maxWidth: '70%' }}>
787
+ {order?.comment}
788
+ </OText>
789
+ </Table>
790
+ )}
791
+ </OrderBill>
792
+ </OrderContent>
793
+ </>
794
+ )}
795
+ <OModal
796
+ open={openModalForBusiness || openModalForDriver}
797
+ entireModal
798
+ customClose
799
+ onClose={() => handleCloseModal()}>
800
+ <Messages
801
+ type={openModalForBusiness ? USER_TYPE.BUSINESS : USER_TYPE.DRIVER}
802
+ orderId={order?.id}
803
+ messages={messages}
804
+ order={order}
805
+ setMessages={setMessages}
806
+ onClose={handleCloseModal}
807
+ />
808
+ </OModal>
801
809
  <OModal
802
810
  open={openTaxModal.open}
803
811
  onClose={() => setOpenTaxModal({ open: false, data: null })}
@@ -805,15 +813,15 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
805
813
  >
806
814
  <TaxInformation data={openTaxModal.data} products={order?.products} />
807
815
  </OModal>
808
- </OrderDetailsContainer>
809
- );
816
+ </OrderDetailsContainer>
817
+ );
810
818
  };
811
819
 
812
820
  export const OrderDetails = (props: OrderDetailsParams) => {
813
- const orderDetailsProps = {
814
- ...props,
815
- UIComponent: OrderDetailsUI,
816
- };
821
+ const orderDetailsProps = {
822
+ ...props,
823
+ UIComponent: OrderDetailsUI,
824
+ };
817
825
 
818
- return <OrderDetailsConTableoller {...orderDetailsProps} />;
826
+ return <OrderDetailsConTableoller {...orderDetailsProps} />;
819
827
  };