ordering-ui-react-native 0.18.2 → 0.18.3-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 +9 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +0 -20
- package/src/components/PaymentOptionsWebView/index.tsx +29 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +136 -102
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +7 -2
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +36 -26
- package/themes/business/src/components/BusinessController/index.tsx +19 -17
- package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
- package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
- package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
- package/themes/business/src/components/Chat/index.tsx +163 -123
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/index.tsx +5 -2
- package/themes/business/src/components/MapView/index.tsx +14 -10
- package/themes/business/src/components/MessagesOption/index.tsx +22 -94
- package/themes/business/src/components/NewOrderNotification/index.tsx +123 -96
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +205 -12
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +67 -39
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +47 -23
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +9 -4
- package/themes/business/src/components/OrderMessage/index.tsx +1 -1
- package/themes/business/src/components/OrderSummary/index.tsx +114 -123
- package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
- package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
- package/themes/business/src/components/OrdersOption/index.tsx +43 -32
- package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +21 -29
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +193 -221
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/ReviewCustomer/index.tsx +3 -1
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/StoresList/index.tsx +6 -5
- package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/types/index.tsx +8 -0
- package/themes/business/src/utils/index.tsx +4 -4
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -5
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +7 -3
- package/themes/original/src/components/AddressDetails/index.tsx +19 -3
- package/themes/original/src/components/AddressForm/index.tsx +33 -15
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +5 -8
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +74 -38
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +11 -13
- package/themes/original/src/components/BusinessController/index.tsx +35 -44
- package/themes/original/src/components/BusinessController/styles.tsx +12 -5
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +140 -85
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +25 -26
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +133 -438
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -19
- package/themes/original/src/components/BusinessPreorder/index.tsx +105 -22
- package/themes/original/src/components/BusinessPreorder/styles.tsx +14 -0
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -3
- package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +162 -39
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +4 -5
- package/themes/original/src/components/BusinessReviews/index.tsx +4 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +37 -404
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +49 -47
- package/themes/original/src/components/CartContent/index.tsx +99 -38
- package/themes/original/src/components/CartContent/styles.tsx +6 -6
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +324 -43
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/index.tsx +1 -1
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DatePicker/index.tsx +17 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/DriverTips/index.tsx +6 -3
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +4 -9
- package/themes/original/src/components/Favorite/styles.tsx +0 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +7 -5
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +42 -5
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +3 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +63 -7
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +14 -5
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
- package/themes/original/src/components/LoginForm/index.tsx +64 -34
- package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
- package/themes/original/src/components/MessageListing/index.tsx +9 -2
- package/themes/original/src/components/Messages/index.tsx +15 -4
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +9 -10
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +161 -49
- package/themes/original/src/components/MultiCheckout/index.tsx +348 -70
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +2 -2
- package/themes/original/src/components/MyOrders/index.tsx +16 -5
- package/themes/original/src/components/NavBar/index.tsx +20 -13
- package/themes/original/src/components/NetworkError/index.tsx +2 -3
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/Notifications/index.tsx +4 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +22 -6
- package/themes/original/src/components/OrderDetails/index.tsx +721 -670
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +34 -25
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +62 -57
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +13 -13
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +44 -21
- package/themes/original/src/components/OrdersOption/styles.tsx +2 -2
- package/themes/original/src/components/PageBanner/index.tsx +65 -29
- package/themes/original/src/components/PageBanner/styles.tsx +0 -3
- package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +100 -34
- package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
- package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +106 -170
- package/themes/original/src/components/ProductForm/styles.tsx +3 -3
- package/themes/original/src/components/ProductItemAccordion/index.tsx +13 -6
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +49 -20
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +6 -6
- package/themes/original/src/components/Promotions/styles.tsx +3 -3
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/ServiceForm/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/SignupForm/index.tsx +27 -16
- package/themes/original/src/components/SingleOrderCard/index.tsx +44 -20
- package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +13 -10
- package/themes/original/src/components/SingleProductCard/styles.tsx +8 -3
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +61 -5
- package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
- package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +16 -205
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserDetails/index.tsx +3 -1
- package/themes/original/src/components/UserFormDetails/index.tsx +100 -22
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +8 -26
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -31
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +48 -60
- package/themes/original/src/components/Wallets/styles.tsx +3 -4
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +3 -3
- package/themes/original/src/components/shared/OInput.tsx +4 -5
- package/themes/original/src/components/shared/OModal.tsx +15 -17
- package/themes/original/src/layouts/Container.tsx +5 -3
- package/themes/original/src/types/index.tsx +28 -6
- package/themes/original/src/utils/index.tsx +180 -13
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
|
@@ -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
|
|
@@ -86,7 +87,7 @@ export const MyOrders = (props: any) => {
|
|
|
86
87
|
display: 'flex',
|
|
87
88
|
flexDirection: 'row',
|
|
88
89
|
alignItems: 'center',
|
|
89
|
-
paddingHorizontal:
|
|
90
|
+
paddingHorizontal: 20,
|
|
90
91
|
},
|
|
91
92
|
...props.titleStyle
|
|
92
93
|
}}>
|
|
@@ -123,7 +124,7 @@ export const MyOrders = (props: any) => {
|
|
|
123
124
|
<ScrollView
|
|
124
125
|
horizontal
|
|
125
126
|
style={{ ...styles.container, borderBottomWidth: 1 }}
|
|
126
|
-
contentContainerStyle={{ paddingHorizontal: !!businessesSearchList ? 0 :
|
|
127
|
+
contentContainerStyle={{ paddingHorizontal: !!businessesSearchList ? 0 : 20 }}
|
|
127
128
|
showsHorizontalScrollIndicator={false}
|
|
128
129
|
scrollEventThrottle={16}
|
|
129
130
|
>
|
|
@@ -147,7 +148,17 @@ export const MyOrders = (props: any) => {
|
|
|
147
148
|
)}
|
|
148
149
|
{selectedOption === 'orders' && (
|
|
149
150
|
<>
|
|
150
|
-
<View style={{ paddingHorizontal:
|
|
151
|
+
<View style={{ paddingHorizontal: 20 }}>
|
|
152
|
+
<OrdersOption
|
|
153
|
+
{...props}
|
|
154
|
+
preOrders
|
|
155
|
+
ordersLength={ordersLength}
|
|
156
|
+
setOrdersLength={setOrdersLength}
|
|
157
|
+
setRefreshOrders={setRefreshOrders}
|
|
158
|
+
refreshOrders={refreshOrders}
|
|
159
|
+
/>
|
|
160
|
+
</View>
|
|
161
|
+
<View style={{ paddingHorizontal: 20 }}>
|
|
151
162
|
<OrdersOption
|
|
152
163
|
{...props}
|
|
153
164
|
activeOrders
|
|
@@ -157,7 +168,7 @@ export const MyOrders = (props: any) => {
|
|
|
157
168
|
refreshOrders={refreshOrders}
|
|
158
169
|
/>
|
|
159
170
|
</View>
|
|
160
|
-
<View style={{ paddingHorizontal:
|
|
171
|
+
<View style={{ paddingHorizontal: 20 }}>
|
|
161
172
|
<OrdersOption
|
|
162
173
|
{...props}
|
|
163
174
|
ordersLength={ordersLength}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
1
4
|
import * as React from 'react'
|
|
2
5
|
import styled, { useTheme } from 'styled-components/native'
|
|
3
6
|
import { OButton, OIcon, OText } from '../shared'
|
|
@@ -9,7 +12,6 @@ const TitleWrapper = styled.View`
|
|
|
9
12
|
padding-horizontal: 10px;
|
|
10
13
|
`
|
|
11
14
|
const TitleTopWrapper = styled.View`
|
|
12
|
-
flex: 1;
|
|
13
15
|
flex-direction: row;
|
|
14
16
|
align-items: center;
|
|
15
17
|
`
|
|
@@ -17,8 +19,10 @@ const TitleTopWrapper = styled.View`
|
|
|
17
19
|
const btnBackArrow = {
|
|
18
20
|
borderWidth: 0,
|
|
19
21
|
backgroundColor: '#FFF',
|
|
20
|
-
borderColor: '#
|
|
21
|
-
shadowColor: '#FFF'
|
|
22
|
+
borderColor: '#fff',
|
|
23
|
+
shadowColor: '#FFF',
|
|
24
|
+
paddingLeft: 30,
|
|
25
|
+
paddingRight: 30
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
interface Props {
|
|
@@ -42,6 +46,7 @@ interface Props {
|
|
|
42
46
|
paddingTop?: number,
|
|
43
47
|
isVertical?: boolean,
|
|
44
48
|
noMargin?: any
|
|
49
|
+
hideArrowLeft?: boolean
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
const NavBar = (props: Props) => {
|
|
@@ -52,8 +57,6 @@ const NavBar = (props: Props) => {
|
|
|
52
57
|
background-color: ${theme.colors.white};
|
|
53
58
|
padding: 10px 20px 20px 0px;
|
|
54
59
|
flex-direction: row;
|
|
55
|
-
justify-content: center;
|
|
56
|
-
align-items: center;
|
|
57
60
|
position: relative;
|
|
58
61
|
`
|
|
59
62
|
|
|
@@ -62,13 +65,18 @@ const NavBar = (props: Props) => {
|
|
|
62
65
|
}
|
|
63
66
|
return (
|
|
64
67
|
<Wrapper style={{ paddingTop: props.paddingTop, ...{ flexDirection: props.isVertical ? 'column' : 'row', alignItems: props.isVertical ? 'flex-start' : 'center' }, ...props.style }}>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
{!props.hideArrowLeft && (
|
|
69
|
+
<OButton
|
|
70
|
+
iconProps={{
|
|
71
|
+
name: 'arrowleft',
|
|
72
|
+
size: 26
|
|
73
|
+
}}
|
|
74
|
+
icon={AntDesignIcon}
|
|
75
|
+
imgRightSrc={null}
|
|
76
|
+
style={{ ...btnBackArrow, ...props.btnStyle, ...props.isVertical ? (I18nManager.isRTL ? { paddingRight: 0 } : { paddingLeft: 0 }) : {} }}
|
|
77
|
+
onClick={props?.onActionLeft}
|
|
78
|
+
/>
|
|
79
|
+
)}
|
|
72
80
|
<TitleTopWrapper>
|
|
73
81
|
{props.withIcon
|
|
74
82
|
? (
|
|
@@ -87,7 +95,6 @@ const NavBar = (props: Props) => {
|
|
|
87
95
|
<TitleWrapper style={{ ...{ paddingHorizontal: props.isVertical ? 0 : 10 }, ...props.titleWrapStyle }}>
|
|
88
96
|
<OText
|
|
89
97
|
size={20}
|
|
90
|
-
lineHeight={36}
|
|
91
98
|
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
92
99
|
style={
|
|
93
100
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { useLanguage
|
|
2
|
+
import { useLanguage } from 'ordering-components/native'
|
|
3
3
|
import { Dimensions } from 'react-native'
|
|
4
4
|
import RNRestart from 'react-native-restart'
|
|
5
5
|
import { OText, OIcon, OButton } from '../shared'
|
|
@@ -16,8 +16,7 @@ export const NetworkError = (props: NoNetworkParams) => {
|
|
|
16
16
|
} = props
|
|
17
17
|
const theme = useTheme()
|
|
18
18
|
const [, t] = useLanguage()
|
|
19
|
-
const
|
|
20
|
-
const urlimage = orderingTheme?.theme?.no_internet?.components?.image
|
|
19
|
+
const urlimage = theme?.no_internet?.components?.image
|
|
21
20
|
const noNetworkImage = image || theme.images.general.noNetwork
|
|
22
21
|
const deviceWidth = Dimensions.get('screen').width
|
|
23
22
|
|
|
@@ -2,10 +2,10 @@ import styled from 'styled-components/native'
|
|
|
2
2
|
|
|
3
3
|
export const Container = styled.View`
|
|
4
4
|
flex: 1;
|
|
5
|
-
padding: 20px
|
|
5
|
+
padding: 20px;
|
|
6
6
|
`
|
|
7
7
|
export const ImageContainer = styled.View`
|
|
8
8
|
flex: 1;
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
11
|
-
`
|
|
11
|
+
`
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { View } from 'react-native'
|
|
3
|
-
import { OButton,
|
|
3
|
+
import { OButton, OText } from '../shared'
|
|
4
4
|
import { NotFoundSourceParams } from '../../types'
|
|
5
5
|
import { useTheme } from 'styled-components/native';
|
|
6
|
+
import Foundation from 'react-native-vector-icons/Foundation'
|
|
6
7
|
import {
|
|
7
8
|
NotFound,
|
|
8
9
|
NotFoundImage
|
|
@@ -10,34 +11,37 @@ import {
|
|
|
10
11
|
|
|
11
12
|
export const NotFoundSource = (props: NotFoundSourceParams) => {
|
|
12
13
|
const {
|
|
13
|
-
|
|
14
|
+
hideImage,
|
|
14
15
|
content,
|
|
15
16
|
btnTitle,
|
|
17
|
+
btnStyle,
|
|
16
18
|
conditioned,
|
|
17
19
|
onClickButton
|
|
18
20
|
} = props
|
|
19
21
|
|
|
20
22
|
const theme = useTheme();
|
|
21
23
|
|
|
22
|
-
const errorImage = image || theme.images.general.notFound
|
|
23
|
-
const isUrl = typeof errorImage === 'string' && errorImage.includes('http')
|
|
24
|
-
|
|
25
24
|
return (
|
|
26
25
|
<NotFound>
|
|
27
|
-
{
|
|
26
|
+
{!hideImage && (
|
|
28
27
|
<NotFoundImage>
|
|
29
|
-
<
|
|
28
|
+
<Foundation
|
|
29
|
+
name='page-search'
|
|
30
|
+
color={theme.colors.primary}
|
|
31
|
+
size={60}
|
|
32
|
+
style={{ marginBottom: 10 }}
|
|
33
|
+
/>
|
|
30
34
|
</NotFoundImage>
|
|
31
35
|
)}
|
|
32
|
-
{content && conditioned &&
|
|
33
|
-
{content && !conditioned && <OText color={theme.colors.disabled} size={
|
|
36
|
+
{content && conditioned && <OText color={theme.colors.disabled} size={16} style={{ textAlign: 'center' }}>{content}</OText>}
|
|
37
|
+
{content && !conditioned && <OText color={theme.colors.disabled} size={16} style={{ textAlign: 'center' }}>{content}</OText>}
|
|
34
38
|
{!onClickButton && props.children && (
|
|
35
39
|
props.children
|
|
36
40
|
)}
|
|
37
41
|
{onClickButton && (
|
|
38
42
|
<View style={{ marginTop: 10, width: '100%' }}>
|
|
39
43
|
<OButton
|
|
40
|
-
style={{ width: '100%', height: 50 }}
|
|
44
|
+
style={{ width: '100%', height: 50, ...btnStyle }}
|
|
41
45
|
bgColor={theme.colors.primary}
|
|
42
46
|
borderColor={theme.colors.primary}
|
|
43
47
|
onClick={() => onClickButton()}
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
UserFormDetails as NotificationsController,
|
|
4
4
|
useLanguage,
|
|
5
5
|
useSession,
|
|
6
|
-
useOrderingTheme,
|
|
7
6
|
useToast,
|
|
8
7
|
ToastType,
|
|
9
8
|
} from 'ordering-components/native'
|
|
@@ -28,7 +27,6 @@ const NotificationsUI = (props: any) => {
|
|
|
28
27
|
const [{ user: userSession }] = useSession()
|
|
29
28
|
const [, t] = useLanguage();
|
|
30
29
|
const [, { showToast }] = useToast();
|
|
31
|
-
const [orderingTheme] = useOrderingTheme()
|
|
32
30
|
|
|
33
31
|
const user = userData || userSession
|
|
34
32
|
|
|
@@ -45,8 +43,8 @@ const NotificationsUI = (props: any) => {
|
|
|
45
43
|
})
|
|
46
44
|
|
|
47
45
|
const goToBack = () => navigation?.canGoBack() && navigation.goBack()
|
|
48
|
-
const showCustomerPromotions = !
|
|
49
|
-
const showNotifications = !
|
|
46
|
+
const showCustomerPromotions = !theme?.profile?.components?.promotions?.hidden
|
|
47
|
+
const showNotifications = !theme?.profile?.components?.notification_settings?.hidden
|
|
50
48
|
|
|
51
49
|
const handleEditNotifications = (key: any, value: any) => {
|
|
52
50
|
setNotificationsList({
|
|
@@ -75,10 +73,8 @@ const NotificationsUI = (props: any) => {
|
|
|
75
73
|
titleAlign={'center'}
|
|
76
74
|
onActionLeft={goToBack}
|
|
77
75
|
showCall={false}
|
|
78
|
-
style={{
|
|
79
|
-
|
|
80
|
-
paddingVertical: 0,
|
|
81
|
-
}}
|
|
76
|
+
style={{ paddingVertical: 0 }}
|
|
77
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
82
78
|
/>
|
|
83
79
|
{showCustomerPromotions && showNotifications && (
|
|
84
80
|
<>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useUtils } from 'ordering-components/native'
|
|
3
|
+
import moment from 'moment'
|
|
4
|
+
|
|
5
|
+
export const OrderEta = (props: any) => {
|
|
6
|
+
const {
|
|
7
|
+
order,
|
|
8
|
+
outputFormat
|
|
9
|
+
} = props
|
|
10
|
+
|
|
11
|
+
const [{ parseDate }] = useUtils()
|
|
12
|
+
const [estimatedDeliveryTime, setEstimatedDeliveryTime] = useState(null)
|
|
13
|
+
|
|
14
|
+
const getEstimatedDeliveryTime = () => {
|
|
15
|
+
let estimatedUtcTime = null
|
|
16
|
+
let totalEta = 0
|
|
17
|
+
if (order?.delivered_in) totalEta += order?.delivered_in
|
|
18
|
+
if (order?.prepared_in) totalEta += order?.prepared_in
|
|
19
|
+
if (order?.delivery_type === 1 && order?.eta_drive_time) {
|
|
20
|
+
totalEta += order?.eta_drive_time
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const _delivery = order?.delivery_datetime_utc
|
|
24
|
+
? order?.delivery_datetime_utc
|
|
25
|
+
: order?.delivery_datetime
|
|
26
|
+
|
|
27
|
+
if (order?.eta_current_status_time) {
|
|
28
|
+
const currentStatueEta = order?.eta_current_status_time
|
|
29
|
+
totalEta += currentStatueEta
|
|
30
|
+
let previousStatusTimes = 0
|
|
31
|
+
if (order?.eta_previous_status_times) {
|
|
32
|
+
Object.keys(order.eta_previous_status_times).map(key => {
|
|
33
|
+
if (!key.includes('status_penalty')) {
|
|
34
|
+
previousStatusTimes += order.eta_previous_status_times[key]
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
totalEta += previousStatusTimes
|
|
39
|
+
|
|
40
|
+
let nextStatusTimes = 0
|
|
41
|
+
if (order?.eta_next_status_times) {
|
|
42
|
+
Object.keys(order.eta_next_status_times).map(key => {
|
|
43
|
+
if (!key.includes('status_penalty')) {
|
|
44
|
+
nextStatusTimes += order.eta_next_status_times[key]
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
totalEta += nextStatusTimes
|
|
49
|
+
|
|
50
|
+
const diffTimeAsSeconds = moment.utc(order?.reporting_data?.at[`status:${order.status}`]).add(order?.eta_current_status_time, 'minutes').diff(moment().utc(), 'seconds')
|
|
51
|
+
const diffTimeAsMinutes = Math.ceil(diffTimeAsSeconds / 60)
|
|
52
|
+
if (diffTimeAsMinutes <= 0) {
|
|
53
|
+
totalEta += (Math.floor(Math.abs(diffTimeAsMinutes / order?.eta_current_status_time) + 1) * order?.eta_current_status_penalty_time)
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
totalEta = order?.eta_time + totalEta
|
|
57
|
+
}
|
|
58
|
+
estimatedUtcTime = moment.utc(_delivery).add(totalEta, 'minutes')
|
|
59
|
+
const _estimatedTime = outputFormat ? moment(estimatedUtcTime).local().format(outputFormat) : parseDate(estimatedUtcTime, { utc: false })
|
|
60
|
+
setEstimatedDeliveryTime(_estimatedTime)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
getEstimatedDeliveryTime()
|
|
65
|
+
const interval = setInterval(() => {
|
|
66
|
+
getEstimatedDeliveryTime()
|
|
67
|
+
}, 1000)
|
|
68
|
+
return () => clearInterval(interval)
|
|
69
|
+
}, [order, outputFormat])
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<>
|
|
73
|
+
{estimatedDeliveryTime}
|
|
74
|
+
</>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
@@ -4,6 +4,7 @@ import { ScrollView, StyleSheet, View } from 'react-native'
|
|
|
4
4
|
import { useLanguage, useUtils } from 'ordering-components/native'
|
|
5
5
|
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
6
6
|
import { OText, OButton } from '../shared'
|
|
7
|
+
import { formatSeconds } from '../../utils'
|
|
7
8
|
|
|
8
9
|
export const OrderHistory = (props: any) => {
|
|
9
10
|
const {
|
|
@@ -32,7 +33,7 @@ export const OrderHistory = (props: any) => {
|
|
|
32
33
|
paddingVertical: 16
|
|
33
34
|
},
|
|
34
35
|
container: {
|
|
35
|
-
paddingHorizontal:
|
|
36
|
+
paddingHorizontal: 20,
|
|
36
37
|
paddingVertical: 15
|
|
37
38
|
}
|
|
38
39
|
});
|
|
@@ -61,7 +62,7 @@ export const OrderHistory = (props: any) => {
|
|
|
61
62
|
20: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
62
63
|
21: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
63
64
|
22: 'ORDER_LOOKING_FOR_DRIVER',
|
|
64
|
-
|
|
65
|
+
23: 'ORDER_DRIVER_ON_WAY'
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
const getLogisticTagStatus = (status: any) => {
|
|
@@ -106,8 +107,12 @@ export const OrderHistory = (props: any) => {
|
|
|
106
107
|
ellipsizeMode='tail'
|
|
107
108
|
>
|
|
108
109
|
{t('ORDER_PLACED', 'Order placed')} {' '}
|
|
109
|
-
{
|
|
110
|
-
|
|
110
|
+
{!props.hideViaText && (
|
|
111
|
+
<>
|
|
112
|
+
{t('VIA', 'Via')}{' '}
|
|
113
|
+
{order.app_id ? t(order.app_id.toUpperCase(), order.app_id) : t('OTHER', 'Other')}
|
|
114
|
+
</>
|
|
115
|
+
)}
|
|
111
116
|
</OText>
|
|
112
117
|
<OText size={12}>{parseDate(order?.created_at, { outputFormat: 'MMM DD, hh:mm A' })}</OText>
|
|
113
118
|
</View>
|
|
@@ -128,12 +133,23 @@ export const OrderHistory = (props: any) => {
|
|
|
128
133
|
<OText
|
|
129
134
|
size={14}
|
|
130
135
|
weight='bold'
|
|
131
|
-
numberOfLines={1}
|
|
136
|
+
numberOfLines={message.change?.attribute.includes(['delivered_in', 'prepared_in']) ? 2 : 1}
|
|
132
137
|
ellipsizeMode='tail'
|
|
133
138
|
>
|
|
134
139
|
{message.change?.attribute === 'logistic_status'
|
|
135
140
|
? getLogisticTagStatus(parseInt(message.change.new, 10))
|
|
136
|
-
:
|
|
141
|
+
: message.change?.attribute === 'delivered_in' ? (
|
|
142
|
+
<>
|
|
143
|
+
{t('TIME_ADDED_BY_DRIVER', 'Time added by driver')}{'\n'}
|
|
144
|
+
{formatSeconds(parseInt(message.change.new, 10))}
|
|
145
|
+
</>
|
|
146
|
+
)
|
|
147
|
+
: message.change?.attribute === 'prepared_in' ? (
|
|
148
|
+
<>
|
|
149
|
+
{t('TIME_ADDED_BY_BUSINESS', 'Time added by business')}{'\n'}
|
|
150
|
+
{formatSeconds(parseInt(message.change.new, 10))}
|
|
151
|
+
</>
|
|
152
|
+
) : t(ORDER_STATUS[parseInt(message.change.new, 10)])
|
|
137
153
|
}
|
|
138
154
|
</OText>
|
|
139
155
|
) : (
|