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.
- package/package.json +1 -1
- package/src/components/AppleLogin/index.tsx +14 -8
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +8 -8
- package/themes/business/src/components/OrderDetails/styles.tsx +1 -0
- package/themes/doordash/src/components/Cart/index.tsx +1 -0
- package/themes/doordash/src/components/OrderSummary/index.tsx +1 -0
- package/themes/instacart/src/components/OrderDetails/index.tsx +2 -2
- package/themes/single-business/src/components/Cart/index.tsx +127 -16
- package/themes/single-business/src/components/Cart/styles.tsx +39 -0
- package/themes/single-business/src/components/CartContent/index.tsx +56 -52
- package/themes/single-business/src/components/CartContent/styles.tsx +2 -16
- package/themes/single-business/src/components/OrderDetails/index.tsx +724 -708
- package/themes/single-business/src/components/OrderSummary/index.tsx +189 -154
- package/themes/franchises/index.tsx +0 -111
- package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
- package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
- package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
- package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
- package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
- package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
- package/themes/franchises/src/components/AddressList/index.tsx +0 -338
- package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
- package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
- package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
- package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
- package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
- package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
- package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
- package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
- package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
- package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
- package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
- package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
- package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
- package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
- package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
- package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
- package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
- package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
- package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
- package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
- package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
- package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
- package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
- package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
- package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
- package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
- package/themes/franchises/src/components/Cart/index.tsx +0 -332
- package/themes/franchises/src/components/Cart/styles.tsx +0 -28
- package/themes/franchises/src/components/CartContent/index.tsx +0 -60
- package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
- package/themes/franchises/src/components/Checkout/index.tsx +0 -664
- package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
- package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
- package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
- package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
- package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
- package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
- package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
- package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
- package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
- package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
- package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
- package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
- package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
- package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
- package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
- package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
- package/themes/franchises/src/components/Help/index.tsx +0 -56
- package/themes/franchises/src/components/Help/styles.tsx +0 -11
- package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
- package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
- package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
- package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
- package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
- package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
- package/themes/franchises/src/components/Home/index.tsx +0 -102
- package/themes/franchises/src/components/Home/styles.tsx +0 -18
- package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
- package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
- package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
- package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
- package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
- package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
- package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
- package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
- package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
- package/themes/franchises/src/components/Messages/index.tsx +0 -359
- package/themes/franchises/src/components/Messages/styles.tsx +0 -20
- package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
- package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
- package/themes/franchises/src/components/NavBar/index.tsx +0 -129
- package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
- package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
- package/themes/franchises/src/components/Notifications/index.tsx +0 -120
- package/themes/franchises/src/components/Notifications/styles.ts +0 -21
- package/themes/franchises/src/components/OrderDetails/index.tsx +0 -828
- package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
- package/themes/franchises/src/components/OrderSummary/index.tsx +0 -266
- package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
- package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
- package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
- package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
- package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
- package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
- package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
- package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
- package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
- package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
- package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
- package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
- package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
- package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
- package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
- package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
- package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
- package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
- package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
- package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
- package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
- package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
- package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
- package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
- package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
- package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
- package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
- package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
- package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
- package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
- package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
- package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
- package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
- package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
- package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
- package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
- package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
- package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
- package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
- package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
- package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
- package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
- package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
- package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
- package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
- package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
- package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
- package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
- package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
- package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
- package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
- package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
- package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
- package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
- package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
- package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
- package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
- package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
- package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
- package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
- package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
- package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
- package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
- package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
- package/themes/franchises/src/components/shared/OButton.tsx +0 -132
- package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
- package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
- package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
- package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
- package/themes/franchises/src/components/shared/OInput.tsx +0 -113
- package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
- package/themes/franchises/src/components/shared/OModal.tsx +0 -172
- package/themes/franchises/src/components/shared/OText.tsx +0 -52
- package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
- package/themes/franchises/src/components/shared/OToast.tsx +0 -93
- package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
- package/themes/franchises/src/components/shared/index.tsx +0 -29
- package/themes/franchises/src/config/constants.tsx +0 -57
- package/themes/franchises/src/layouts/Container.tsx +0 -23
- package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
- package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
- package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
- package/themes/franchises/src/types/index.tsx +0 -445
- package/themes/franchises/src/utils/index.tsx +0 -222
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import { OrderList, useLanguage, useOrder, ToastType, useToast } from 'ordering-components/native'
|
|
3
|
-
import { useTheme } from 'styled-components/native';
|
|
4
|
-
import { OText } from '../shared'
|
|
5
|
-
import { NotFoundSource } from '../NotFoundSource'
|
|
6
|
-
|
|
7
|
-
import { ItemWrap } from './styles'
|
|
8
|
-
import { OrdersOptionParams } from '../../types'
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
Placeholder,
|
|
12
|
-
PlaceholderLine,
|
|
13
|
-
Fade
|
|
14
|
-
} from "rn-placeholder";
|
|
15
|
-
import { View } from 'react-native'
|
|
16
|
-
import moment from 'moment'
|
|
17
|
-
|
|
18
|
-
const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
19
|
-
const {
|
|
20
|
-
navigation,
|
|
21
|
-
activeOrders,
|
|
22
|
-
preOrders,
|
|
23
|
-
orderList,
|
|
24
|
-
pagination,
|
|
25
|
-
titleContent,
|
|
26
|
-
customArray,
|
|
27
|
-
onNavigationRedirect,
|
|
28
|
-
orderStatus,
|
|
29
|
-
loadMoreOrders,
|
|
30
|
-
loadOrders
|
|
31
|
-
} = props
|
|
32
|
-
|
|
33
|
-
const [, t] = useLanguage()
|
|
34
|
-
const [, { reorder }] = useOrder()
|
|
35
|
-
const { showToast } = useToast()
|
|
36
|
-
const { loading, error, orders: values } = orderList
|
|
37
|
-
|
|
38
|
-
const theme = useTheme();
|
|
39
|
-
|
|
40
|
-
const imageFails = activeOrders
|
|
41
|
-
? theme.images.general.emptyActiveOrders
|
|
42
|
-
: theme.images.general.emptyPastOrders
|
|
43
|
-
|
|
44
|
-
const orders = customArray || values || []
|
|
45
|
-
|
|
46
|
-
const [reorderLoading, setReorderLoading] = useState(false)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const handleReorder = async (orderId: number) => {
|
|
50
|
-
setReorderLoading(true)
|
|
51
|
-
try {
|
|
52
|
-
const { error, result } = await reorder(orderId)
|
|
53
|
-
if (!error) {
|
|
54
|
-
onNavigationRedirect && onNavigationRedirect('CheckoutNavigator', { cartUuid: result.uuid })
|
|
55
|
-
setReorderLoading(false)
|
|
56
|
-
return
|
|
57
|
-
}
|
|
58
|
-
setReorderLoading(false)
|
|
59
|
-
|
|
60
|
-
} catch (err) {
|
|
61
|
-
showToast(ToastType.Error, t('ERROR', err.message))
|
|
62
|
-
setReorderLoading(false)
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const formatDate = (dateStr: string) => {
|
|
67
|
-
return moment(dateStr).format('MMMM DD,YYYY - hh:mm a');
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const getOrderStatus = (s: string) => {
|
|
71
|
-
const status = parseInt(s)
|
|
72
|
-
const orderStatus = [
|
|
73
|
-
{ key: 0, value: t('PENDING', 'Pending') },
|
|
74
|
-
{ key: 1, value: t('COMPLETED', 'Completed') },
|
|
75
|
-
{ key: 2, value: t('REJECTED', 'Rejected') },
|
|
76
|
-
{ key: 3, value: t('DRIVER_IN_BUSINESS', 'Driver in business') },
|
|
77
|
-
{ key: 4, value: t('PREPARATION_COMPLETED', 'Preparation Completed') },
|
|
78
|
-
{ key: 5, value: t('REJECTED_BY_BUSINESS', 'Rejected by business') },
|
|
79
|
-
{ key: 6, value: t('REJECTED_BY_DRIVER', 'Rejected by Driver') },
|
|
80
|
-
{ key: 7, value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business') },
|
|
81
|
-
{ key: 8, value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver') },
|
|
82
|
-
{ key: 9, value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver') },
|
|
83
|
-
{ key: 10, value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver') },
|
|
84
|
-
{ key: 11, value: t('DELIVERY_COMPLETED_BY_DRIVER', 'Delivery completed by driver') },
|
|
85
|
-
{ key: 12, value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver') },
|
|
86
|
-
{ key: 13, value: t('PREORDER', 'PreOrder') },
|
|
87
|
-
{ key: 14, value: t('ORDER_NOT_READY', 'Order not ready') },
|
|
88
|
-
{ key: 15, value: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', 'Order picked up completed by customer') },
|
|
89
|
-
{ key: 16, value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer') },
|
|
90
|
-
{ key: 17, value: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer') },
|
|
91
|
-
{ key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business') },
|
|
92
|
-
{ key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer') },
|
|
93
|
-
{ key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
|
|
94
|
-
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') }
|
|
95
|
-
]
|
|
96
|
-
|
|
97
|
-
const objectStatus = orderStatus.find((o) => o.key === status)
|
|
98
|
-
|
|
99
|
-
return objectStatus && objectStatus
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return (
|
|
103
|
-
<>
|
|
104
|
-
{/* {(orders.length > 0) && (
|
|
105
|
-
<>
|
|
106
|
-
<OptionTitle>
|
|
107
|
-
<OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={10} >
|
|
108
|
-
{titleContent || (activeOrders
|
|
109
|
-
? t('ACTIVE', 'Active')
|
|
110
|
-
: preOrders
|
|
111
|
-
? t('PREORDERS', 'Preorders')
|
|
112
|
-
: t('PAST', 'Past'))}
|
|
113
|
-
</OText>
|
|
114
|
-
</OptionTitle>
|
|
115
|
-
</>
|
|
116
|
-
)} */}
|
|
117
|
-
{!loading && orders.length === 0 && (
|
|
118
|
-
<NotFoundSource
|
|
119
|
-
content={t('NO_RESULTS_FOUND', 'Sorry, no results found')}
|
|
120
|
-
image={imageFails}
|
|
121
|
-
conditioned
|
|
122
|
-
/>
|
|
123
|
-
)}
|
|
124
|
-
{loading && (
|
|
125
|
-
<>
|
|
126
|
-
<View style={{ marginTop: 30 }}>
|
|
127
|
-
{[...Array(3)].map((item, i) => (
|
|
128
|
-
<Placeholder key={i} Animation={Fade}>
|
|
129
|
-
<View style={{ width: '100%', flexDirection: 'row' }}>
|
|
130
|
-
<PlaceholderLine width={20} height={70} style={{ marginRight: 20, marginBottom: 20 }} />
|
|
131
|
-
<Placeholder>
|
|
132
|
-
<PlaceholderLine width={30} style={{ marginTop: 5 }} />
|
|
133
|
-
<PlaceholderLine width={50} />
|
|
134
|
-
<PlaceholderLine width={20} />
|
|
135
|
-
</Placeholder>
|
|
136
|
-
</View>
|
|
137
|
-
</Placeholder>
|
|
138
|
-
))}
|
|
139
|
-
</View>
|
|
140
|
-
</>
|
|
141
|
-
)}
|
|
142
|
-
{!loading && !error && orders.length > 0 && (
|
|
143
|
-
orders.map((order: any) =>
|
|
144
|
-
<ItemWrap imageStyle={{ opacity: 0.7 }} source={order.business?.header ? { uri: order.business?.header } : theme.images.dummies.product} key={order.id}>
|
|
145
|
-
<OText color={theme.colors.white} size={12} lineHeight={18} weight={'600'}>{order?.business?.name}</OText>
|
|
146
|
-
<OText color={theme.colors.white} size={10} lineHeight={15}>{`${getOrderStatus(order.status)?.value} on ${formatDate(order?.created_at)}`}</OText>
|
|
147
|
-
</ItemWrap>)
|
|
148
|
-
)}
|
|
149
|
-
</>
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export const LastOrder = (props: OrdersOptionParams) => {
|
|
154
|
-
const MyOrdersProps = {
|
|
155
|
-
...props,
|
|
156
|
-
UIComponent: OrdersOptionUI,
|
|
157
|
-
orderStatus: [1, 2, 5, 6, 10, 11, 12, 16, 17],
|
|
158
|
-
useDefualtSessionManager: true,
|
|
159
|
-
paginationSettings: {
|
|
160
|
-
initialPage: 1,
|
|
161
|
-
pageSize: 3,
|
|
162
|
-
controlType: 'infinity'
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
return <OrderList {...MyOrdersProps} />
|
|
167
|
-
|
|
168
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components/native';
|
|
2
|
-
|
|
3
|
-
export const OptionTitle = styled.View`
|
|
4
|
-
margin-top: 24px;
|
|
5
|
-
`;
|
|
6
|
-
export const ItemWrap = styled.ImageBackground`
|
|
7
|
-
height: 100px;
|
|
8
|
-
width: 100%;
|
|
9
|
-
border-radius: 7.6px;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
align-items: flex-start;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
padding-horizontal: 39px;
|
|
14
|
-
margin-bottom: 24px;
|
|
15
|
-
background-color: black;
|
|
16
|
-
`;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
OrderList as OrderListController,
|
|
4
|
-
useUtils,
|
|
5
|
-
useLanguage
|
|
6
|
-
} from 'ordering-components/native'
|
|
7
|
-
import { View, StyleSheet} from 'react-native'
|
|
8
|
-
import { LastOrdersParams } from '../../types'
|
|
9
|
-
import {
|
|
10
|
-
Placeholder,
|
|
11
|
-
PlaceholderLine,
|
|
12
|
-
Fade
|
|
13
|
-
} from "rn-placeholder"
|
|
14
|
-
import { OIcon, OText } from '../shared'
|
|
15
|
-
import { useTheme } from 'styled-components/native'
|
|
16
|
-
import {
|
|
17
|
-
OrderContainer,
|
|
18
|
-
OrderInfo
|
|
19
|
-
} from './styles'
|
|
20
|
-
|
|
21
|
-
const LastOrdersUI = (props: LastOrdersParams) => {
|
|
22
|
-
const {
|
|
23
|
-
orderList,
|
|
24
|
-
onRedirect
|
|
25
|
-
} = props
|
|
26
|
-
const { loading, error, orders } = orderList
|
|
27
|
-
|
|
28
|
-
const [{ parseDate, optimizeImage }] = useUtils()
|
|
29
|
-
const [, t] = useLanguage()
|
|
30
|
-
const theme = useTheme()
|
|
31
|
-
|
|
32
|
-
const styles = StyleSheet.create({
|
|
33
|
-
headerLogo: {
|
|
34
|
-
borderRadius: 8,
|
|
35
|
-
width: '100%',
|
|
36
|
-
height: 100
|
|
37
|
-
},
|
|
38
|
-
completedTimeStyle: {
|
|
39
|
-
flexDirection: 'row',
|
|
40
|
-
alignItems: 'center'
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const handleClickViewOrder = (uuid: string) => {
|
|
45
|
-
onRedirect && onRedirect('OrderDetails', { orderId: uuid })
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<>
|
|
50
|
-
{loading ? (
|
|
51
|
-
<>
|
|
52
|
-
{[...Array(3)].map((item, i) => (
|
|
53
|
-
<Placeholder key={i} Animation={Fade}>
|
|
54
|
-
<PlaceholderLine height={100} style={{ marginBottom: 20, borderRadius: 8 }} />
|
|
55
|
-
</Placeholder>
|
|
56
|
-
))}
|
|
57
|
-
</>
|
|
58
|
-
) : (
|
|
59
|
-
<>
|
|
60
|
-
{orders.map((order: any) => (
|
|
61
|
-
<OrderContainer
|
|
62
|
-
key={order.id}
|
|
63
|
-
onPress={() => handleClickViewOrder(order?.uuid)}
|
|
64
|
-
>
|
|
65
|
-
<OIcon
|
|
66
|
-
url={optimizeImage(order.business?.header, 'h_300,c_limit')}
|
|
67
|
-
style={styles.headerLogo}
|
|
68
|
-
cover
|
|
69
|
-
/>
|
|
70
|
-
<OrderInfo>
|
|
71
|
-
<OText weight={700} size={16} color={theme.colors.white}>{order?.business?.name}</OText>
|
|
72
|
-
{(order.delivery_datetime_utc || order?.delivery_datetime) && (
|
|
73
|
-
<View style={styles.completedTimeStyle}>
|
|
74
|
-
<OText size={12} color={theme.colors.white} space>{t('TUTORIAL_ORDER_COMPLETED', 'Order Completed')}</OText>
|
|
75
|
-
<OText size={12} color={theme.colors.white}>
|
|
76
|
-
{order.delivery_datetime_utc
|
|
77
|
-
? parseDate(order?.delivery_datetime_utc, { outputFormat: 'MMM DD, YY - hh:mm A' })
|
|
78
|
-
: parseDate(order?.delivery_datetime, { utc: false })}
|
|
79
|
-
</OText>
|
|
80
|
-
</View>
|
|
81
|
-
)}
|
|
82
|
-
</OrderInfo>
|
|
83
|
-
</OrderContainer>
|
|
84
|
-
))}
|
|
85
|
-
</>
|
|
86
|
-
)}
|
|
87
|
-
</>
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export const LastOrders = (props: any) => {
|
|
92
|
-
const helpProps = {
|
|
93
|
-
...props,
|
|
94
|
-
UIComponent: LastOrdersUI,
|
|
95
|
-
orderStatus: [1, 11, 15],
|
|
96
|
-
useDefualtSessionManager: true,
|
|
97
|
-
paginationSettings: {
|
|
98
|
-
initialPage: 1,
|
|
99
|
-
pageSize: 3,
|
|
100
|
-
controlType: 'infinity'
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return <OrderListController {...helpProps} />
|
|
104
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components/native'
|
|
2
|
-
|
|
3
|
-
export const OrderContainer = styled.TouchableOpacity`
|
|
4
|
-
position: relative;
|
|
5
|
-
margin-vertical: 12px;
|
|
6
|
-
`
|
|
7
|
-
|
|
8
|
-
export const OrderInfo = styled.View`
|
|
9
|
-
position: absolute;
|
|
10
|
-
width: 100%;
|
|
11
|
-
height: 100%;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
padding-horizontal: 30px;
|
|
15
|
-
background-color: rgba(0,0,0,0.3);
|
|
16
|
-
border-radius: 8px;
|
|
17
|
-
`
|