ordering-ui-react-native 0.12.56 → 0.12.60

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 (183) hide show
  1. package/package.json +1 -1
  2. package/src/components/AppleLogin/index.tsx +14 -8
  3. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +8 -8
  4. package/themes/business/src/components/OrderDetails/styles.tsx +1 -0
  5. package/themes/doordash/src/components/Cart/index.tsx +1 -0
  6. package/themes/doordash/src/components/OrderSummary/index.tsx +1 -0
  7. package/themes/instacart/src/components/OrderDetails/index.tsx +2 -2
  8. package/themes/single-business/src/components/Cart/index.tsx +127 -16
  9. package/themes/single-business/src/components/Cart/styles.tsx +39 -0
  10. package/themes/single-business/src/components/CartContent/index.tsx +56 -52
  11. package/themes/single-business/src/components/CartContent/styles.tsx +2 -16
  12. package/themes/single-business/src/components/OrderDetails/index.tsx +724 -708
  13. package/themes/single-business/src/components/OrderSummary/index.tsx +189 -154
  14. package/themes/franchises/index.tsx +0 -111
  15. package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
  16. package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
  17. package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
  18. package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
  19. package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
  20. package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
  21. package/themes/franchises/src/components/AddressList/index.tsx +0 -338
  22. package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
  23. package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
  24. package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
  25. package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
  26. package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
  27. package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
  28. package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
  29. package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
  30. package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
  31. package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
  32. package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
  33. package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
  34. package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
  35. package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
  36. package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
  37. package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
  38. package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
  39. package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
  40. package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
  41. package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
  42. package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
  43. package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
  44. package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
  45. package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
  46. package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
  47. package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
  48. package/themes/franchises/src/components/Cart/index.tsx +0 -332
  49. package/themes/franchises/src/components/Cart/styles.tsx +0 -28
  50. package/themes/franchises/src/components/CartContent/index.tsx +0 -60
  51. package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
  52. package/themes/franchises/src/components/Checkout/index.tsx +0 -664
  53. package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
  54. package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
  55. package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
  56. package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
  57. package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
  58. package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
  59. package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
  60. package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
  61. package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
  62. package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
  63. package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
  64. package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
  65. package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
  66. package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
  67. package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
  68. package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
  69. package/themes/franchises/src/components/Help/index.tsx +0 -56
  70. package/themes/franchises/src/components/Help/styles.tsx +0 -11
  71. package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
  72. package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
  73. package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
  74. package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
  75. package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
  76. package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
  77. package/themes/franchises/src/components/Home/index.tsx +0 -102
  78. package/themes/franchises/src/components/Home/styles.tsx +0 -18
  79. package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
  80. package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
  81. package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
  82. package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
  83. package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
  84. package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
  85. package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
  86. package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
  87. package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
  88. package/themes/franchises/src/components/Messages/index.tsx +0 -359
  89. package/themes/franchises/src/components/Messages/styles.tsx +0 -20
  90. package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
  91. package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
  92. package/themes/franchises/src/components/NavBar/index.tsx +0 -129
  93. package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
  94. package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
  95. package/themes/franchises/src/components/Notifications/index.tsx +0 -120
  96. package/themes/franchises/src/components/Notifications/styles.ts +0 -21
  97. package/themes/franchises/src/components/OrderDetails/index.tsx +0 -828
  98. package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
  99. package/themes/franchises/src/components/OrderSummary/index.tsx +0 -266
  100. package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
  101. package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
  102. package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
  103. package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
  104. package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
  105. package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
  106. package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
  107. package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
  108. package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
  109. package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
  110. package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
  111. package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
  112. package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
  113. package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
  114. package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
  115. package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
  116. package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
  117. package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
  118. package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
  119. package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
  120. package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
  121. package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
  122. package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
  123. package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
  124. package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
  125. package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
  126. package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
  127. package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
  128. package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
  129. package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
  130. package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
  131. package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
  132. package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
  133. package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
  134. package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
  135. package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
  136. package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
  137. package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
  138. package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
  139. package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
  140. package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
  141. package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
  142. package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
  143. package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
  144. package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
  145. package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
  146. package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
  147. package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
  148. package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
  149. package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
  150. package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
  151. package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
  152. package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
  153. package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
  154. package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
  155. package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
  156. package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
  157. package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
  158. package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
  159. package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
  160. package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
  161. package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
  162. package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
  163. package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
  164. package/themes/franchises/src/components/shared/OButton.tsx +0 -132
  165. package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
  166. package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
  167. package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
  168. package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
  169. package/themes/franchises/src/components/shared/OInput.tsx +0 -113
  170. package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
  171. package/themes/franchises/src/components/shared/OModal.tsx +0 -172
  172. package/themes/franchises/src/components/shared/OText.tsx +0 -52
  173. package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
  174. package/themes/franchises/src/components/shared/OToast.tsx +0 -93
  175. package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
  176. package/themes/franchises/src/components/shared/index.tsx +0 -29
  177. package/themes/franchises/src/config/constants.tsx +0 -57
  178. package/themes/franchises/src/layouts/Container.tsx +0 -23
  179. package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
  180. package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
  181. package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
  182. package/themes/franchises/src/types/index.tsx +0 -445
  183. package/themes/franchises/src/utils/index.tsx +0 -222
