ordering-ui-react-native 0.14.40 → 0.14.42-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 +2 -2
- package/src/components/BusinessItemAccordion/index.tsx +2 -2
- package/src/components/Cart/index.tsx +135 -42
- package/src/components/Cart/styles.tsx +7 -0
- package/src/components/Checkout/index.tsx +28 -166
- package/src/components/OrderDetails/index.tsx +102 -34
- package/src/components/OrderDetails/styles.tsx +7 -0
- package/src/components/OrderSummary/index.tsx +140 -37
- package/src/components/OrderSummary/styles.tsx +10 -2
- package/src/components/PaymentOptions/index.tsx +3 -1
- package/src/components/PaymentOptionsWebView/index.tsx +150 -0
- package/src/components/ProductForm/index.tsx +6 -6
- package/src/components/SingleProductCard/index.tsx +1 -1
- package/src/components/StripeElementsForm/index.tsx +28 -13
- package/src/components/TaxInformation/index.tsx +58 -26
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OIcon.tsx +4 -1
- package/src/index.tsx +2 -0
- package/src/navigators/HomeNavigator.tsx +6 -0
- package/src/pages/ProductDetails.tsx +55 -0
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/kiosk/src/components/Cart/index.tsx +14 -21
- package/themes/kiosk/src/components/CartItem/index.tsx +9 -7
- package/themes/kiosk/src/components/CustomerName/index.tsx +2 -1
- package/themes/kiosk/src/components/Intro/index.tsx +4 -4
- package/themes/kiosk/src/components/OptionCard/index.tsx +11 -6
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +46 -44
- package/themes/original/src/components/BusinessController/index.tsx +3 -3
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -9
- package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +8 -4
- package/themes/original/src/components/BusinessesListing/index.tsx +129 -94
- package/themes/original/src/components/Cart/index.tsx +122 -24
- package/themes/original/src/components/Cart/styles.tsx +8 -1
- package/themes/original/src/components/Checkout/index.tsx +38 -3
- package/themes/original/src/components/Help/index.tsx +1 -1
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -0
- package/themes/original/src/components/MessageListing/index.tsx +4 -2
- package/themes/original/src/components/MomentOption/index.tsx +150 -158
- package/themes/original/src/components/OrderDetails/index.tsx +114 -42
- package/themes/original/src/components/OrderDetails/styles.tsx +8 -1
- package/themes/original/src/components/OrderProgress/index.tsx +2 -1
- package/themes/original/src/components/OrderSummary/index.tsx +132 -23
- package/themes/original/src/components/OrderSummary/styles.tsx +7 -0
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +6 -2
- package/themes/original/src/components/PaymentOptions/index.tsx +8 -2
- package/themes/original/src/components/ProductForm/index.tsx +63 -56
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +54 -51
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +8 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +36 -19
- package/themes/original/src/components/SingleProductCard/styles.tsx +4 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +28 -13
- package/themes/original/src/components/TaxInformation/index.tsx +59 -27
- package/themes/original/src/components/UpsellingProducts/index.tsx +26 -18
- package/themes/original/src/types/index.tsx +2 -0
|
@@ -33,8 +33,8 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
33
33
|
canOpenUpselling,
|
|
34
34
|
setCanOpenUpselling,
|
|
35
35
|
isFromCart,
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
onNavigationRedirect,
|
|
37
|
+
onGoBack
|
|
38
38
|
} = props
|
|
39
39
|
|
|
40
40
|
const theme = useTheme();
|
|
@@ -70,17 +70,18 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
70
70
|
const [{ parsePrice }] = useUtils()
|
|
71
71
|
const [, t] = useLanguage()
|
|
72
72
|
const { bottom } = useSafeAreaInsets()
|
|
73
|
+
const [isCheckout, setIsCheckout] = useState(false)
|
|
73
74
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
const cart = carts?.[`businessId:${props.businessId}`] ?? {}
|
|
76
|
+
const cartProducts = cart?.products?.length
|
|
77
|
+
? cart?.products.map((product: any) => product.id)
|
|
78
|
+
: []
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
const productsList = !upsellingProducts.loading && !upsellingProducts.error
|
|
81
|
+
? upsellingProducts?.products?.length
|
|
82
|
+
? upsellingProducts?.products.filter((product: any) => !cartProducts.includes(product.id))
|
|
83
|
+
: (props?.products ?? []).filter((product: any) => !cartProducts.includes(product.id)) ?? []
|
|
84
|
+
: []
|
|
84
85
|
|
|
85
86
|
useEffect(() => {
|
|
86
87
|
if (!isCustomMode && !props.products) {
|
|
@@ -94,6 +95,10 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
94
95
|
}
|
|
95
96
|
}, [upsellingProducts.loading, upsellingProducts?.products.length])
|
|
96
97
|
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
isCheckout && Object.keys(cart).length === 0 && onNavigationRedirect && onNavigationRedirect('MyOrders')
|
|
100
|
+
}, [cart, isCheckout])
|
|
101
|
+
|
|
97
102
|
const handleFormProduct = (product: any) => {
|
|
98
103
|
onNavigationRedirect && onNavigationRedirect('ProductDetails', {
|
|
99
104
|
product: product,
|
|
@@ -155,12 +160,6 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
155
160
|
</TopActions>
|
|
156
161
|
</TopBar>
|
|
157
162
|
<ScrollView style={{ marginBottom: props.isPage ? 40 : bottom + (Platform.OS == 'ios' ? 96 : 130) }} showsVerticalScrollIndicator={false}>
|
|
158
|
-
{productsList.length > 0 &&
|
|
159
|
-
<View style={{ paddingHorizontal: 40, overflow: 'visible' }}>
|
|
160
|
-
<OText size={16} lineHeight={24} weight={'500'}>{t('WANT_SOMETHING_ELSE', 'Do you want something else?')}</OText>
|
|
161
|
-
<UpsellingLayout />
|
|
162
|
-
</View>
|
|
163
|
-
}
|
|
164
163
|
<View style={{ paddingHorizontal: 40 }}>
|
|
165
164
|
<OText size={20} lineHeight={30} weight={600} style={{ marginTop: 10, marginBottom: 17 }}>{t('YOUR_CART', 'Your cart')}</OText>
|
|
166
165
|
<OrderSummary
|
|
@@ -169,6 +168,12 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
169
168
|
onNavigationRedirect={onNavigationRedirect}
|
|
170
169
|
/>
|
|
171
170
|
</View>
|
|
171
|
+
{productsList.length > 0 &&
|
|
172
|
+
<View style={{ paddingHorizontal: 40, overflow: 'visible' }}>
|
|
173
|
+
<OText size={16} lineHeight={24} weight={'500'}>{t('WANT_SOMETHING_ELSE', 'Do you want something else?')}</OText>
|
|
174
|
+
<UpsellingLayout />
|
|
175
|
+
</View>
|
|
176
|
+
}
|
|
172
177
|
</ScrollView>
|
|
173
178
|
<View
|
|
174
179
|
style={{
|
|
@@ -181,7 +186,10 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
181
186
|
text={t('CHECKOUT', 'Checkout')}
|
|
182
187
|
style={{...styles.closeUpsellingButton}}
|
|
183
188
|
textStyle={{ color: theme.colors.white, fontSize: 14 }}
|
|
184
|
-
onClick={() =>
|
|
189
|
+
onClick={() => {
|
|
190
|
+
handleUpsellingPage()
|
|
191
|
+
setIsCheckout(true)
|
|
192
|
+
}}
|
|
185
193
|
/>
|
|
186
194
|
</View>
|
|
187
195
|
</>
|
|
@@ -253,6 +253,7 @@ export interface NotFoundSourceParams {
|
|
|
253
253
|
}
|
|
254
254
|
export interface OrdersOptionParams {
|
|
255
255
|
orderList?: any,
|
|
256
|
+
franchiseId?: any,
|
|
256
257
|
activeOrders?: boolean,
|
|
257
258
|
pagination?: any,
|
|
258
259
|
titleContent?: string,
|
|
@@ -482,4 +483,5 @@ export interface HelpAccountAndPaymentParams {
|
|
|
482
483
|
|
|
483
484
|
export interface MessageListingParams {
|
|
484
485
|
navigation: any;
|
|
486
|
+
franchiseId?: any;
|
|
485
487
|
}
|