ordering-ui-react-native 0.18.55 → 0.18.56-crash-driver-1
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 +6 -4
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/PaymentOptionsWebView/index.tsx +30 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +60 -55
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +3 -1
- package/src/utils/index.tsx +2 -2
- package/themes/business/index.tsx +6 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +15 -8
- 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 +48 -19
- package/themes/business/src/components/DriverMap/index.tsx +36 -23
- 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 +15 -8
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/LoginForm/index.tsx +2 -2
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/MapView/index.tsx +28 -17
- package/themes/business/src/components/MessagesOption/index.tsx +22 -94
- package/themes/business/src/components/NewOrderNotification/index.tsx +162 -106
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +53 -3
- package/themes/business/src/components/OrderDetails/Delivery.tsx +209 -13
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +107 -75
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +79 -41
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +7 -2
- package/themes/business/src/components/OrderMessage/index.tsx +1 -1
- package/themes/business/src/components/OrderSummary/index.tsx +245 -82
- 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/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +43 -41
- 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 +195 -221
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
- package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
- package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
- 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 +4 -3
- package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
- package/themes/business/src/components/UserProfileForm/index.tsx +103 -53
- 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 +21 -1
- package/themes/business/src/utils/index.tsx +5 -0
- package/themes/kiosk/src/components/Checkout/index.tsx +5 -3
- package/themes/kiosk/src/components/CustomerName/index.tsx +1 -1
- package/themes/kiosk/src/components/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +131 -101
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +57 -121
- package/themes/original/index.tsx +11 -3
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +41 -20
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +22 -11
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AnalyticsSegment/index.tsx +10 -7
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +8 -11
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +40 -43
- package/themes/original/src/components/BusinessController/styles.tsx +12 -12
- package/themes/original/src/components/BusinessInformation/index.tsx +45 -17
- 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 +57 -361
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +9 -7
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -3
- package/themes/original/src/components/BusinessProductsList/index.tsx +5 -4
- package/themes/original/src/components/BusinessProductsListing/index.tsx +67 -28
- 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 +30 -404
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +2 -2
- package/themes/original/src/components/Cart/index.tsx +51 -40
- package/themes/original/src/components/CartContent/index.tsx +98 -54
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +308 -75
- 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/DriverTips/index.tsx +6 -3
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +8 -4
- 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/ForgotPasswordForm/index.tsx +5 -0
- package/themes/original/src/components/GPSButton/index.tsx +7 -5
- 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 +84 -8
- 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/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +52 -5
- package/themes/original/src/components/Help/index.tsx +7 -0
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
- package/themes/original/src/components/HelpGuide/index.tsx +5 -0
- package/themes/original/src/components/HelpOrder/index.tsx +5 -0
- 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 +3 -2
- 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 +79 -25
- package/themes/original/src/components/LoginForm/index.tsx +38 -14
- package/themes/original/src/components/MessageListing/index.tsx +6 -0
- package/themes/original/src/components/Messages/index.tsx +9 -3
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +20 -5
- 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 +48 -15
- package/themes/original/src/components/MultiCheckout/index.tsx +295 -56
- package/themes/original/src/components/MultiCheckout/styles.tsx +20 -1
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +21 -16
- package/themes/original/src/components/MyOrders/index.tsx +37 -39
- package/themes/original/src/components/NavBar/index.tsx +15 -14
- 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 +9 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +21 -6
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +14 -5
- package/themes/original/src/components/OrderDetails/index.tsx +718 -667
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -7
- package/themes/original/src/components/OrderProgress/index.tsx +50 -14
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +26 -34
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -0
- 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 +14 -6
- 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 +182 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptions/index.tsx +118 -37
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
- package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
- package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +193 -267
- package/themes/original/src/components/ProductForm/styles.tsx +1 -1
- package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -42
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
- 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 +13 -11
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
- 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/Sessions/index.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +76 -60
- package/themes/original/src/components/SingleOrderCard/index.tsx +6 -5
- package/themes/original/src/components/SingleProductCard/index.tsx +5 -4
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -5
- package/themes/original/src/components/StripeCardsList/index.tsx +26 -8
- package/themes/original/src/components/StripeElementsForm/index.tsx +80 -62
- package/themes/original/src/components/StripeElementsForm/naked.tsx +59 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -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 +128 -79
- package/themes/original/src/components/UserFormDetails/styles.tsx +8 -1
- package/themes/original/src/components/UserProfile/index.tsx +5 -4
- package/themes/original/src/components/UserProfileForm/index.tsx +35 -36
- 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/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +35 -49
- package/themes/original/src/components/Wallets/styles.tsx +3 -4
- 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 +7 -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 +13 -2
- package/themes/original/src/utils/index.tsx +124 -22
- 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
|
@@ -126,9 +126,13 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
126
126
|
const messageConsole = (message: any) => {
|
|
127
127
|
return message.change?.attribute !== 'driver_id'
|
|
128
128
|
?
|
|
129
|
-
`${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${filterSpecialStatus.includes(message.change.attribute)
|
|
130
|
-
`${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}`
|
|
131
|
-
|
|
129
|
+
`${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${filterSpecialStatus.includes(message.change.attribute)
|
|
130
|
+
? `${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}`
|
|
131
|
+
: `${message.change?.attribute !== 'logistic_status'
|
|
132
|
+
? message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])
|
|
133
|
+
: message.change.old !== null && getLogisticTag(message.change.old)} ${t('TO', 'to')} ${message.change?.attribute !== 'logistic_status'
|
|
134
|
+
? t(ORDER_STATUS[parseInt(message.change.new, 10)])
|
|
135
|
+
: getLogisticTag(message.change.new)}`
|
|
132
136
|
}`
|
|
133
137
|
: message.change.new
|
|
134
138
|
?
|
|
@@ -148,6 +152,7 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
148
152
|
}
|
|
149
153
|
const newMessage: any = [];
|
|
150
154
|
messages.messages.map((message: any) => {
|
|
155
|
+
if (message.change?.attribute === 'driver_group_id') return
|
|
151
156
|
if (business && message.type !== 0 && (messagesToShow?.messages?.length || message?.can_see?.includes('2'))) {
|
|
152
157
|
newMessage.push({
|
|
153
158
|
_id: message?.id,
|
|
@@ -498,6 +503,7 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
498
503
|
scrollToBottom
|
|
499
504
|
renderAvatarOnTop
|
|
500
505
|
renderUsernameOnMessage
|
|
506
|
+
renderAvatar={() => null}
|
|
501
507
|
renderInputToolbar={renderInputToolbar}
|
|
502
508
|
renderComposer={renderComposer}
|
|
503
509
|
renderSend={renderSend}
|
|
@@ -10,7 +10,7 @@ export const Header = styled.View`
|
|
|
10
10
|
background-color: ${(props: any) => props.theme.colors.white};
|
|
11
11
|
box-shadow: 0 2px 2px #0000001A;
|
|
12
12
|
padding-bottom: 10px;
|
|
13
|
-
padding-horizontal:
|
|
13
|
+
padding-horizontal: 10px;
|
|
14
14
|
`
|
|
15
15
|
|
|
16
16
|
export const TitleHeader = styled.View``
|
|
@@ -155,7 +155,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
155
155
|
});
|
|
156
156
|
const { bottom } = useSafeAreaInsets();
|
|
157
157
|
|
|
158
|
-
const is12hours = configs?.
|
|
158
|
+
const is12hours = configs?.general_hour_format?.value?.includes('hh:mm')
|
|
159
159
|
|
|
160
160
|
const [selectedTime, setSelectedTime] = useState(null);
|
|
161
161
|
const [datesWhitelist, setDateWhitelist] = useState<any>([{ start: null, end: null }])
|
|
@@ -327,8 +327,8 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
327
327
|
<>
|
|
328
328
|
<Container
|
|
329
329
|
style={{
|
|
330
|
-
paddingLeft: !cateringPreorder || isPage ?
|
|
331
|
-
paddingRight: !cateringPreorder || isPage ?
|
|
330
|
+
paddingLeft: !cateringPreorder || isPage ? 20 : 0,
|
|
331
|
+
paddingRight: !cateringPreorder || isPage ? 20 : 0
|
|
332
332
|
}}
|
|
333
333
|
nestedScrollEnabled
|
|
334
334
|
>
|
|
@@ -343,6 +343,11 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
343
343
|
titleAlign={'center'}
|
|
344
344
|
titleStyle={{ fontSize: 20, marginRight: 0, marginLeft: 0 }}
|
|
345
345
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
346
|
+
buttonProps={{
|
|
347
|
+
bgColor: theme.colors.white,
|
|
348
|
+
borderColor: theme.colors.white,
|
|
349
|
+
textStyle: { color: theme.colors.btnFont }
|
|
350
|
+
}}
|
|
346
351
|
/>
|
|
347
352
|
)}
|
|
348
353
|
{(preorderMinimumDays === 0 && preorderLeadTime === 0) || !cateringPreorder && (
|
|
@@ -394,6 +399,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
394
399
|
<View style={{ flex: 1 }}>
|
|
395
400
|
{selectDate && datesWhitelist[0]?.start !== null && (
|
|
396
401
|
<CalendarStrip
|
|
402
|
+
locale={locale}
|
|
397
403
|
scrollable
|
|
398
404
|
style={styles.calendar}
|
|
399
405
|
calendarHeaderContainerStyle={styles.calendarHeaderContainer}
|
|
@@ -467,8 +473,17 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
467
473
|
<Spinner visible={momentState.isLoading === 1} />
|
|
468
474
|
</Container>
|
|
469
475
|
{!isCart && !cateringPreorder && (
|
|
470
|
-
<View style={{ position: 'absolute', bottom: bottom, paddingBottom: 20, paddingHorizontal:
|
|
471
|
-
<OButton
|
|
476
|
+
<View style={{ position: 'absolute', bottom: bottom, paddingBottom: 20, paddingHorizontal: 20, backgroundColor: 'white', width: '100%' }}>
|
|
477
|
+
<OButton
|
|
478
|
+
onClick={() => handleChangeMoment()}
|
|
479
|
+
bgColor={theme.colors.primary}
|
|
480
|
+
borderColor={theme.colors.primary}
|
|
481
|
+
isDisabled={!selectedTime}
|
|
482
|
+
text={t('CONTINUE', 'Continue')}
|
|
483
|
+
style={{ borderRadius: 7.6, height: 44, shadowOpacity: 0 }}
|
|
484
|
+
textStyle={{ color: 'white', fontSize: 14 }}
|
|
485
|
+
showNextIcon
|
|
486
|
+
/>
|
|
472
487
|
</View>
|
|
473
488
|
)}
|
|
474
489
|
</>
|
|
@@ -30,7 +30,7 @@ const MomentSelectorUI = (props: any) => {
|
|
|
30
30
|
const [customizedDateList, setCustomizedDateList] = useState([])
|
|
31
31
|
const [customizedTimeList, setCustomizedTimeList] = useState([])
|
|
32
32
|
|
|
33
|
-
const is12hours = configs?.
|
|
33
|
+
const is12hours = configs?.general_hour_format?.value?.includes('hh:mm')
|
|
34
34
|
|
|
35
35
|
const styles = StyleSheet.create({
|
|
36
36
|
selectOption: {
|
|
@@ -11,7 +11,7 @@ export const MultiCartUI = () => {
|
|
|
11
11
|
const theme = useTheme();
|
|
12
12
|
return (
|
|
13
13
|
<Container noPadding>
|
|
14
|
-
<ChContainer style={{ paddingHorizontal:
|
|
14
|
+
<ChContainer style={{ paddingHorizontal: 20 }}>
|
|
15
15
|
<ChSection>
|
|
16
16
|
<ChUserDetails>
|
|
17
17
|
<Placeholder Animation={Fade}>
|
|
@@ -3,6 +3,8 @@ import {
|
|
|
3
3
|
useLanguage,
|
|
4
4
|
useConfig,
|
|
5
5
|
useUtils,
|
|
6
|
+
useToast,
|
|
7
|
+
ToastType,
|
|
6
8
|
MultiCartsPaymethodsAndWallets as MultiCartsPaymethodsAndWalletsController
|
|
7
9
|
} from 'ordering-components/native'
|
|
8
10
|
import { useTheme } from 'styled-components/native'
|
|
@@ -13,6 +15,7 @@ import { getIconCard, flatArray } from '../../utils'
|
|
|
13
15
|
import { StripeElementsForm } from '../StripeElementsForm'
|
|
14
16
|
import { StripeCardsList } from '../StripeCardsList'
|
|
15
17
|
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
18
|
+
import { useApplePay } from '@stripe/stripe-react-native';
|
|
16
19
|
|
|
17
20
|
import {
|
|
18
21
|
PMContainer,
|
|
@@ -44,6 +47,8 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
44
47
|
const [, t] = useLanguage()
|
|
45
48
|
const [{ configs }] = useConfig()
|
|
46
49
|
const [{ parsePrice }] = useUtils()
|
|
50
|
+
const [, { showToast }] = useToast();
|
|
51
|
+
const { confirmApplePayPayment } = useApplePay()
|
|
47
52
|
|
|
48
53
|
const [addCardOpen, setAddCardOpen] = useState({ stripe: false, stripeConnect: false });
|
|
49
54
|
|
|
@@ -83,26 +88,46 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
83
88
|
return theme.images.general.stripesb
|
|
84
89
|
case 'global_apple_pay':
|
|
85
90
|
return theme.images.general.applePayMark
|
|
91
|
+
case 'global_google_pay':
|
|
92
|
+
return theme.images.general.googlePayMark
|
|
86
93
|
default:
|
|
87
94
|
return theme.images.general.creditCard
|
|
88
95
|
}
|
|
89
96
|
}
|
|
90
97
|
|
|
91
98
|
useEffect(() => {
|
|
92
|
-
|
|
93
|
-
if (typeof paymethodSelected?.paymethod_data === 'string'){
|
|
94
|
-
const sourceId =
|
|
95
|
-
sourceId && handlePlaceOrder()
|
|
99
|
+
if (methodsPay.includes(paymethodSelected?.gateway)) {
|
|
100
|
+
if (typeof paymethodSelected?.paymethod_data === 'string') {
|
|
101
|
+
const sourceId = JSON.parse(paymethodSelected?.paymethod_data)?.source_id
|
|
102
|
+
sourceId && handlePlaceOrder(confirmApplePayPayment)
|
|
96
103
|
}
|
|
97
|
-
|
|
98
|
-
|
|
104
|
+
}
|
|
105
|
+
}, [JSON.stringify(paymethodSelected)])
|
|
106
|
+
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (cartTotal === 0) {
|
|
109
|
+
handlePaymethodDataChange(null)
|
|
110
|
+
handleSelectPaymethod(null)
|
|
111
|
+
}
|
|
112
|
+
}, [cartTotal])
|
|
113
|
+
|
|
114
|
+
const handleChangePaymethod = (paymethod: any) => {
|
|
115
|
+
if (cartTotal > 0) {
|
|
116
|
+
handleSelectPaymethod(paymethod)
|
|
117
|
+
return
|
|
118
|
+
}
|
|
119
|
+
showToast(
|
|
120
|
+
ToastType.Error,
|
|
121
|
+
t('CART_BALANCE_ZERO', 'Sorry, the amount to pay is equal to zero and it is not necessary to select a payment method'))
|
|
122
|
+
;
|
|
123
|
+
}
|
|
99
124
|
|
|
100
125
|
const renderPaymethods = ({ item }: any) => {
|
|
101
126
|
return (
|
|
102
127
|
<>
|
|
103
|
-
{item?.gateway
|
|
128
|
+
{methodsPay.includes(item?.gateway) ? (
|
|
104
129
|
<TouchableOpacity
|
|
105
|
-
onPress={() =>
|
|
130
|
+
onPress={() => handleChangePaymethod({ ...item, paymethod: { gateway: item.gateway }, paymethod_id: item?.id })}
|
|
106
131
|
>
|
|
107
132
|
<OIcon
|
|
108
133
|
src={getPayIcon(item.gateway)}
|
|
@@ -113,7 +138,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
113
138
|
</TouchableOpacity>
|
|
114
139
|
) : (
|
|
115
140
|
<TouchableOpacity
|
|
116
|
-
onPress={() =>
|
|
141
|
+
onPress={() => handleChangePaymethod({ ...item, paymethod: { gateway: item.gateway }, paymethod_id: item?.id })}
|
|
117
142
|
>
|
|
118
143
|
<PMItem
|
|
119
144
|
key={item.id}
|
|
@@ -123,7 +148,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
123
148
|
src={getPayIcon(item?.gateway ?? item.paymethod?.gateway)}
|
|
124
149
|
width={20}
|
|
125
150
|
height={20}
|
|
126
|
-
color={item?.gateway === '
|
|
151
|
+
color={item?.gateway === 'global_apple_pay' ? '' : paymethodSelected?.id === item.id ? theme.colors.white : theme.colors.backgroundDark}
|
|
127
152
|
/>
|
|
128
153
|
<OText
|
|
129
154
|
size={10}
|
|
@@ -191,6 +216,13 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
191
216
|
publicKey={paymethodSelected?.data?.publishable}
|
|
192
217
|
payType={paymethodSelected?.paymethod?.name}
|
|
193
218
|
onSelectCard={handlePaymethodDataChange}
|
|
219
|
+
addCardOpen={addCardOpen}
|
|
220
|
+
setAddCardOpen={setAddCardOpen}
|
|
221
|
+
openCarts={openCarts}
|
|
222
|
+
toSave
|
|
223
|
+
handlePaymethodDataChange={handlePaymethodDataChange}
|
|
224
|
+
clientSecret={props.clientSecret}
|
|
225
|
+
onPaymentChange={handlePaymethodDataChange}
|
|
194
226
|
/>
|
|
195
227
|
</View>
|
|
196
228
|
)}
|
|
@@ -201,14 +233,15 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
201
233
|
toSave
|
|
202
234
|
businessId={businessIds[0]}
|
|
203
235
|
businessIds={businessIds}
|
|
236
|
+
businessNames={openCarts?.map?.((cart : any) => cart?.business?.name)}
|
|
204
237
|
publicKey={paymethodSelected?.data?.publishable}
|
|
205
238
|
requirements={props.clientSecret}
|
|
206
239
|
handleSource={handlePaymethodDataChange}
|
|
207
240
|
onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
|
|
208
241
|
setMethodPaySupported={setMethodPaySupported}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
242
|
+
methodPaySupported={methodPaySupported}
|
|
243
|
+
placeByMethodPay={placeByMethodPay}
|
|
244
|
+
setPlaceByMethodPay={setPlaceByMethodPay}
|
|
212
245
|
methodsPay={methodsPay}
|
|
213
246
|
paymethod={paymethodSelected?.paymethod?.gateway}
|
|
214
247
|
cartTotal={cartTotal}
|
|
@@ -274,7 +307,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
274
307
|
</>
|
|
275
308
|
)}
|
|
276
309
|
|
|
277
|
-
<OModal
|
|
310
|
+
{/* <OModal
|
|
278
311
|
entireModal
|
|
279
312
|
title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
|
|
280
313
|
open={addCardOpen.stripe}
|
|
@@ -297,7 +330,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
297
330
|
onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
|
|
298
331
|
/>
|
|
299
332
|
</KeyboardAvoidingView>
|
|
300
|
-
</OModal>
|
|
333
|
+
</OModal> */}
|
|
301
334
|
</PMContainer>
|
|
302
335
|
)
|
|
303
336
|
}
|