ordering-ui-react-native 0.17.75 → 0.17.77
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/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +0 -1
- package/themes/original/src/components/Notifications/styles.tsx +1 -5
- package/themes/original/src/components/OrdersOption/index.tsx +15 -13
package/package.json
CHANGED
|
@@ -557,7 +557,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
557
557
|
<PageBanner position='app_business_listing' />
|
|
558
558
|
|
|
559
559
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
560
|
-
<ListWrapper
|
|
560
|
+
<ListWrapper style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
|
|
561
561
|
{!businessId && (
|
|
562
562
|
<BusinessTypeFilter
|
|
563
563
|
images={props.images}
|
|
@@ -67,7 +67,6 @@ export const HeaderWrapper = styled.ImageBackground`
|
|
|
67
67
|
|
|
68
68
|
export const ListWrapper = styled.View`
|
|
69
69
|
background-color: ${(props: any) => props.theme.colors.backgroundLight};
|
|
70
|
-
padding-horizontal: ${(props: any) => props.ph ?? 40}px;
|
|
71
70
|
`;
|
|
72
71
|
|
|
73
72
|
export const FeaturedWrapper = styled.View`
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components/native'
|
|
2
2
|
|
|
3
|
-
export const ContainerButtons = styled.View`
|
|
4
|
-
margin-vertical: 50px
|
|
5
|
-
`
|
|
6
|
-
|
|
7
3
|
export const Container = styled.ScrollView`
|
|
8
4
|
position: relative;
|
|
9
5
|
flex: 1;
|
|
@@ -13,7 +9,7 @@ export const Container = styled.ScrollView`
|
|
|
13
9
|
export const NotificationsGroupSwitchWrapper = styled.View`
|
|
14
10
|
flex-grow: 1;
|
|
15
11
|
justify-content: space-between;
|
|
16
|
-
|
|
12
|
+
padding: 0 20px;
|
|
17
13
|
`
|
|
18
14
|
|
|
19
15
|
export const SwitchWrapper = styled.View`
|
|
@@ -72,9 +72,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
72
72
|
|
|
73
73
|
useEffect(() => {
|
|
74
74
|
if (loading || error) return
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
const ordersReduced = _orders.map((order: any) => order?.cart_group_id
|
|
76
|
+
? _orders
|
|
77
|
+
?.filter((_order : any) => _order?.cart_group_id === order?.cart_group_id)
|
|
78
78
|
?.reduce((orderCompleted : any, currentOrder : any) => ({
|
|
79
79
|
...orderCompleted,
|
|
80
80
|
total: orderCompleted.summary?.total + currentOrder?.summary?.total,
|
|
@@ -84,17 +84,19 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
84
84
|
review: orderCompleted.review && currentOrder.review,
|
|
85
85
|
user_review: orderCompleted.user_review && currentOrder.user_review,
|
|
86
86
|
products: [orderCompleted.products, currentOrder.products].flat()
|
|
87
|
-
}))
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
}))
|
|
88
|
+
: order)
|
|
89
|
+
const orders = ordersReduced?.filter((order: any) => {
|
|
90
|
+
if (!order?.cart_group_id) return true
|
|
91
|
+
const isDuplicate = uniqueOrders.includes(order?.cart_group_id)
|
|
92
|
+
if (!isDuplicate) {
|
|
93
|
+
uniqueOrders.push(order?.cart_group_id)
|
|
94
|
+
return true
|
|
95
|
+
}
|
|
96
|
+
return false
|
|
97
|
+
})
|
|
96
98
|
setOrders(orders)
|
|
97
|
-
}, [
|
|
99
|
+
}, [_orders?.length])
|
|
98
100
|
|
|
99
101
|
const getOrderStatus = (s: string) => {
|
|
100
102
|
const status = parseInt(s)
|