ordering-ui-react-native 0.21.18 → 0.21.19-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 +41 -13
- 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 +22 -94
- 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/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +41 -38
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +194 -220
- 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 -43
- 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/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/PhoneInputNumber/index.tsx +15 -1
- 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/SingleOrderCard/index.tsx +5 -4
- 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 +54 -8
- 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/UserVerification/index.tsx +3 -1
- 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 +2 -0
- package/themes/original/src/utils/index.tsx +124 -0
- 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
|
@@ -122,8 +122,8 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
122
122
|
width: 16
|
|
123
123
|
},
|
|
124
124
|
wrapperNavbar: Platform.OS === 'ios'
|
|
125
|
-
? { paddingVertical: 0, paddingLeft:
|
|
126
|
-
: { paddingVertical: 10, paddingLeft:
|
|
125
|
+
? { paddingVertical: 0, paddingLeft: 20, paddingRight: 20 }
|
|
126
|
+
: { paddingVertical: 10, paddingLeft: 20, paddingRight: 20 }
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
const [, t] = useLanguage();
|
|
@@ -371,6 +371,10 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
371
371
|
setToggleMap(!toggleMap);
|
|
372
372
|
};
|
|
373
373
|
|
|
374
|
+
const showFieldWithTheme = (name) => {
|
|
375
|
+
return !theme?.address?.components?.[name]?.hidden
|
|
376
|
+
}
|
|
377
|
+
|
|
374
378
|
useEffect(() => {
|
|
375
379
|
if (
|
|
376
380
|
orderState.loading &&
|
|
@@ -672,7 +676,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
672
676
|
)}
|
|
673
677
|
|
|
674
678
|
<View style={{ flexDirection: 'row', flexBasis: '50%' }}>
|
|
675
|
-
{
|
|
679
|
+
{((isRequiredField && isRequiredField('internal_number')) || showFieldWithTheme('internal_number')) && (
|
|
676
680
|
<Controller
|
|
677
681
|
control={control}
|
|
678
682
|
name="internal_number"
|
|
@@ -708,7 +712,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
708
712
|
isFocusHighlight
|
|
709
713
|
style={{
|
|
710
714
|
...styles.inputsStyle,
|
|
711
|
-
marginRight: showField('internal_number') && showField('zipcode') ? 24 : 0
|
|
715
|
+
marginRight: showField?.('internal_number') && showField?.('zipcode') ? 24 : 0
|
|
712
716
|
}}
|
|
713
717
|
forwardRef={internalNumberRef}
|
|
714
718
|
returnKeyType="next"
|
|
@@ -719,7 +723,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
719
723
|
/>
|
|
720
724
|
)}
|
|
721
725
|
|
|
722
|
-
{
|
|
726
|
+
{((isRequiredField && isRequiredField('zipcode')) || showFieldWithTheme('zipcode')) && (
|
|
723
727
|
<Controller
|
|
724
728
|
control={control}
|
|
725
729
|
name="zipcode"
|
|
@@ -764,7 +768,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
764
768
|
)}
|
|
765
769
|
</View>
|
|
766
770
|
|
|
767
|
-
{
|
|
771
|
+
{((isRequiredField && isRequiredField('address_notes')) || showFieldWithTheme('address_notes')) && (
|
|
768
772
|
<Controller
|
|
769
773
|
control={control}
|
|
770
774
|
name="address_notes"
|
|
@@ -2,7 +2,7 @@ import styled from 'styled-components/native'
|
|
|
2
2
|
|
|
3
3
|
export const AddressFormContainer = styled.View`
|
|
4
4
|
flex: 1;
|
|
5
|
-
padding: 0px
|
|
5
|
+
padding: 0px 20px 20px;
|
|
6
6
|
background-color: ${(props: any) => props.theme.colors.backgroundPage};
|
|
7
7
|
justify-content: space-between;
|
|
8
8
|
`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useEffect } from 'react'
|
|
2
|
-
import { AddressList as AddressListController, useLanguage, useOrder
|
|
2
|
+
import { AddressList as AddressListController, useLanguage, useOrder } from 'ordering-components/native'
|
|
3
3
|
import { AddressItem, Container } from './styles'
|
|
4
4
|
import { Platform, RefreshControl, StyleSheet, View } from 'react-native'
|
|
5
|
-
import { OButton, OText, OAlert,
|
|
5
|
+
import { OButton, OText, OAlert, OIcon } from '../shared'
|
|
6
6
|
import { AddressListParams } from '../../types'
|
|
7
7
|
import { NotFoundSource } from '../NotFoundSource'
|
|
8
8
|
import NavBar from '../NavBar'
|
|
@@ -18,12 +18,10 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
18
18
|
route,
|
|
19
19
|
addressList,
|
|
20
20
|
isFromProfile,
|
|
21
|
-
nopadding,
|
|
22
21
|
handleSetDefault,
|
|
23
22
|
handleDelete,
|
|
24
23
|
setAddressList,
|
|
25
24
|
isGoBack,
|
|
26
|
-
actionStatus,
|
|
27
25
|
isFromBusinesses,
|
|
28
26
|
isFromProductsList,
|
|
29
27
|
afterSignup,
|
|
@@ -34,7 +32,6 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
34
32
|
|
|
35
33
|
const [orderState] = useOrder()
|
|
36
34
|
const [, t] = useLanguage()
|
|
37
|
-
const [{ auth }] = useSession()
|
|
38
35
|
const [refreshing] = useState(false);
|
|
39
36
|
|
|
40
37
|
const [isProfile, setIsProfile] = useState(isFromProfile || route?.params?.isFromProfile);
|
|
@@ -296,8 +293,8 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
296
293
|
<OButton
|
|
297
294
|
text={t('ADD_NEW_ADDRESS', 'Add new Address')}
|
|
298
295
|
imgRightSrc=''
|
|
299
|
-
bgColor={theme.colors.
|
|
300
|
-
textStyle={{ color: theme.colors.
|
|
296
|
+
bgColor={theme.colors.primary}
|
|
297
|
+
textStyle={{ color: theme.colors.white }}
|
|
301
298
|
style={styles.button}
|
|
302
299
|
borderColor={theme.colors.primary}
|
|
303
300
|
onClick={() => !afterSignup ? onNavigationRedirect(
|
|
@@ -3,10 +3,10 @@ import styled from 'styled-components/native'
|
|
|
3
3
|
export const Container = styled.ScrollView`
|
|
4
4
|
position: relative;
|
|
5
5
|
flex: 1;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
paddingLeft: 20px;
|
|
7
|
+
paddingRight: 20px;
|
|
8
|
+
margin-bottom: 40px;
|
|
9
|
+
padding-top: 10px;
|
|
10
10
|
`
|
|
11
11
|
|
|
12
12
|
export const AddressItem = styled.TouchableOpacity`
|
|
@@ -23,8 +23,7 @@ export const AnalyticsSegment = (props: any) => {
|
|
|
23
23
|
segmentClient.track('Product List Viewed', {
|
|
24
24
|
business_id: category?.business_id,
|
|
25
25
|
category_id: category?.id,
|
|
26
|
-
category: category?.name
|
|
27
|
-
products: category?.products
|
|
26
|
+
category: category?.name
|
|
28
27
|
})
|
|
29
28
|
}
|
|
30
29
|
|
|
@@ -62,11 +61,12 @@ export const AnalyticsSegment = (props: any) => {
|
|
|
62
61
|
})
|
|
63
62
|
}
|
|
64
63
|
|
|
65
|
-
const handleProductAdded = (product: any) => {
|
|
64
|
+
const handleProductAdded = (product: any, result: any) => {
|
|
66
65
|
segmentClient.track('Product Added', {
|
|
67
|
-
|
|
66
|
+
cart_id: result.uuid,
|
|
67
|
+
product_id: product.id,
|
|
68
68
|
name: product.name,
|
|
69
|
-
category: product.category_id,
|
|
69
|
+
category: product.category_id || product?.categoryId,
|
|
70
70
|
price: product.price,
|
|
71
71
|
quantity: product.quantity
|
|
72
72
|
})
|
|
@@ -101,7 +101,7 @@ export const AnalyticsSegment = (props: any) => {
|
|
|
101
101
|
|
|
102
102
|
const handleOrderPlaced = (order: any) => {
|
|
103
103
|
segmentClient.track('Order Placed', {
|
|
104
|
-
|
|
104
|
+
order_id: order.id,
|
|
105
105
|
affiliation: order.business?.name,
|
|
106
106
|
revenue: order.total,
|
|
107
107
|
tax: order.tax_total,
|
|
@@ -21,7 +21,7 @@ export const AppleLogin = (props: any) => {
|
|
|
21
21
|
const [{ configs }] = useConfig();
|
|
22
22
|
const [credentialStateForUser, updateCredentialStateForUser] = useState<any>(-1);
|
|
23
23
|
|
|
24
|
-
let user
|
|
24
|
+
let user: any = null
|
|
25
25
|
|
|
26
26
|
const buttonText = auth
|
|
27
27
|
? t('CONTINUE_WITH_APPLE', 'Logout with Apple')
|
|
@@ -53,7 +53,7 @@ export const AppleLogin = (props: any) => {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const fetchAndUpdateCredentialState = async (updateCredentialStateForUser
|
|
56
|
+
const fetchAndUpdateCredentialState = async (updateCredentialStateForUser: any) => {
|
|
57
57
|
if (user === null) {
|
|
58
58
|
updateCredentialStateForUser('N/A');
|
|
59
59
|
} else {
|
|
@@ -66,7 +66,7 @@ export const AppleLogin = (props: any) => {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
const onIOSButtonPress = async (updateCredentialStateForUser
|
|
69
|
+
const onIOSButtonPress = async (updateCredentialStateForUser: any) => {
|
|
70
70
|
try {
|
|
71
71
|
const appleAuthRequestResponse = await appleAuth.performRequest({
|
|
72
72
|
requestedOperation: appleAuth.Operation.LOGIN,
|
|
@@ -79,7 +79,7 @@ export const AppleLogin = (props: any) => {
|
|
|
79
79
|
identityToken,
|
|
80
80
|
authorizationCode
|
|
81
81
|
} = appleAuthRequestResponse;
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
user = newUser;
|
|
84
84
|
|
|
85
85
|
fetchAndUpdateCredentialState(updateCredentialStateForUser).catch(error =>
|
|
@@ -72,7 +72,7 @@ export const BusinessBasicInformation = (
|
|
|
72
72
|
alignItems: 'flex-start'
|
|
73
73
|
},
|
|
74
74
|
businessInfo: {
|
|
75
|
-
paddingHorizontal:
|
|
75
|
+
paddingHorizontal: 20,
|
|
76
76
|
paddingTop: isChewLayout ? 0 : 56,
|
|
77
77
|
},
|
|
78
78
|
bullet: {
|
|
@@ -95,7 +95,7 @@ export const BusinessBasicInformation = (
|
|
|
95
95
|
width: '100%',
|
|
96
96
|
top: 0,
|
|
97
97
|
zIndex: 100,
|
|
98
|
-
left:
|
|
98
|
+
left: 20
|
|
99
99
|
},
|
|
100
100
|
socialIcon: {
|
|
101
101
|
borderRadius: 3,
|
|
@@ -217,7 +217,7 @@ export const BusinessBasicInformation = (
|
|
|
217
217
|
<Placeholder Animation={Fade}>
|
|
218
218
|
<View style={{ flexDirection: 'row' }}>
|
|
219
219
|
{[...Array(5).keys()].map(i => (
|
|
220
|
-
<View style={styles.socialIcon} key={i}>
|
|
220
|
+
<View style={{ ...styles.socialIcon, borderWidth: 0 }} key={i}>
|
|
221
221
|
<PlaceholderLine width={100} height={20} style={{ marginBottom: 0 }} />
|
|
222
222
|
</View>
|
|
223
223
|
))}
|
|
@@ -247,7 +247,7 @@ export const BusinessBasicInformation = (
|
|
|
247
247
|
<View style={styles.tiktokIcon}>
|
|
248
248
|
<OIcon
|
|
249
249
|
src={theme.images.general.tiktok}
|
|
250
|
-
style={{ width: 10, height: 12 }}
|
|
250
|
+
style={{ width: 10, height: 12, bottom: 1 }}
|
|
251
251
|
cover
|
|
252
252
|
/>
|
|
253
253
|
</View>
|
|
@@ -11,7 +11,7 @@ export const BusinessHeader = styled.ImageBackground`
|
|
|
11
11
|
`;
|
|
12
12
|
export const BusinessLogo = styled.View`
|
|
13
13
|
position: absolute;
|
|
14
|
-
start:
|
|
14
|
+
start: 20px;
|
|
15
15
|
top: -36px;
|
|
16
16
|
z-index: 50;
|
|
17
17
|
box-shadow: 0 0 2px ${Platform.OS == 'android' ? '#000000DD' : '#0000001A'};
|
|
@@ -35,7 +35,12 @@ import FastImage from 'react-native-fast-image'
|
|
|
35
35
|
import { LottieAnimation } from '../LottieAnimation';
|
|
36
36
|
import { CardAnimation } from '../shared/CardAnimation';
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
function BusinessControllerPropsAreEqual(prevProps: any, nextProps: any) {
|
|
39
|
+
return JSON.stringify(prevProps.business) === JSON.stringify(nextProps.business) &&
|
|
40
|
+
prevProps.isBusinessOpen === nextProps.isBusinessOpen
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const BusinessControllerUI = React.memo((props: BusinessControllerParams) => {
|
|
39
44
|
const {
|
|
40
45
|
business,
|
|
41
46
|
handleClick,
|
|
@@ -76,7 +81,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
76
81
|
const hideBusinessFavoriteBadge = theme?.business_listing_view?.components?.business?.components?.featured_badge?.hidden
|
|
77
82
|
|
|
78
83
|
const textSize = 12
|
|
79
|
-
const cardHeight = windowHeight * 0.
|
|
84
|
+
const cardHeight = windowHeight * 0.34
|
|
80
85
|
|
|
81
86
|
const styles = StyleSheet.create({
|
|
82
87
|
container: {
|
|
@@ -184,7 +189,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
184
189
|
}
|
|
185
190
|
|
|
186
191
|
return (
|
|
187
|
-
<
|
|
192
|
+
<View style={{ minHeight: 200 }}>
|
|
188
193
|
{isIntersectionObserver ? (
|
|
189
194
|
<CardAnimation
|
|
190
195
|
style={[style, styles.container]}
|
|
@@ -227,7 +232,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
227
232
|
</View>
|
|
228
233
|
)}
|
|
229
234
|
{!hideBusinessOffer && (
|
|
230
|
-
getBusinessOffer((business?.offers)) &&
|
|
235
|
+
!!getBusinessOffer((business?.offers)) &&
|
|
231
236
|
<OfferBox
|
|
232
237
|
isClosed={!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1')}
|
|
233
238
|
isRibbon={business?.ribbon?.enabled && !!business?.ribbon?.text}
|
|
@@ -239,7 +244,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
239
244
|
numberOfLines={2}
|
|
240
245
|
ellipsizeMode='tail'
|
|
241
246
|
lineHeight={13}
|
|
242
|
-
>{getBusinessOffer((business?.offers))
|
|
247
|
+
>{t('DISCOUNT', 'Discount')}{' '}{getBusinessOffer((business?.offers))}</OText>
|
|
243
248
|
</OfferBox>
|
|
244
249
|
)}
|
|
245
250
|
<BusinessState isRibbon={business?.ribbon?.enabled && !!business?.ribbon?.text}>
|
|
@@ -256,7 +261,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
256
261
|
</BusinessState>
|
|
257
262
|
</BusinessHero>
|
|
258
263
|
<BusinessContent>
|
|
259
|
-
<BusinessInfo style={{ position: 'absolute',
|
|
264
|
+
<BusinessInfo style={{ position: 'absolute', top: -26, left: 15 }}>
|
|
260
265
|
{!hideBusinessLogo && (
|
|
261
266
|
<BusinessLogo style={styles.businessLogo}>
|
|
262
267
|
<FastImage
|
|
@@ -270,11 +275,14 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
270
275
|
</BusinessLogo>
|
|
271
276
|
)}
|
|
272
277
|
</BusinessInfo>
|
|
273
|
-
<View style={{ width: '100%', flexDirection: 'row', justifyContent: 'space-between', marginTop: 5 }}>
|
|
278
|
+
<View style={{ width: '100%', flexDirection: 'row', justifyContent: 'space-between', marginTop: 5, alignItems: 'flex-start' }}>
|
|
274
279
|
<OText
|
|
275
280
|
size={textSize + 2}
|
|
276
|
-
style={{ lineHeight: 18, marginBottom: 6 }}
|
|
277
|
-
weight={'500'}
|
|
281
|
+
style={{ lineHeight: 18, marginBottom: 6, width: '90%' }}
|
|
282
|
+
weight={'500'}
|
|
283
|
+
numberOfLines={1}
|
|
284
|
+
ellipsizeMode='tail'
|
|
285
|
+
>
|
|
278
286
|
{business?.name}
|
|
279
287
|
</OText>
|
|
280
288
|
{(!hideBusinessFavorite || !hideBusinessReviews) && (
|
|
@@ -301,7 +309,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
301
309
|
</ReviewAndFavorite>
|
|
302
310
|
)}
|
|
303
311
|
</View>
|
|
304
|
-
<OText size={textSize} style={{ lineHeight: 15, marginBottom: 3 }} numberOfLines={1}>
|
|
312
|
+
<OText size={textSize} style={{ lineHeight: 15, marginBottom: 3, fontFamily: '' }} numberOfLines={1}>
|
|
305
313
|
{business?.address}
|
|
306
314
|
</OText>
|
|
307
315
|
<Metadata>
|
|
@@ -373,9 +381,9 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
373
381
|
</View>
|
|
374
382
|
</Placeholder>
|
|
375
383
|
)}
|
|
376
|
-
</
|
|
384
|
+
</View>
|
|
377
385
|
);
|
|
378
|
-
};
|
|
386
|
+
}, BusinessControllerPropsAreEqual);
|
|
379
387
|
|
|
380
388
|
export const BusinessController = (props: BusinessControllerParams) => {
|
|
381
389
|
const BusinessControllerProps = {
|
|
@@ -8,13 +8,14 @@ export const BusinessHero = styled.View`
|
|
|
8
8
|
`
|
|
9
9
|
|
|
10
10
|
export const BusinessContent = styled.View`
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
position: relative;
|
|
12
|
+
padding-horizontal: 18px;
|
|
13
|
+
padding-bottom: 10px;
|
|
14
|
+
border-bottom-left-radius: 7.6px;
|
|
15
|
+
border-bottom-right-radius: 7.6px;
|
|
16
|
+
border-width: 1px;
|
|
17
|
+
border-color: ${(props: any) => props.theme.colors.border};
|
|
18
|
+
overflow: visible;
|
|
18
19
|
`;
|
|
19
20
|
|
|
20
21
|
export const BusinessInfo = styled.View`
|
|
@@ -17,7 +17,7 @@ export const MediaWrapper = styled.ScrollView`
|
|
|
17
17
|
height: 127px;
|
|
18
18
|
`
|
|
19
19
|
export const InnerContent = styled.View`
|
|
20
|
-
padding: 20px
|
|
20
|
+
padding: 20px;
|
|
21
21
|
`
|
|
22
22
|
export const WrapScheduleBlock = styled.View`
|
|
23
23
|
margin: 20px 0;
|
|
@@ -36,4 +36,4 @@ export const DivideView = styled.View`
|
|
|
36
36
|
height: 8px;
|
|
37
37
|
background-color: ${(props: any) => props.theme.colors.backgroundGray100};
|
|
38
38
|
margin-horizontal: -40px;
|
|
39
|
-
`;
|
|
39
|
+
`;
|
|
@@ -23,7 +23,10 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
23
23
|
handleClickCheckout,
|
|
24
24
|
checkoutButtonDisabled,
|
|
25
25
|
isMultiCheckout,
|
|
26
|
-
isFromUpselling
|
|
26
|
+
isFromUpselling,
|
|
27
|
+
changeActiveState,
|
|
28
|
+
isActive,
|
|
29
|
+
isGiftCart
|
|
27
30
|
} = props
|
|
28
31
|
|
|
29
32
|
const [orderState] = useOrder();
|
|
@@ -38,14 +41,13 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
38
41
|
const isProducts = cart?.products?.length
|
|
39
42
|
const isBusinessChangeEnabled = configs?.cart_change_business_validation?.value === '1'
|
|
40
43
|
|
|
41
|
-
const [isActive, setActiveState] = useState(!!singleBusiness)
|
|
42
44
|
const [viewedCart, setViewedCart] = useState<any>(null)
|
|
43
45
|
|
|
44
46
|
useEffect(() => {
|
|
45
47
|
const cartsArray = Object.values(orderState?.carts)
|
|
46
48
|
const cartsLength = cartsArray.filter((cart: any) => cart.products.length > 0).length ?? 0
|
|
47
49
|
if (cartsLength === 1) {
|
|
48
|
-
|
|
50
|
+
changeActiveState && changeActiveState(!isClosed, cart?.uuid)
|
|
49
51
|
}
|
|
50
52
|
}, [orderState?.carts, isClosed])
|
|
51
53
|
|
|
@@ -68,14 +70,14 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
68
70
|
<BIContainer isClosed={isClosed} isMultiCheckout={isMultiCheckout} checkoutVisible={!isActive && !isClosed && !!isProducts && !checkoutButtonDisabled}>
|
|
69
71
|
<BIHeader
|
|
70
72
|
isClosed={isClosed}
|
|
71
|
-
onPress={() => !isClosed ?
|
|
73
|
+
onPress={() => !isClosed ? changeActiveState && changeActiveState(!isClosed, cart?.uuid) : isClosed}
|
|
72
74
|
activeOpacity={1}
|
|
73
75
|
>
|
|
74
76
|
<BIInfo>
|
|
75
77
|
<BIContentInfo>
|
|
76
78
|
<OText size={16} lineHeight={24} weight={'600'}>{cart?.business?.name}</OText>
|
|
77
79
|
<View style={{ flexDirection: 'row' }}>
|
|
78
|
-
{props.onNavigationRedirect && !isClosed && (
|
|
80
|
+
{props.onNavigationRedirect && !isClosed && !isGiftCart && (
|
|
79
81
|
<>
|
|
80
82
|
<TouchableOpacity onPress={() => props.onNavigationRedirect('Business', { store: cart?.business?.slug })}>
|
|
81
83
|
<OText color={theme.colors.primary} size={12} lineHeight={18} style={{ textDecorationLine: 'underline' }}>{t('GO_TO_STORE', 'Go to store')}</OText>
|
|
@@ -84,7 +86,9 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
84
86
|
)}
|
|
85
87
|
{!isCartPending && (
|
|
86
88
|
<>
|
|
87
|
-
|
|
89
|
+
{!isGiftCart && (
|
|
90
|
+
<OText color={theme.colors.textSecondary}>{' \u2022 '}</OText>
|
|
91
|
+
)}
|
|
88
92
|
<OAlert
|
|
89
93
|
title={t('DELETE_CART', 'Delete Cart')}
|
|
90
94
|
message={t('QUESTION_DELETE_CART', 'Are you sure to you wants delete the selected cart')}
|
|
@@ -94,7 +98,7 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
94
98
|
</OAlert>
|
|
95
99
|
</>
|
|
96
100
|
)}
|
|
97
|
-
{isBusinessChangeEnabled && props.handleChangeStore && (
|
|
101
|
+
{isBusinessChangeEnabled && props.handleChangeStore && !isGiftCart && (
|
|
98
102
|
<>
|
|
99
103
|
<OText color={theme.colors.textSecondary}>{' \u2022 '}</OText>
|
|
100
104
|
<TouchableOpacity
|