ordering-ui-react-native 0.16.13 → 0.16.16
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 +1 -1
- package/src/components/OrderDetails/index.tsx +5 -1
- package/src/navigators/CheckoutNavigator.tsx +6 -0
- package/src/navigators/HomeNavigator.tsx +6 -0
- package/src/pages/MultiCheckout.tsx +31 -0
- package/src/pages/MultiOrdersDetails.tsx +27 -0
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +2 -2
- package/themes/original/index.tsx +6 -0
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +3 -2
- package/themes/original/src/components/BusinessItemAccordion/styles.tsx +0 -2
- package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +4 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +16 -7
- package/themes/original/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/original/src/components/Cart/index.tsx +17 -8
- package/themes/original/src/components/FavoriteList/index.tsx +4 -4
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
- package/themes/original/src/components/MultiCheckout/index.tsx +291 -0
- package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +370 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +250 -0
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
- package/themes/original/src/components/MyOrders/index.tsx +120 -32
- package/themes/original/src/components/MyOrders/styles.tsx +8 -1
- package/themes/original/src/components/OrderDetails/index.tsx +9 -7
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +150 -0
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +51 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/index.tsx +102 -28
- package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
- package/themes/original/src/components/SingleOrderCard/index.tsx +5 -3
- package/themes/original/src/components/SingleProductCard/index.tsx +8 -6
- package/themes/original/src/components/StripeElementsForm/index.tsx +10 -2
- package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
- package/themes/original/src/components/UserDetails/index.tsx +1 -1
- package/themes/original/src/types/index.tsx +44 -19
|
@@ -18,17 +18,19 @@ import { shape } from '../../utils';
|
|
|
18
18
|
function SingleProductCardPropsAreEqual(prevProps : any, nextProps : any) {
|
|
19
19
|
return JSON.stringify(prevProps.product) === JSON.stringify(nextProps.product) &&
|
|
20
20
|
prevProps.isSoldOut === nextProps.isSoldOut &&
|
|
21
|
-
prevProps.productAddedToCartLength === nextProps.productAddedToCartLength
|
|
21
|
+
prevProps.productAddedToCartLength === nextProps.productAddedToCartLength &&
|
|
22
|
+
prevProps.categoryState === nextProps.categoryState
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
const SinguleProductCardUI = (props: SingleProductCardParams) => {
|
|
25
|
+
const SinguleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
25
26
|
const {
|
|
26
27
|
product,
|
|
27
28
|
isSoldOut,
|
|
28
29
|
onProductClick,
|
|
29
30
|
productAddedToCartLength,
|
|
30
31
|
style,
|
|
31
|
-
handleFavoriteProduct
|
|
32
|
+
handleFavoriteProduct,
|
|
33
|
+
handleUpdateProducts
|
|
32
34
|
} = props;
|
|
33
35
|
|
|
34
36
|
const theme = useTheme();
|
|
@@ -210,12 +212,12 @@ const SinguleProductCardUI = (props: SingleProductCardParams) => {
|
|
|
210
212
|
)}
|
|
211
213
|
</CardContainer>
|
|
212
214
|
);
|
|
213
|
-
}
|
|
215
|
+
}, SingleProductCardPropsAreEqual);
|
|
214
216
|
|
|
215
|
-
export const SingleProductCard =
|
|
217
|
+
export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
216
218
|
const singleProductCardProps = {
|
|
217
219
|
...props,
|
|
218
220
|
UIComponent: SinguleProductCardUI
|
|
219
221
|
}
|
|
220
222
|
return <SingleProductCardController {...singleProductCardProps} />
|
|
221
|
-
}
|
|
223
|
+
}
|
|
@@ -27,7 +27,8 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
27
27
|
paymethod,
|
|
28
28
|
onCancel,
|
|
29
29
|
cart,
|
|
30
|
-
merchantId
|
|
30
|
+
merchantId,
|
|
31
|
+
businessIds
|
|
31
32
|
} = props;
|
|
32
33
|
|
|
33
34
|
const theme = useTheme();
|
|
@@ -108,7 +109,14 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
108
109
|
const { setupIntent, error } = await confirmSetupIntent(requirements, params);
|
|
109
110
|
|
|
110
111
|
if (setupIntent?.status === 'Succeeded') {
|
|
111
|
-
|
|
112
|
+
if (businessIds) {
|
|
113
|
+
businessIds.forEach((_businessId: any, index: any) => {
|
|
114
|
+
const _isNewCard = index === 0
|
|
115
|
+
stripeTokenHandler(setupIntent?.paymentMethodId, user, businessId, _isNewCard);
|
|
116
|
+
})
|
|
117
|
+
} else {
|
|
118
|
+
stripeTokenHandler(setupIntent?.paymentMethodId, user, businessId);
|
|
119
|
+
}
|
|
112
120
|
}
|
|
113
121
|
|
|
114
122
|
if (error) {
|
|
@@ -40,7 +40,7 @@ export const StripeElementsForm = (props: any) => {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
const stripeTokenHandler = async (tokenId: string, user: any, businessId: string) => {
|
|
43
|
+
const stripeTokenHandler = async (tokenId: string, user: any, businessId: string, isNewCard: any = true) => {
|
|
44
44
|
try {
|
|
45
45
|
setState({
|
|
46
46
|
...state,
|
|
@@ -60,7 +60,7 @@ export const StripeElementsForm = (props: any) => {
|
|
|
60
60
|
})
|
|
61
61
|
})
|
|
62
62
|
const response = await result.json();
|
|
63
|
-
props.onSelectCard && props.onSelectCard(response.result);
|
|
63
|
+
isNewCard && props.onSelectCard && props.onSelectCard(response.result);
|
|
64
64
|
setState({
|
|
65
65
|
...state,
|
|
66
66
|
loadingAdd: false
|
|
@@ -138,7 +138,7 @@ const UserDetailsUI = (props: any) => {
|
|
|
138
138
|
{!(validationFields.loading || formState.loading) && (
|
|
139
139
|
<UDContainer>
|
|
140
140
|
<UDHeader>
|
|
141
|
-
<OText size={16} lineHeight={24} weight={'500'}>
|
|
141
|
+
<OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal}>
|
|
142
142
|
{t('CUSTOMER_DETAILS', 'Customer Details')}
|
|
143
143
|
</OText>
|
|
144
144
|
{cartStatus !== 2 && (
|
|
@@ -18,10 +18,10 @@ export interface LoginParams {
|
|
|
18
18
|
handleCheckPhoneCode?: any;
|
|
19
19
|
notificationState?: any;
|
|
20
20
|
handleReCaptcha?: any;
|
|
21
|
-
|
|
21
|
+
enableReCaptcha?: any;
|
|
22
22
|
otpType?: string,
|
|
23
|
-
setOtpType: (type
|
|
24
|
-
generateOtpCode: (values
|
|
23
|
+
setOtpType: (type: string) => void,
|
|
24
|
+
generateOtpCode: (values?: any) => void,
|
|
25
25
|
useLoginOtpEmail?: boolean,
|
|
26
26
|
useLoginOtpCellphone?: boolean,
|
|
27
27
|
useLoginOtp?: boolean
|
|
@@ -265,9 +265,9 @@ export interface BusinessProductsListParams {
|
|
|
265
265
|
setCategoriesLayout?: any,
|
|
266
266
|
currentCart?: any,
|
|
267
267
|
setSubcategoriesSelected?: any,
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
268
|
+
subcategoriesSelected?: any,
|
|
269
|
+
onClickCategory?: any,
|
|
270
|
+
lazyLoadProductsRecommended?: boolean,
|
|
271
271
|
isFiltMode?: boolean,
|
|
272
272
|
handleUpdateProducts?: any
|
|
273
273
|
}
|
|
@@ -278,6 +278,7 @@ export interface SingleProductCardParams {
|
|
|
278
278
|
onProductClick: any;
|
|
279
279
|
productAddedToCartLength: number;
|
|
280
280
|
style?: ViewStyle,
|
|
281
|
+
categoryState?: any,
|
|
281
282
|
handleFavoriteProduct?: any,
|
|
282
283
|
handleUpdateProducts?: any
|
|
283
284
|
}
|
|
@@ -313,6 +314,7 @@ export interface OrdersOptionParams {
|
|
|
313
314
|
orderList?: any,
|
|
314
315
|
franchiseId?: any,
|
|
315
316
|
activeOrders?: boolean,
|
|
317
|
+
pastOrders?: boolean,
|
|
316
318
|
pagination?: any,
|
|
317
319
|
titleContent?: string,
|
|
318
320
|
customArray?: Array<any>,
|
|
@@ -331,8 +333,15 @@ export interface OrdersOptionParams {
|
|
|
331
333
|
setOpenMessges?: any,
|
|
332
334
|
loadMoreStatus?: boolean,
|
|
333
335
|
refreshOrders?: boolean,
|
|
334
|
-
setRefreshOrders?: (value
|
|
335
|
-
handleUpdateOrderList?: (orderId: number, changes: any) => {}
|
|
336
|
+
setRefreshOrders?: (value: boolean) => void,
|
|
337
|
+
handleUpdateOrderList?: (orderId: number, changes: any) => {},
|
|
338
|
+
isBusiness?: boolean,
|
|
339
|
+
isProducts?: boolean,
|
|
340
|
+
businessOrderIds?: any,
|
|
341
|
+
products?: any,
|
|
342
|
+
businessesSearchList?: any,
|
|
343
|
+
hideOrders?: boolean,
|
|
344
|
+
BusinessControllerSkeletons?: any,
|
|
336
345
|
}
|
|
337
346
|
export interface ActiveOrdersParams {
|
|
338
347
|
orders?: any,
|
|
@@ -520,7 +529,7 @@ export interface OrderTypeSelectParams {
|
|
|
520
529
|
defaultValue?: number;
|
|
521
530
|
configTypes?: Array<any>;
|
|
522
531
|
orderTypes: Array<any>;
|
|
523
|
-
setOrderTypeValue?: (value
|
|
532
|
+
setOrderTypeValue?: (value: number) => any
|
|
524
533
|
}
|
|
525
534
|
export interface UpsellingProductsParams {
|
|
526
535
|
isCustomMode?: boolean;
|
|
@@ -613,26 +622,26 @@ export interface PlaceSpotParams {
|
|
|
613
622
|
|
|
614
623
|
export interface PromotionParams {
|
|
615
624
|
navigation: any,
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
625
|
+
offersState: any,
|
|
626
|
+
handleSearchValue: any,
|
|
627
|
+
searchValue: string,
|
|
628
|
+
offerSelected: any,
|
|
629
|
+
setOfferSelected: any,
|
|
621
630
|
loadOffers: any
|
|
622
631
|
}
|
|
623
632
|
export interface SessionsParams {
|
|
624
633
|
navigation: any,
|
|
625
634
|
sessionsList: any,
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
635
|
+
actionState: any,
|
|
636
|
+
handleDeleteSession: any,
|
|
637
|
+
handleDeleteAllSessions: any
|
|
629
638
|
}
|
|
630
639
|
|
|
631
640
|
export interface otpParams {
|
|
632
641
|
willVerifyOtpState: boolean,
|
|
633
|
-
setWillVerifyOtpState: (val
|
|
642
|
+
setWillVerifyOtpState: (val: boolean) => void,
|
|
634
643
|
onSubmit: () => void,
|
|
635
|
-
handleLoginOtp: (code
|
|
644
|
+
handleLoginOtp: (code: string) => void,
|
|
636
645
|
setAlertState: any
|
|
637
646
|
}
|
|
638
647
|
|
|
@@ -661,3 +670,19 @@ export interface SingleOrderCardParams {
|
|
|
661
670
|
isMessageView?: any,
|
|
662
671
|
handleClickOrder: (value: any) => {}
|
|
663
672
|
}
|
|
673
|
+
|
|
674
|
+
export interface PreviousBusinessOrderedParams {
|
|
675
|
+
navigation?: any,
|
|
676
|
+
businessesList?: any,
|
|
677
|
+
setBusinessLoading?: any,
|
|
678
|
+
businessId?: number,
|
|
679
|
+
onNavigationRedirect?: any,
|
|
680
|
+
isBusinessesSearchList?: any,
|
|
681
|
+
businessLoading?: boolean
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
export interface PreviousProductsOrderedParams {
|
|
685
|
+
products?: any,
|
|
686
|
+
onProductClick?: any,
|
|
687
|
+
isBusinessesSearchList?: boolean
|
|
688
|
+
}
|