ordering-ui-react-native 0.17.48-release → 0.17.49-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -25,11 +25,12 @@ export const MyOrders = (props: any) => {
|
|
|
25
25
|
const [ordersLength, setOrdersLength] = useState({
|
|
26
26
|
activeOrdersLength: null,
|
|
27
27
|
previousOrdersLength: 0,
|
|
28
|
+
preordersLength: 0
|
|
28
29
|
});
|
|
29
30
|
const [selectedOption, setSelectedOption] = useState(!hideOrders ? 'orders' : 'business')
|
|
30
31
|
|
|
31
32
|
const notOrderOptions = ['business', 'products']
|
|
32
|
-
const allEmpty = (ordersLength?.activeOrdersLength === 0 && ordersLength?.previousOrdersLength === 0) || ((isEmptyBusinesses || businessOrderIds?.length === 0) && hideOrders)
|
|
33
|
+
const allEmpty = (ordersLength?.activeOrdersLength === 0 && ordersLength?.previousOrdersLength === 0 && ordersLength?.preordersLength === 0) || ((isEmptyBusinesses || businessOrderIds?.length === 0) && hideOrders)
|
|
33
34
|
|
|
34
35
|
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
35
36
|
const showNavbar = theme?.bar_menu?.components?.orders?.hidden
|
|
@@ -147,6 +148,16 @@ export const MyOrders = (props: any) => {
|
|
|
147
148
|
)}
|
|
148
149
|
{selectedOption === 'orders' && (
|
|
149
150
|
<>
|
|
151
|
+
<View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
|
|
152
|
+
<OrdersOption
|
|
153
|
+
{...props}
|
|
154
|
+
preOrders
|
|
155
|
+
ordersLength={ordersLength}
|
|
156
|
+
setOrdersLength={setOrdersLength}
|
|
157
|
+
setRefreshOrders={setRefreshOrders}
|
|
158
|
+
refreshOrders={refreshOrders}
|
|
159
|
+
/>
|
|
160
|
+
</View>
|
|
150
161
|
<View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
|
|
151
162
|
<OrdersOption
|
|
152
163
|
{...props}
|
|
@@ -198,7 +198,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
198
198
|
|
|
199
199
|
return (
|
|
200
200
|
<>
|
|
201
|
-
{!loading && ordersLength.activeOrdersLength === 0 && ordersLength.previousOrdersLength === 0 && !activeOrders && (
|
|
201
|
+
{!loading && ordersLength.activeOrdersLength === 0 && ordersLength.previousOrdersLength === 0 && ordersLength?.preordersLength === 0 && !activeOrders && !preOrders && (
|
|
202
202
|
<NoOrdersWrapper>
|
|
203
203
|
<NotFoundSource
|
|
204
204
|
hideImage
|
|
@@ -209,7 +209,10 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
209
209
|
/>
|
|
210
210
|
</NoOrdersWrapper>
|
|
211
211
|
)}
|
|
212
|
-
{((ordersLength?.activeOrdersLength > 0 && activeOrders) ||
|
|
212
|
+
{((ordersLength?.activeOrdersLength > 0 && activeOrders) ||
|
|
213
|
+
(ordersLength?.previousOrdersLength > 0 && !activeOrders && !preOrders) ||
|
|
214
|
+
(ordersLength?.preordersLength > 0 && preOrders)
|
|
215
|
+
) && (
|
|
213
216
|
<>
|
|
214
217
|
{((titleContent && ((isBusiness && businessOrderIds?.length > 0) || isProducts)) || !titleContent) && (
|
|
215
218
|
<OptionTitle titleContent={!!titleContent} isBusinessesSearchList={!!businessesSearchList}>
|