ordering-ui-react-native 0.21.21 → 0.21.22-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 +7 -6
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/PaymentOptionsWebView/index.tsx +1 -0
- package/src/components/StripeMethodForm/index.tsx +4 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/types/index.tsx +2 -1
- package/src/utils/index.tsx +2 -2
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
- 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 +23 -14
- package/themes/business/src/components/DriverMap/index.tsx +4 -3
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/LanguageSelector/index.tsx +4 -2
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/MapView/index.tsx +11 -7
- package/themes/business/src/components/MessagesOption/index.tsx +2 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +163 -113
- package/themes/business/src/components/OrderDetails/Business.tsx +50 -2
- package/themes/business/src/components/OrderDetails/Delivery.tsx +23 -11
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +60 -53
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +54 -23
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
- package/themes/business/src/components/OrderSummary/index.tsx +240 -76
- 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 +125 -48
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +33 -36
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +18 -13
- package/themes/business/src/components/PreviousOrders/index.tsx +80 -66
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +279 -0
- package/themes/business/src/components/PrinterSettings/styles.tsx +17 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/Sessions/index.tsx +187 -0
- package/themes/business/src/components/Sessions/styles.tsx +20 -0
- package/themes/business/src/components/StoresList/index.tsx +5 -3
- package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
- package/themes/business/src/components/UserProfileForm/index.tsx +98 -44
- 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/OInput.tsx +2 -0
- package/themes/business/src/hooks/useLocation.tsx +5 -4
- package/themes/business/src/types/index.tsx +15 -2
- package/themes/business/src/utils/index.tsx +5 -0
- 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/LoginForm/index.tsx +7 -4
- 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/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +9 -4
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +10 -6
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +4 -7
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +20 -12
- package/themes/original/src/components/BusinessController/styles.tsx +8 -7
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
- 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 +56 -361
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +2 -3
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +51 -20
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
- package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
- 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 +24 -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 +32 -9
- package/themes/original/src/components/CartContent/index.tsx +96 -58
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +190 -66
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/DatePicker/index.tsx +33 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- 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 +1 -1
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
- package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
- package/themes/original/src/components/GoogleMap/index.tsx +6 -5
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +2 -1
- 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 +4 -16
- package/themes/original/src/components/Messages/index.tsx +9 -4
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +4 -3
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCheckout/index.tsx +208 -21
- package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
- package/themes/original/src/components/MyOrders/index.tsx +24 -29
- package/themes/original/src/components/NavBar/index.tsx +3 -1
- 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/Notifications/index.tsx +4 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
- package/themes/original/src/components/OrderDetails/index.tsx +716 -668
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
- package/themes/original/src/components/OrderProgress/index.tsx +28 -6
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +3 -1
- 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/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +3 -5
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +3 -0
- package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
- 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 +72 -6
- 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 +74 -165
- package/themes/original/src/components/ProductItemAccordion/index.tsx +54 -44
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +123 -82
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +6 -1
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +4 -4
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- 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/styles.tsx +1 -1
- 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 +60 -58
- package/themes/original/src/components/SingleOrderCard/index.tsx +3 -2
- package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +17 -36
- package/themes/original/src/components/StripeElementsForm/index.tsx +72 -59
- package/themes/original/src/components/StripeElementsForm/naked.tsx +47 -0
- 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 +15 -199
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserFormDetails/index.tsx +125 -77
- package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
- package/themes/original/src/components/UserProfile/index.tsx +3 -2
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +8 -9
- package/themes/original/src/components/Wallets/styles.tsx +1 -1
- package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
- package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -5
- package/themes/original/src/components/shared/OInput.tsx +1 -4
- package/themes/original/src/components/shared/OModal.tsx +12 -14
- package/themes/original/src/layouts/Container.tsx +5 -3
- package/themes/original/src/types/index.tsx +1 -0
- package/themes/original/src/utils/index.tsx +125 -1
- 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
|
@@ -33,6 +33,7 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
33
33
|
const [state, setState] = useState({
|
|
34
34
|
selectedPrinter: { url: undefined },
|
|
35
35
|
});
|
|
36
|
+
const paymethodsLength = order?.payment_events?.filter((item: any) => item.event === 'payment')?.length
|
|
36
37
|
|
|
37
38
|
const getFormattedSubOptionName = ({ quantity, name, position, price }: any) => {
|
|
38
39
|
if (name !== 'No') {
|
|
@@ -74,6 +75,40 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
74
75
|
return array.join('')
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
const getIngredients = (ingredients: any) => {
|
|
79
|
+
const _ingredients: any = (ingredients.length > 0 && ingredients.filter((i: any) => !i.selected)) || []
|
|
80
|
+
const texts: any = []
|
|
81
|
+
|
|
82
|
+
_ingredients.map((ingredient: any) => {
|
|
83
|
+
texts.push(` ${t('NO', 'No')} ${ingredient.name} <br/>`)
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
if (_ingredients.length) {
|
|
87
|
+
return `
|
|
88
|
+
<div style="font-size: 26px;width:100%">
|
|
89
|
+
<div style=width:90%;display:flex;justifyContent:center;margin:auto;">
|
|
90
|
+
<div>
|
|
91
|
+
${t('INGREDIENTS', 'Ingredients')}:
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
${texts.join('')}
|
|
95
|
+
</div>
|
|
96
|
+
`
|
|
97
|
+
}
|
|
98
|
+
return ''
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const deliveryDate = (order: any) => {
|
|
102
|
+
const dateString = order?.delivery_datetime_utc ?? order?.delivery_datetime
|
|
103
|
+
const currentDate = new Date();
|
|
104
|
+
const receivedDate: any = new Date(order?.delivery_datetime);
|
|
105
|
+
|
|
106
|
+
const formattedDate = receivedDate <= currentDate
|
|
107
|
+
? `${t('ASAP_ABBREVIATION', 'ASAP')}(${parseDate(dateString, { utc: !!order?.delivery_datetime_utc })})`
|
|
108
|
+
: parseDate(dateString, { utc: !!order?.delivery_datetime_utc })
|
|
109
|
+
return formattedDate
|
|
110
|
+
}
|
|
111
|
+
|
|
77
112
|
const theme = useTheme();
|
|
78
113
|
const percentTip =
|
|
79
114
|
parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
@@ -83,6 +118,28 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
83
118
|
const customerName = `${order?.customer?.name ?? ''} ${order?.customer?.middle_name ?? ''} ${order?.customer?.lastname ?? ''} ${order?.customer?.second_lastname ?? ''
|
|
84
119
|
}`?.replace(' ', ' ')?.trim() ?? ''
|
|
85
120
|
|
|
121
|
+
const walletName: any = {
|
|
122
|
+
cash: {
|
|
123
|
+
name: t('CASH_WALLET', 'Cash Wallet')
|
|
124
|
+
},
|
|
125
|
+
credit_point: {
|
|
126
|
+
name: t('POINTS_WALLET', 'Points Wallet')
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const handlePaymethodsListString = () => {
|
|
131
|
+
const paymethodsList = order?.payment_events?.filter((item: any) => item.event === 'payment').map((paymethod: any) => {
|
|
132
|
+
return paymethod?.wallet_event
|
|
133
|
+
? walletName[paymethod?.wallet_event?.wallet?.type]?.name
|
|
134
|
+
: paymethod?.paymethod?.gateway && paymethod?.paymethod?.gateway === 'cash' && order?.cash > 0
|
|
135
|
+
? `${t(paymethod?.paymethod?.gateway?.toUpperCase(), paymethod?.paymethod?.name)} (${t('CASH_CHANGE_OF', 'Change of :amount:').replace(':amount:', parsePrice(order?.cash))})`
|
|
136
|
+
: paymethod?.paymethod?.gateway
|
|
137
|
+
? t(paymethod?.paymethod?.gateway?.toUpperCase(), paymethod?.paymethod?.name)
|
|
138
|
+
: t(order?.paymethod?.gateway?.toUpperCase(), order?.paymethod?.name)
|
|
139
|
+
})
|
|
140
|
+
return paymethodsList.join(', ')
|
|
141
|
+
}
|
|
142
|
+
|
|
86
143
|
const orderSummary = () => {
|
|
87
144
|
return `
|
|
88
145
|
<div>
|
|
@@ -91,15 +148,18 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
91
148
|
|
|
92
149
|
${orderStatus} </br>
|
|
93
150
|
|
|
94
|
-
${t('
|
|
95
|
-
}
|
|
151
|
+
${t('ORDER_TYPE', 'Order Type')}: ${deliveryStatus[order?.delivery_type]}
|
|
96
152
|
</br>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
153
|
+
|
|
154
|
+
${!!order?.delivery_option
|
|
155
|
+
? `${t('DELIVERY_PREFERENCE', 'Delivery Preference')}: ${t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)
|
|
156
|
+
} </br>`
|
|
157
|
+
: ''
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
${t('DELIVERY_DATE', 'Delivery Date')}: ${deliveryDate(order)}
|
|
101
161
|
</br>
|
|
102
|
-
${t('PAYMENT_METHOD')}: ${
|
|
162
|
+
${t(paymethodsLength > 1 ? 'PAYMENT_METHODS' : 'PAYMENT_METHOD', paymethodsLength > 1 ? 'Payment methods' : 'Payment method')}: ${handlePaymethodsListString()}
|
|
103
163
|
</p>
|
|
104
164
|
|
|
105
165
|
<h1>${t('CUSTOMER_DETAILS', 'Customer details')}</h1>
|
|
@@ -107,38 +167,46 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
107
167
|
</br>
|
|
108
168
|
${t('EMAIL', 'Email')}: ${order?.customer?.email}
|
|
109
169
|
</br>
|
|
110
|
-
|
|
111
|
-
|
|
170
|
+
${!!order?.customer?.cellphone
|
|
171
|
+
? `${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.cellphone
|
|
172
|
+
} </br>`
|
|
173
|
+
: ''}
|
|
174
|
+
|
|
112
175
|
${!!order?.customer?.phone
|
|
113
176
|
? `${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.phone
|
|
114
177
|
} </br>`
|
|
115
178
|
: ''
|
|
116
179
|
}
|
|
117
|
-
${t('FULL_ADDRESS', 'Full Addres')}: ${order?.customer?.address}
|
|
118
|
-
</br>
|
|
180
|
+
${t('FULL_ADDRESS', 'Full Addres')}: ${order?.customer?.address}
|
|
181
|
+
</br>
|
|
119
182
|
${!!order?.customer?.internal_number
|
|
120
183
|
? `${t('INTERNAL_NUMBER', 'Internal Number')}: ${order?.customer?.internal_number
|
|
121
184
|
} </br>`
|
|
122
185
|
: ''
|
|
123
186
|
}
|
|
124
|
-
|
|
125
|
-
|
|
187
|
+
${order?.customer.zipcode ?
|
|
188
|
+
`${t('ZIPCODE', 'Zipcode')}: ${order?.customer.zipcode}`
|
|
189
|
+
: ''}
|
|
190
|
+
</p>
|
|
126
191
|
|
|
127
192
|
<h1>${t('BUSINESS_DETAILS', 'Business details')}</h1>
|
|
128
|
-
<p style="font-size: 27px">
|
|
129
|
-
${order?.business?.name}
|
|
130
|
-
</br>
|
|
193
|
+
<p style="font-size: 27px">
|
|
194
|
+
${order?.business?.name}
|
|
195
|
+
</br>
|
|
131
196
|
${order?.business?.email}
|
|
132
|
-
</br>
|
|
133
|
-
${
|
|
134
|
-
|
|
197
|
+
</br>
|
|
198
|
+
${!!order?.business?.cellphone
|
|
199
|
+
? `${t('BUSINESS_PHONE', 'Business Phone')}: ${order?.business?.cellphone
|
|
200
|
+
} </br>`
|
|
201
|
+
: ''
|
|
202
|
+
}
|
|
135
203
|
${!!order?.business?.phone
|
|
136
204
|
? `${t('BUSINESS_PHONE', 'Business Phone')}: ${order?.business?.phone
|
|
137
205
|
} </br>`
|
|
138
206
|
: ''
|
|
139
|
-
}
|
|
207
|
+
}
|
|
140
208
|
|
|
141
|
-
${t('ADDRESS', 'Address')}: ${order?.business?.address}
|
|
209
|
+
${t('ADDRESS', 'Address')}: ${order?.business?.address}
|
|
142
210
|
</br>
|
|
143
211
|
${!!order?.business?.address_notes
|
|
144
212
|
? `${t('SPECIAL_ADDRESS', 'Special Address')}: ${order?.business?.address_notes
|
|
@@ -148,6 +216,8 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
148
216
|
</p>
|
|
149
217
|
<h1> ${t('ORDER_DETAILS', 'Order Details')}</h1>
|
|
150
218
|
|
|
219
|
+
${order?.comment ? ('</br>'+ t('ORDER_COMMENT', 'Order Comment') + ':' + order?.comment) : ''}
|
|
220
|
+
|
|
151
221
|
${order?.products.length &&
|
|
152
222
|
order?.products.map(
|
|
153
223
|
(product: any, i: number) =>
|
|
@@ -162,6 +232,8 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
162
232
|
</div>
|
|
163
233
|
</div>
|
|
164
234
|
|
|
235
|
+
${getIngredients(product?.ingredients)}
|
|
236
|
+
|
|
165
237
|
<div style="font-size: 26px;width:100%">
|
|
166
238
|
<div style="width:90%;display:flex;justifyContent:center;margin:auto;">
|
|
167
239
|
${getOptions(product.options, product.comment)}
|
|
@@ -222,18 +294,21 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
222
294
|
: ''
|
|
223
295
|
}
|
|
224
296
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
</div>`
|
|
231
|
-
: ''
|
|
232
|
-
}
|
|
297
|
+
${order?.summary?.delivery_price > 0 && order.delivery_type !== 2 ?
|
|
298
|
+
` <div style="display: flex">
|
|
299
|
+
<div style="font-size: 26px; width: 70%; display: flex; justify-content: flex-start">
|
|
300
|
+
${t('DELIVERY_FEE', 'Delivery Fee')}
|
|
301
|
+
</div>
|
|
233
302
|
|
|
303
|
+
<div style="font-size: 26px; width: 30%; display: flex; justify-content: flex-end">
|
|
304
|
+
${parsePrice(order?.summary?.delivery_price ?? 0)}
|
|
305
|
+
</div>` :
|
|
306
|
+
''}
|
|
307
|
+
|
|
308
|
+
</div>
|
|
234
309
|
<div style="display: flex">
|
|
235
310
|
|
|
236
|
-
<div style="font-size: 26px; width: 70%; display: flex; justify-content: flex-start">
|
|
311
|
+
<div style="font-size: 26px; width: 70%; display: flex; justify-content: flex-start">
|
|
237
312
|
${t('DRIVER_TIP', 'Driver tip')}
|
|
238
313
|
${percentTip ? `(${percentTip}%)` : ''}
|
|
239
314
|
</div>
|
|
@@ -244,22 +319,23 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
244
319
|
|
|
245
320
|
</div>
|
|
246
321
|
|
|
247
|
-
|
|
322
|
+
${order?.summary?.service_fee > 0 && `
|
|
323
|
+
<div style="display: flex">
|
|
324
|
+
<div style="font-size: 26px; width: 70%; display: flex; justify-content: flex-start">
|
|
325
|
+
${t('SERVICE_FEE', 'Service Fee')}
|
|
326
|
+
(${verifyDecimals(order?.summary?.service_fee, parseNumber)}%)
|
|
327
|
+
</div>
|
|
248
328
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
</div>
|
|
329
|
+
<div style="font-size: 26px; width: 30%; display: flex; justify-content: flex-end">
|
|
330
|
+
${parsePrice(order?.summary?.service_fee ?? 0)}
|
|
331
|
+
</div>
|
|
253
332
|
|
|
254
|
-
<div style="font-size: 26px; width: 30%; display: flex; justify-content: flex-end">
|
|
255
|
-
${parsePrice(order?.summary?.service_fee ?? 0)}
|
|
256
333
|
</div>
|
|
257
|
-
|
|
258
|
-
</div>
|
|
334
|
+
`}
|
|
259
335
|
|
|
260
336
|
<div style="display: flex">
|
|
261
337
|
|
|
262
|
-
<div style="font-size: 26px; width: 70%; display: flex; justify-content: flex-start; font-weight: bold">
|
|
338
|
+
<div style="font-size: 26px; width: 70%; display: flex; justify-content: flex-start; font-weight: bold">
|
|
263
339
|
${t('TOTAL', 'Total')}
|
|
264
340
|
</div>
|
|
265
341
|
|
|
@@ -268,7 +344,36 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
268
344
|
</div>
|
|
269
345
|
|
|
270
346
|
</div>
|
|
271
|
-
|
|
347
|
+
|
|
348
|
+
${order?.payment_events.length && `
|
|
349
|
+
<div style="font-size: 26px; width: 70%; display: flex; justify-content: flex-start; font-weight: bold">
|
|
350
|
+
${t('PAYMENTS', 'Payments')}
|
|
351
|
+
</div>
|
|
352
|
+
`}
|
|
353
|
+
|
|
354
|
+
${order?.payment_events.length &&
|
|
355
|
+
order?.payment_events.map(
|
|
356
|
+
(event: any, i: number) =>
|
|
357
|
+
`<div style="display: flex;flexDirection:row;flex-wrap:wrap">
|
|
358
|
+
<div style="display:flex;width:100%">
|
|
359
|
+
<div style="display:flex; justify-content: flex-start; font-size: 26px; width: 70%">
|
|
360
|
+
${event?.wallet_event
|
|
361
|
+
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
362
|
+
: event?.paymethod?.gateway && event?.paymethod?.gateway === 'cash' && order?.cash > 0
|
|
363
|
+
? `${t(event?.paymethod?.gateway?.toUpperCase(), event?.paymethod?.name)} (${t('CASH_CHANGE_OF', 'Change of :amount:').replace(':amount:', parsePrice(order?.cash))})`
|
|
364
|
+
: event?.paymethod?.gateway
|
|
365
|
+
? t(event?.paymethod?.gateway?.toUpperCase(), event?.paymethod?.name)
|
|
366
|
+
: t(order?.paymethod?.gateway?.toUpperCase(), order?.paymethod?.name)}
|
|
367
|
+
</div>
|
|
368
|
+
|
|
369
|
+
<div style="display:flex; justify-content: flex-end; font-size: 26px; width: 30%">
|
|
370
|
+
${(event?.paymethod?.gateway === 'cash' && order?.cash)
|
|
371
|
+
? parsePrice(order?.cash, { currency: order?.currency })
|
|
372
|
+
: `-${parsePrice(event?.amount, { currency: order?.currency })}`}
|
|
373
|
+
</div>
|
|
374
|
+
</div>
|
|
375
|
+
</div>`
|
|
376
|
+
)}
|
|
272
377
|
</div>`;
|
|
273
378
|
};
|
|
274
379
|
|
|
@@ -368,21 +473,23 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
368
473
|
</OText>
|
|
369
474
|
|
|
370
475
|
<OText style={{ marginBottom: 5 }}>
|
|
371
|
-
{`${t('
|
|
476
|
+
{`${t('ORDER_TYPE', 'Order Type')}: ${deliveryStatus[order?.delivery_type]
|
|
372
477
|
}`}
|
|
373
478
|
</OText>
|
|
374
479
|
|
|
480
|
+
{order?.delivery_option && (
|
|
481
|
+
<OText size={13}>
|
|
482
|
+
<OText size={13} weight='bold'>{`${t('DELIVERY_PREFERENCE', 'Delivery Preference')}: `}</OText>
|
|
483
|
+
{t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)}
|
|
484
|
+
</OText>
|
|
485
|
+
)}
|
|
486
|
+
|
|
375
487
|
<OText style={{ marginBottom: 5 }}>
|
|
376
|
-
{`${t('DELIVERY_DATE', 'Delivery Date')}: ${order
|
|
377
|
-
? parseDate(order?.delivery_datetime_utc)
|
|
378
|
-
: parseDate(order?.delivery_datetime, { utc: false })
|
|
379
|
-
}`}
|
|
488
|
+
{`${t('DELIVERY_DATE', 'Delivery Date')}: ${deliveryDate(order)}`}
|
|
380
489
|
</OText>
|
|
381
490
|
|
|
382
|
-
<OText style={{ marginBottom: 5 }}>{`${t('PAYMENT_METHOD')}: ${
|
|
383
|
-
|
|
384
|
-
order?.paymethod?.name,
|
|
385
|
-
)}`}</OText>
|
|
491
|
+
<OText style={{ marginBottom: 5 }}>{`${t(`${paymethodsLength > 1 ? 'PAYMENT_METHODS' : 'PAYMENT_METHOD'}`, `${paymethodsLength > 1 ? 'Payment methods' : 'Payment method'}`)}: ${handlePaymethodsListString()}`}</OText>
|
|
492
|
+
|
|
386
493
|
</OrderHeader>
|
|
387
494
|
|
|
388
495
|
<OrderCustomer>
|
|
@@ -414,16 +521,18 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
414
521
|
{`${t('EMAIL', 'Email')}: ${order?.customer?.email}`}
|
|
415
522
|
</OText>
|
|
416
523
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
}
|
|
426
|
-
|
|
524
|
+
{!!order?.customer?.cellphone && (
|
|
525
|
+
<OText
|
|
526
|
+
style={{ marginBottom: 5 }}
|
|
527
|
+
size={14}
|
|
528
|
+
numberOfLines={2}
|
|
529
|
+
adjustsFontSizeToFit
|
|
530
|
+
ellipsizeMode="tail"
|
|
531
|
+
color={theme.colors.textGray}>
|
|
532
|
+
{`${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.cellphone
|
|
533
|
+
}`}
|
|
534
|
+
</OText>
|
|
535
|
+
)}
|
|
427
536
|
|
|
428
537
|
{!!order?.customer?.phone && (
|
|
429
538
|
<OText
|
|
@@ -554,6 +663,12 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
554
663
|
{t('ORDER_DETAILS', 'Order Details')}
|
|
555
664
|
</OText>
|
|
556
665
|
|
|
666
|
+
{order?.comment && (
|
|
667
|
+
<OText style={{ marginBottom: 5 }}>
|
|
668
|
+
{`${t('ORDER_COMMENT', 'Order Comment')}: ${order?.comment}`}
|
|
669
|
+
</OText>
|
|
670
|
+
)}
|
|
671
|
+
|
|
557
672
|
{order?.products.length &&
|
|
558
673
|
order?.products.map((product: any, i: number) => (
|
|
559
674
|
<View key={i}>
|
|
@@ -621,7 +736,7 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
621
736
|
</Table>
|
|
622
737
|
)}
|
|
623
738
|
|
|
624
|
-
{order?.summary?.delivery_price > 0 && (
|
|
739
|
+
{order?.summary?.delivery_price > 0 && order.delivery_type !== 2 && (
|
|
625
740
|
<Table>
|
|
626
741
|
<OText style={{ marginBottom: 5 }}>
|
|
627
742
|
{t('DELIVERY_FEE', 'Delivery Fee')}
|
|
@@ -631,22 +746,24 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
631
746
|
</Table>
|
|
632
747
|
)}
|
|
633
748
|
|
|
634
|
-
|
|
635
|
-
<
|
|
636
|
-
{
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
749
|
+
{(order?.summary?.driver_tip > 0 || order?.driver_tip > 0) && order.delivery_type !== 2 && (
|
|
750
|
+
<Table>
|
|
751
|
+
<OText style={{ marginBottom: 5 }}>
|
|
752
|
+
{t('DRIVER_TIP', 'Driver tip')}
|
|
753
|
+
{order?.summary?.driver_tip > 0 &&
|
|
754
|
+
parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
755
|
+
!parseInt(configs?.driver_tip_use_custom?.value, 10) &&
|
|
756
|
+
`(${verifyDecimals(
|
|
757
|
+
order?.summary?.driver_tip,
|
|
758
|
+
parseNumber,
|
|
759
|
+
)}%)`}
|
|
760
|
+
</OText>
|
|
645
761
|
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
762
|
+
<OText style={{ marginBottom: 5 }}>
|
|
763
|
+
{parsePrice(order?.summary?.driver_tip ?? 0)}
|
|
764
|
+
</OText>
|
|
765
|
+
</Table>
|
|
766
|
+
)}
|
|
650
767
|
|
|
651
768
|
{order?.summary?.service_fee > 0 && (
|
|
652
769
|
<Table>
|
|
@@ -672,6 +789,53 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
672
789
|
</OText>
|
|
673
790
|
</Table>
|
|
674
791
|
</Total>
|
|
792
|
+
|
|
793
|
+
{order?.payment_events?.length > 0 && (
|
|
794
|
+
<View>
|
|
795
|
+
<OText size={14} color={theme.colors.textNormal}>{t('PAYMENTS', 'Payments')}</OText>
|
|
796
|
+
<View
|
|
797
|
+
style={{
|
|
798
|
+
width: '100%',
|
|
799
|
+
marginTop: 5
|
|
800
|
+
}}
|
|
801
|
+
>
|
|
802
|
+
{order?.payment_events?.map((event: any) => (
|
|
803
|
+
<View
|
|
804
|
+
key={event.id}
|
|
805
|
+
style={{
|
|
806
|
+
display: 'flex',
|
|
807
|
+
flexDirection: 'row',
|
|
808
|
+
justifyContent: 'space-between',
|
|
809
|
+
alignItems: 'center',
|
|
810
|
+
marginBottom: 10
|
|
811
|
+
}}
|
|
812
|
+
>
|
|
813
|
+
<View
|
|
814
|
+
style={{
|
|
815
|
+
display: 'flex',
|
|
816
|
+
flexDirection: 'column',
|
|
817
|
+
}}
|
|
818
|
+
>
|
|
819
|
+
<OText>
|
|
820
|
+
{event?.wallet_event
|
|
821
|
+
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
822
|
+
: event?.paymethod?.gateway
|
|
823
|
+
? t(event?.paymethod?.gateway?.toUpperCase(), event?.paymethod?.name)
|
|
824
|
+
: order?.paymethod?.id === event?.paymethod_id
|
|
825
|
+
? t(order?.paymethod?.gateway?.toUpperCase(), order?.paymethod?.name)
|
|
826
|
+
: ''}
|
|
827
|
+
</OText>
|
|
828
|
+
</View>
|
|
829
|
+
<OText>
|
|
830
|
+
{(event?.paymethod?.gateway === 'cash' && order?.cash)
|
|
831
|
+
? parsePrice(order?.cash, { currency: order?.currency })
|
|
832
|
+
: `-${parsePrice(event?.amount, { currency: order?.currency })}`}
|
|
833
|
+
</OText>
|
|
834
|
+
</View>
|
|
835
|
+
))}
|
|
836
|
+
</View>
|
|
837
|
+
</View>
|
|
838
|
+
)}
|
|
675
839
|
</OrderBill>
|
|
676
840
|
</OrderContent>
|
|
677
841
|
<View style={{ height: 40 }} />
|
|
@@ -40,6 +40,7 @@ import { OrdersOptionPaymethod } from '../OrdersOptionPaymethod';
|
|
|
40
40
|
import { OrdersOptionDriver } from '../OrdersOptionDriver';
|
|
41
41
|
import { OrdersOptionDate } from '../OrdersOptionDate';
|
|
42
42
|
import { OrderDetailsBusiness } from '../OrderDetails/Business';
|
|
43
|
+
import { WebsocketStatus } from '../WebsocketStatus'
|
|
43
44
|
|
|
44
45
|
const { useDeviceOrientation, PORTRAIT } = DeviceOrientationMethods
|
|
45
46
|
|
|
@@ -314,7 +315,11 @@ const OrdersListManagerUI = (props: OrdersOptionParams) => {
|
|
|
314
315
|
</View>
|
|
315
316
|
{configState?.configs?.order_deadlines_enabled?.value === '1' && (
|
|
316
317
|
<View style={styles.SLAwrapper}>
|
|
317
|
-
<View style={{ flex:
|
|
318
|
+
<View style={{ flex: 1 }}>
|
|
319
|
+
<WebsocketStatus />
|
|
320
|
+
</View>
|
|
321
|
+
<View style={{ width: 10, height: '100%' }} />
|
|
322
|
+
<View style={{ flex: 1 }}>
|
|
318
323
|
<OButton
|
|
319
324
|
text={t('SLA_SETTING', 'SLA’s Settings')}
|
|
320
325
|
textStyle={{ color: theme.colors.backArrow }}
|
|
@@ -330,7 +335,7 @@ const OrdersListManagerUI = (props: OrdersOptionParams) => {
|
|
|
330
335
|
/>
|
|
331
336
|
</View>
|
|
332
337
|
<View style={{ width: 10, height: '100%' }} />
|
|
333
|
-
<View style={{ flex:
|
|
338
|
+
<View style={{ flex: 1, justifyContent: 'center' }}>
|
|
334
339
|
<SelectDropdown
|
|
335
340
|
defaultButtonText={t('SLA', 'SLA\'s')}
|
|
336
341
|
data={preorderTypeList}
|
|
@@ -209,7 +209,7 @@ export const Timer = () => {
|
|
|
209
209
|
return (
|
|
210
210
|
<TimerInputWrapper>
|
|
211
211
|
<OText style={styles.settingTime} color={theme.colors.disabled}>{configs?.order_deadlines_delayed_time?.value}</OText>
|
|
212
|
-
<OText>{t('
|
|
212
|
+
<OText>{t('TIME_MIN', 'min')}</OText>
|
|
213
213
|
</TimerInputWrapper>
|
|
214
214
|
)
|
|
215
215
|
}
|