@@ -1,188 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { useLanguage, useUtils } from 'ordering-components/native';
3
- import { useTheme } from 'styled-components/native';
4
- import { StyleSheet, TouchableOpacity, ScrollView, View } from 'react-native';
5
- import { OButton, OIcon, OText } from '../shared';
6
- import {
7
- Card,
8
- Logo,
9
- Information,
10
- MyOrderOptions,
11
- Status,
12
- WrappButton,
13
- } from './styles';
14
- import { PreviousOrdersParams } from '../../types';
15
- import moment from 'moment';
16
-
17
- export const PreviousOrders = (props: PreviousOrdersParams) => {
18
- const {
19
- orders,
20
- pagination,
21
- onNavigationRedirect,
22
- loadMoreOrders,
23
- getOrderStatus,
24
- handleReorder,
25
- reorderLoading,
26
- orderID,
27
- } = props;
28
-
29
- const theme = useTheme();
30
-
31
-
32
- const styles = StyleSheet.create({
33
- logo: {
34
- borderRadius: 10,
35
- width: 64,
36
- height: 64,
37
- },
38
- reorderbutton: {
39
- height: 23,
40
- paddingLeft: 10,
41
- paddingRight: 10,
42
- borderRadius: 23,
43
- shadowOpacity: 0,
44
- backgroundColor: theme.colors.primaryContrast,
45
- borderWidth: 0,
46
- },
47
- reorderLoading: {
48
- width: 80,
49
- height: 40,
50
- borderRadius: 10,
51
- },
52
- reviewButton: {
53
- height: 23,
54
- maxHeight: 23,
55
- backgroundColor: theme.colors.white,
56
- alignItems: 'center',
57
- justifyContent: 'center',
58
- paddingHorizontal: 10,
59
- borderRadius: 23,
60
- borderWidth: 1,
61
- borderColor: theme.colors.primaryContrast,
62
- },
63
- buttonText: {
64
- color: theme.colors.primary,
65
- fontSize: 10,
66
- marginLeft: 2,
67
- marginRight: 2,
68
- },
69
- });
70
-
71
-
72
- const [, t] = useLanguage();
73
- const [reorderSelected, setReorderSelected] = useState<number | null>(null);
74
- const [{ parseDate, optimizeImage }] = useUtils();
75
- const allowedOrderStatus = [1, 2, 5, 6, 10, 11, 12];
76
-
77
- const handleClickViewOrder = (uuid: string) => {
78
- onNavigationRedirect &&
79
- onNavigationRedirect('OrderDetails', { orderId: uuid });
80
- };
81
-
82
- const handleClickOrderReview = (order: any) => {
83
- onNavigationRedirect &&
84
- onNavigationRedirect('ReviewOrder', {
85
- order: {
86
- id: order?.id,
87
- business_id: order?.business_id,
88
- logo: order.business?.logo,
89
- products: order?.products?.map(({product_id, name}: any) => {
90
- return {
91
- id: product_id,
92
- name
93
- }
94
- }),
95
- driver: order?.driver
96
- },
97
- });
98
- };
99
-
100
- const formatDate = (date: string, option?: any) => {
101
- return option?.utc ? moment.utc(date).format('DD/MM/YY \u2022 h:m a') : moment(date).format('DD/MM/YY \u2022 h:m a');
102
- };
103
-
104
- const handleReorderClick = (id: number) => {
105
- setReorderSelected(id);
106
- handleReorder(id);
107
- };
108
-
109
- return (
110
- <View style={{ marginBottom: 30 }}>
111
- {orders.map((order: any) => (
112
- <TouchableOpacity
113
- onPress={() => handleClickViewOrder(order?.uuid)}
114
- activeOpacity={0.7}
115
- style={{ flexDirection: 'row' }}
116
- key={order.id}>
117
- <Card>
118
- {/* {!!order.business?.logo && (
119
- <Logo>
120
- <OIcon
121
- url={optimizeImage(order.business?.logo, 'h_300,c_limit')}
122
- style={styles.logo}
123
- />
124
- </Logo>
125
- )} */}
126
- <Information>
127
- <OText size={12} lineHeight={18} weight={'600'} numberOfLines={1} ellipsizeMode={'tail'}>
128
- {`${t('ORDER_NO', 'Order No')}.${order.id}`}
129
- </OText>
130
- <OText
131
- size={10}
132
- lineHeight={21}
133
- color={theme.colors.textSecondary}
134
- style={{ marginVertical: 3 }}
135
- numberOfLines={1}>
136
- {order?.delivery_datetime_utc
137
- ? formatDate(order?.delivery_datetime_utc)
138
- : formatDate(order?.delivery_datetime, { utc: false })}
139
- </OText>
140
- <OText
141
- color={theme.colors.primary}
142
- size={10}
143
- lineHeight={15}
144
- numberOfLines={1}>
145
- {getOrderStatus(order.status)?.value}
146
- </OText>
147
- </Information>
148
- <Status>
149
- <OButton
150
- text={t('REORDER', 'Reorder')}
151
- imgRightSrc={''}
152
- textStyle={styles.buttonText}
153
- style={
154
- reorderLoading && order.id === reorderSelected
155
- ? styles.reorderLoading
156
- : styles.reorderbutton
157
- }
158
- onClick={() => handleReorderClick(order.id)}
159
- isLoading={reorderLoading && order.id === reorderSelected}
160
- />
161
- {allowedOrderStatus.includes(parseInt(order?.status)) &&
162
- !order.review && (
163
- <TouchableOpacity
164
- onPress={() => handleClickOrderReview(order)}
165
- style={styles.reviewButton}>
166
- <OText size={10} color={theme.colors.primary} numberOfLines={1}>
167
- {t('REVIEW', 'Review')}
168
- </OText>
169
- </TouchableOpacity>
170
- )}
171
- </Status>
172
- </Card>
173
- </TouchableOpacity>
174
- ))}
175
- {pagination.totalPages && pagination.currentPage < pagination.totalPages && (
176
- <WrappButton>
177
- <OButton
178
- onClick={loadMoreOrders}
179
- text={t('LOAD_MORE_ORDERS', 'Load more orders')}
180
- imgRightSrc={null}
181
- textStyle={{ color: theme.colors.white }}
182
- style={{ borderRadius: 7.6, shadowOpacity: 0, marginTop: 20 }}
183
- />
184
- </WrappButton>
185
- )}
186
- </View>
187
- );
188
- };
@@ -1,33 +0,0 @@
1
- import styled from 'styled-components/native'
2
-
3
- export const Card = styled.View`
4
- padding-vertical: 5px;
5
- margin-bottom: 12px;
6
- flex-direction: row;
7
- width: 100%;
8
- `
9
-
10
- export const Logo = styled.View`
11
- border-radius: 7.6px;
12
- box-shadow: 0 1px 2px #0000001A;
13
- `
14
-
15
- export const Information = styled.View`
16
- justify-content: center;
17
- align-items: flex-start;
18
- margin-end: 7px;
19
- flex: 1;
20
- `
21
-
22
- export const MyOrderOptions = styled.View`
23
- flex-direction: column;
24
- justify-content: space-between;
25
- `
26
-
27
- export const Status = styled.View`
28
- align-items: center;
29
- justify-content: space-between;
30
- `
31
-
32
- export const WrappButton = styled.View`
33
- `