@lookiero/checkout 0.8.24 → 0.8.26
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/dist/infrastructure/ui/components/layouts/tabs/Tabs.js +5 -5
- package/dist/infrastructure/ui/views/checkout/Checkout.js +8 -1
- package/dist/infrastructure/ui/views/summary/Summary.js +39 -4
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.d.ts +1 -0
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js +2 -2
- package/dist/shared/tracking/infrastructure/useTrackPressContinue.d.ts +15 -0
- package/dist/shared/tracking/infrastructure/useTrackPressContinue.js +22 -0
- package/dist/shared/tracking/infrastructure/useTrackPressItem.d.ts +18 -0
- package/dist/shared/tracking/infrastructure/useTrackPressItem.js +23 -0
- package/dist/shared/tracking/infrastructure/useTrackPressPricing.d.ts +18 -0
- package/dist/shared/tracking/infrastructure/useTrackPressPricing.js +23 -0
- package/dist/shared/tracking/infrastructure/useTrackTabView.d.ts +15 -0
- package/dist/shared/tracking/infrastructure/useTrackTabView.js +23 -0
- package/dist/shared/tracking/tracking.d.ts +16 -2
- package/dist/shared/tracking/tracking.js +4 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
2
|
import { animated, useSpring } from "@react-spring/native";
|
|
3
|
-
import React, { Children, useCallback, useState } from "react";
|
|
3
|
+
import React, { Children, useCallback, useEffect, useState } from "react";
|
|
4
4
|
import { Pressable, View } from "react-native";
|
|
5
5
|
import invariant from "tiny-invariant";
|
|
6
6
|
import { Slider } from "../../../../../shared/ui/components/layouts/slider/Slider";
|
|
@@ -35,10 +35,10 @@ const TabList = ({ labels = [], tabIndex = 0, style: customStyle, onSelect }) =>
|
|
|
35
35
|
const Tabs = ({ children, defaultIndex = 0, tabLabels, style: customStyle, onChanged, tabLabelsWrapper = (children) => children, }) => {
|
|
36
36
|
invariant(Children.count(children) === tabLabels.length, "Children and tab labels must be the same length");
|
|
37
37
|
const [active, setActive] = useState(defaultIndex);
|
|
38
|
-
const handleOnActiveChanged = useCallback((activeIndex) =>
|
|
39
|
-
|
|
40
|
-
onChanged?.(
|
|
41
|
-
}, [onChanged]);
|
|
38
|
+
const handleOnActiveChanged = useCallback((activeIndex) => setActive(activeIndex), []);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
onChanged?.(active);
|
|
41
|
+
}, [active, onChanged]);
|
|
42
42
|
return (React.createElement(View, { style: [style.container, customStyle?.tabContainer], testID: "tabs" },
|
|
43
43
|
tabLabelsWrapper(React.createElement(TabList, { labels: tabLabels, style: customStyle?.tabList, tabIndex: active, onSelect: handleOnActiveChanged })),
|
|
44
44
|
React.createElement(View, { style: customStyle?.sliderContainer },
|
|
@@ -6,6 +6,7 @@ import { Platform, View } from "react-native";
|
|
|
6
6
|
import { useNavigate } from "react-router-native";
|
|
7
7
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
8
8
|
import { useTrackPageView } from "../../../../shared/tracking/infrastructure/useTrackPageView";
|
|
9
|
+
import { useTrackPressContinue } from "../../../../shared/tracking/infrastructure/useTrackPressContinue";
|
|
9
10
|
import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
|
|
10
11
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
11
12
|
import { useViewPricingByCheckoutId } from "../../../projection/pricing/react/useViewPricingByCheckoutId";
|
|
@@ -32,9 +33,15 @@ const Checkout = ({ children, customerId, country, useRedirect }) => {
|
|
|
32
33
|
});
|
|
33
34
|
const navigate = useNavigate();
|
|
34
35
|
const basePath = useBasePath();
|
|
36
|
+
const trackPressContinue = useTrackPressContinue({
|
|
37
|
+
page: TrackingPage.CHECKOUT,
|
|
38
|
+
country,
|
|
39
|
+
checkoutId: checkout?.id,
|
|
40
|
+
});
|
|
35
41
|
const handleOnSubmit = useCallback(() => {
|
|
42
|
+
trackPressContinue();
|
|
36
43
|
navigate(`${basePath}/${Routes.CHECKOUT}/${Routes.CHECKOUT_PAYMENT}`, { replace: true });
|
|
37
|
-
}, [basePath, navigate]);
|
|
44
|
+
}, [basePath, navigate, trackPressContinue]);
|
|
38
45
|
const checkoutItemsKept = useMemo(() => checkout?.items.filter((checkoutItem) => checkoutItem.status === CheckoutItemStatus.KEPT || checkoutItem.status === CheckoutItemStatus.REPLACED), [checkout?.items]);
|
|
39
46
|
const hasReplacedCheckoutItem = useMemo(() => checkout?.items.some((checkoutItem) => checkoutItem.status === CheckoutItemStatus.REPLACED), [checkout?.items]);
|
|
40
47
|
const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
|
|
@@ -6,6 +6,10 @@ import { Platform, View } from "react-native";
|
|
|
6
6
|
import { generatePath, useNavigate } from "react-router-native";
|
|
7
7
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
8
8
|
import { useTrackPageView } from "../../../../shared/tracking/infrastructure/useTrackPageView";
|
|
9
|
+
import { useTrackPressContinue } from "../../../../shared/tracking/infrastructure/useTrackPressContinue";
|
|
10
|
+
import { useTrackPressItem } from "../../../../shared/tracking/infrastructure/useTrackPressItem";
|
|
11
|
+
import { useTrackPressPricing } from "../../../../shared/tracking/infrastructure/useTrackPressPricing";
|
|
12
|
+
import { useTrackTabView } from "../../../../shared/tracking/infrastructure/useTrackTabView";
|
|
9
13
|
import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
|
|
10
14
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
11
15
|
import { useViewFiveItemsDiscountByCustomerId } from "../../../projection/checkout/react/useViewFiveItemsDiscountByCustomerId";
|
|
@@ -38,10 +42,41 @@ const Summary = ({ customerId, country }) => {
|
|
|
38
42
|
});
|
|
39
43
|
const navigate = useNavigate();
|
|
40
44
|
const basePath = useBasePath();
|
|
45
|
+
const trackPressPricing = useTrackPressPricing({
|
|
46
|
+
page: TrackingPage.SUMMARY,
|
|
47
|
+
country,
|
|
48
|
+
checkoutId: checkout?.id,
|
|
49
|
+
});
|
|
41
50
|
const [pricingCollapsed, setPricingCollapsed] = useState(true);
|
|
42
|
-
const handleOnPressPricing = useCallback(() =>
|
|
43
|
-
|
|
44
|
-
|
|
51
|
+
const handleOnPressPricing = useCallback(() => {
|
|
52
|
+
const collapsed = !pricingCollapsed;
|
|
53
|
+
setPricingCollapsed(collapsed);
|
|
54
|
+
trackPressPricing({ collapse: collapsed });
|
|
55
|
+
}, [pricingCollapsed, trackPressPricing]);
|
|
56
|
+
const trackPressContinue = useTrackPressContinue({
|
|
57
|
+
page: TrackingPage.SUMMARY,
|
|
58
|
+
country,
|
|
59
|
+
checkoutId: checkout?.id,
|
|
60
|
+
});
|
|
61
|
+
const handleOnSubmit = useCallback(() => {
|
|
62
|
+
trackPressContinue();
|
|
63
|
+
navigate(`${basePath}/${Routes.CHECKOUT}`);
|
|
64
|
+
}, [basePath, navigate, trackPressContinue]);
|
|
65
|
+
const trackPressItem = useTrackPressItem({
|
|
66
|
+
page: TrackingPage.SUMMARY,
|
|
67
|
+
country,
|
|
68
|
+
checkoutId: checkout?.id,
|
|
69
|
+
});
|
|
70
|
+
const handleOnPressItem = useCallback((checkoutItemId) => {
|
|
71
|
+
trackPressItem({ checkoutItemId });
|
|
72
|
+
navigate(`${basePath}/${generatePath(Routes.ITEM_DETAIL, { id: checkoutItemId })}`);
|
|
73
|
+
}, [basePath, navigate, trackPressItem]);
|
|
74
|
+
const trackTabView = useTrackTabView({
|
|
75
|
+
page: TrackingPage.SUMMARY,
|
|
76
|
+
country,
|
|
77
|
+
checkoutId: checkout?.id,
|
|
78
|
+
});
|
|
79
|
+
const handleOnChangedTab = useCallback((active) => trackTabView({ tab: active === 0 ? "keep" : "return" }), [trackTabView]);
|
|
45
80
|
const checkoutItemsKept = useMemo(() => checkout?.items.filter((checkoutItem) => checkoutItem.status === CheckoutItemStatus.KEPT || checkoutItem.status === CheckoutItemStatus.REPLACED), [checkout?.items]);
|
|
46
81
|
const checkoutItemsReturned = useMemo(() => checkout?.items.filter((checkoutItem) => checkoutItem.status === CheckoutItemStatus.RETURNED || checkoutItem.status === CheckoutItemStatus.REPLACED), [checkout?.items]);
|
|
47
82
|
const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
|
|
@@ -56,6 +91,6 @@ const Summary = ({ customerId, country }) => {
|
|
|
56
91
|
React.createElement(View, { style: style.content },
|
|
57
92
|
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
58
93
|
React.createElement(Text, { level: 3, style: style.description, body: true }, descriptionText)),
|
|
59
|
-
React.createElement(CheckoutItemsTabs, { checkoutItemsKept: checkoutItemsKept || [], checkoutItemsReturned: checkoutItemsReturned || [], country: country, onPressItem: handleOnPressItem }))));
|
|
94
|
+
React.createElement(CheckoutItemsTabs, { checkoutItemsKept: checkoutItemsKept || [], checkoutItemsReturned: checkoutItemsReturned || [], country: country, onChanged: handleOnChangedTab, onPressItem: handleOnPressItem }))));
|
|
60
95
|
};
|
|
61
96
|
export { Summary };
|
package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ interface CheckoutItemsTabsProps {
|
|
|
6
6
|
readonly checkoutItemsReturned: CheckoutItemProjection[];
|
|
7
7
|
readonly country: Country;
|
|
8
8
|
readonly onPressItem: (checkoutItemId: string) => void;
|
|
9
|
+
readonly onChanged?: (index: number) => void;
|
|
9
10
|
}
|
|
10
11
|
declare const CheckoutItemsTabs: FC<CheckoutItemsTabsProps>;
|
|
11
12
|
export { CheckoutItemsTabs };
|
package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js
CHANGED
|
@@ -9,13 +9,13 @@ import { ProductVariant } from "../../../item/components/productVariant/ProductV
|
|
|
9
9
|
import { style } from "./CheckoutItemsTabs.style";
|
|
10
10
|
const CheckoutItem = ({ checkoutItemStatus, checkoutItemProductVariant, checkoutItemPrice, country, discarded = false, testID, style: customStyle, onPress, }) => (React.createElement(View, { style: style.checkoutItem, testID: testID },
|
|
11
11
|
React.createElement(ProductVariant, { brand: checkoutItemProductVariant.brand, color: checkoutItemProductVariant.color, country: country, discarded: discarded, media: checkoutItemProductVariant.media, name: checkoutItemProductVariant.name, price: checkoutItemPrice, size: checkoutItemProductVariant.size, status: checkoutItemStatus, style: customStyle, onPress: onPress })));
|
|
12
|
-
const CheckoutItemsTabs = ({ checkoutItemsKept, checkoutItemsReturned, country, onPressItem, }) => {
|
|
12
|
+
const CheckoutItemsTabs = ({ checkoutItemsKept, checkoutItemsReturned, country, onPressItem, onChanged, }) => {
|
|
13
13
|
const keepTabText = useI18nMessage({ id: I18nMessages.SUMMARY_KEEP_TAB });
|
|
14
14
|
const returnTabText = useI18nMessage({ id: I18nMessages.SUMMARY_RETURN_TAB });
|
|
15
15
|
const keepEmptyText = useI18nMessage({ id: I18nMessages.SUMMARY_KEEP_EMPTY });
|
|
16
16
|
const returnEmptyText = useI18nMessage({ id: I18nMessages.SUMMARY_RETURN_EMPTY });
|
|
17
17
|
const handleOnPressItem = useCallback((checkoutItemId) => onPressItem(checkoutItemId), [onPressItem]);
|
|
18
|
-
return (React.createElement(Tabs, { style: { sliderContainer: style.sliderContainer }, tabLabels: [`${keepTabText} (${checkoutItemsKept.length})`, `${returnTabText} (${checkoutItemsReturned.length})`] },
|
|
18
|
+
return (React.createElement(Tabs, { style: { sliderContainer: style.sliderContainer }, tabLabels: [`${keepTabText} (${checkoutItemsKept.length})`, `${returnTabText} (${checkoutItemsReturned.length})`], onChanged: onChanged },
|
|
19
19
|
React.createElement(React.Fragment, null, checkoutItemsKept.length === 0 ? (React.createElement(Text, { style: style.emptyText }, keepEmptyText)) : (checkoutItemsKept.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItemPrice: checkoutItem.price, checkoutItemStatus: checkoutItem.status, country: country, testID: "keep-checkout-item", checkoutItemProductVariant: checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
|
|
20
20
|
? checkoutItem.replacedFor
|
|
21
21
|
: checkoutItem.productVariant, onPress: () => handleOnPressItem(checkoutItem.id) }))))),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TrackingPage } from "../../../infrastructure/tracking/tracking";
|
|
2
|
+
import { Country } from "../../../projection/shared/country";
|
|
3
|
+
interface PressContinueFunction {
|
|
4
|
+
(): void;
|
|
5
|
+
}
|
|
6
|
+
interface UseTrackPressContinueFunctionArgs {
|
|
7
|
+
readonly page: TrackingPage;
|
|
8
|
+
readonly country: Country;
|
|
9
|
+
readonly checkoutId: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
interface UseTrackPressContinueFunction {
|
|
12
|
+
(agrs: UseTrackPressContinueFunctionArgs): PressContinueFunction;
|
|
13
|
+
}
|
|
14
|
+
declare const useTrackPressContinue: UseTrackPressContinueFunction;
|
|
15
|
+
export { useTrackPressContinue };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { PROJECT } from "../../../infrastructure/tracking/tracking";
|
|
3
|
+
import { TrackingEvent, TrackingEventCategory } from "../tracking";
|
|
4
|
+
import { useEmitUserEvent } from "./useEmitUserEvent";
|
|
5
|
+
const useTrackPressContinue = ({ page, country, checkoutId }) => {
|
|
6
|
+
const emitUserEvent = useEmitUserEvent();
|
|
7
|
+
const pressContinue = useCallback(() => {
|
|
8
|
+
if (!checkoutId) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const pressContinueTrackingEvent = {
|
|
12
|
+
event: TrackingEvent.PRESS_CONTINUE,
|
|
13
|
+
eventCategory: TrackingEventCategory.NAVIGATION,
|
|
14
|
+
section: `${PROJECT}_${page}`,
|
|
15
|
+
store: country,
|
|
16
|
+
checkoutId,
|
|
17
|
+
};
|
|
18
|
+
emitUserEvent(pressContinueTrackingEvent);
|
|
19
|
+
}, [checkoutId, country, emitUserEvent, page]);
|
|
20
|
+
return pressContinue;
|
|
21
|
+
};
|
|
22
|
+
export { useTrackPressContinue };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TrackingPage } from "../../../infrastructure/tracking/tracking";
|
|
2
|
+
import { Country } from "../../../projection/shared/country";
|
|
3
|
+
interface PressItemFunctionArgs {
|
|
4
|
+
readonly checkoutItemId: string;
|
|
5
|
+
}
|
|
6
|
+
interface PressItemFunction {
|
|
7
|
+
(args: PressItemFunctionArgs): void;
|
|
8
|
+
}
|
|
9
|
+
interface UseTrackPressItemFunctionArgs {
|
|
10
|
+
readonly page: TrackingPage;
|
|
11
|
+
readonly country: Country;
|
|
12
|
+
readonly checkoutId: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface UseTrackPressItemFunction {
|
|
15
|
+
(agrs: UseTrackPressItemFunctionArgs): PressItemFunction;
|
|
16
|
+
}
|
|
17
|
+
declare const useTrackPressItem: UseTrackPressItemFunction;
|
|
18
|
+
export { useTrackPressItem };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { PROJECT } from "../../../infrastructure/tracking/tracking";
|
|
3
|
+
import { TrackingEvent, TrackingEventCategory } from "../tracking";
|
|
4
|
+
import { useEmitUserEvent } from "./useEmitUserEvent";
|
|
5
|
+
const useTrackPressItem = ({ page, country, checkoutId }) => {
|
|
6
|
+
const emitUserEvent = useEmitUserEvent();
|
|
7
|
+
const pressItem = useCallback(({ checkoutItemId }) => {
|
|
8
|
+
if (!checkoutId) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const pressItemTrackingEvent = {
|
|
12
|
+
event: TrackingEvent.PRESS_ITEM,
|
|
13
|
+
eventCategory: TrackingEventCategory.NAVIGATION,
|
|
14
|
+
section: `${PROJECT}_${page}`,
|
|
15
|
+
store: country,
|
|
16
|
+
checkoutId,
|
|
17
|
+
checkoutItemId,
|
|
18
|
+
};
|
|
19
|
+
emitUserEvent(pressItemTrackingEvent);
|
|
20
|
+
}, [checkoutId, country, emitUserEvent, page]);
|
|
21
|
+
return pressItem;
|
|
22
|
+
};
|
|
23
|
+
export { useTrackPressItem };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TrackingPage } from "../../../infrastructure/tracking/tracking";
|
|
2
|
+
import { Country } from "../../../projection/shared/country";
|
|
3
|
+
interface PressPricingFunctionArgs {
|
|
4
|
+
readonly collapse: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface PressPricingFunction {
|
|
7
|
+
(args: PressPricingFunctionArgs): void;
|
|
8
|
+
}
|
|
9
|
+
interface UseTrackPressPricingFunctionArgs {
|
|
10
|
+
readonly page: TrackingPage;
|
|
11
|
+
readonly country: Country;
|
|
12
|
+
readonly checkoutId: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface UseTrackPressPricingFunction {
|
|
15
|
+
(agrs: UseTrackPressPricingFunctionArgs): PressPricingFunction;
|
|
16
|
+
}
|
|
17
|
+
declare const useTrackPressPricing: UseTrackPressPricingFunction;
|
|
18
|
+
export { useTrackPressPricing };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { PROJECT } from "../../../infrastructure/tracking/tracking";
|
|
3
|
+
import { TrackingEvent, TrackingEventCategory } from "../tracking";
|
|
4
|
+
import { useEmitUserEvent } from "./useEmitUserEvent";
|
|
5
|
+
const useTrackPressPricing = ({ page, country, checkoutId }) => {
|
|
6
|
+
const emitUserEvent = useEmitUserEvent();
|
|
7
|
+
const pressPricing = useCallback(({ collapse }) => {
|
|
8
|
+
if (!checkoutId) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const pressPricingTrackingEvent = {
|
|
12
|
+
event: TrackingEvent.PRESS_PRICING,
|
|
13
|
+
eventCategory: TrackingEventCategory.NAVIGATION,
|
|
14
|
+
section: `${PROJECT}_${page}`,
|
|
15
|
+
store: country,
|
|
16
|
+
checkoutId,
|
|
17
|
+
collapse,
|
|
18
|
+
};
|
|
19
|
+
emitUserEvent(pressPricingTrackingEvent);
|
|
20
|
+
}, [checkoutId, country, emitUserEvent, page]);
|
|
21
|
+
return pressPricing;
|
|
22
|
+
};
|
|
23
|
+
export { useTrackPressPricing };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TrackingPage } from "../../../infrastructure/tracking/tracking";
|
|
2
|
+
import { Country } from "../../../projection/shared/country";
|
|
3
|
+
interface TabViewFunctionArgs<T> {
|
|
4
|
+
readonly tab: T;
|
|
5
|
+
}
|
|
6
|
+
interface TabViewFunction<T> {
|
|
7
|
+
(args: TabViewFunctionArgs<T>): void;
|
|
8
|
+
}
|
|
9
|
+
interface UseTrackTabViewFunctionArgs {
|
|
10
|
+
readonly page: TrackingPage;
|
|
11
|
+
readonly country: Country;
|
|
12
|
+
readonly checkoutId: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
declare const useTrackTabView: <T>({ page, country, checkoutId }: UseTrackTabViewFunctionArgs) => TabViewFunction<T>;
|
|
15
|
+
export { useTrackTabView };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { PROJECT } from "../../../infrastructure/tracking/tracking";
|
|
3
|
+
import { TrackingEvent, TrackingEventCategory } from "../tracking";
|
|
4
|
+
import { useEmitUserEvent } from "./useEmitUserEvent";
|
|
5
|
+
const useTrackTabView = ({ page, country, checkoutId }) => {
|
|
6
|
+
const emitUserEvent = useEmitUserEvent();
|
|
7
|
+
const tabView = useCallback(({ tab }) => {
|
|
8
|
+
if (!checkoutId) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const tabViewTrackingEvent = {
|
|
12
|
+
event: TrackingEvent.TAB_VIEW,
|
|
13
|
+
eventCategory: TrackingEventCategory.NAVIGATION,
|
|
14
|
+
section: `${PROJECT}_${page}`,
|
|
15
|
+
store: country,
|
|
16
|
+
checkoutId,
|
|
17
|
+
tab,
|
|
18
|
+
};
|
|
19
|
+
emitUserEvent(tabViewTrackingEvent);
|
|
20
|
+
}, [checkoutId, country, emitUserEvent, page]);
|
|
21
|
+
return tabView;
|
|
22
|
+
};
|
|
23
|
+
export { useTrackTabView };
|
|
@@ -6,7 +6,11 @@ declare enum TrackingEvent {
|
|
|
6
6
|
RETURN_ITEM = "return-item",
|
|
7
7
|
REPLACE_ITEM = "replace-item",
|
|
8
8
|
RESET_ITEM = "reset-item",
|
|
9
|
-
IMAGE_VIEW = "image-view"
|
|
9
|
+
IMAGE_VIEW = "image-view",
|
|
10
|
+
PRESS_PRICING = "press-pricing",
|
|
11
|
+
PRESS_ITEM = "press-item",
|
|
12
|
+
PRESS_CONTINUE = "press-continue",
|
|
13
|
+
TAB_VIEW = "tab-view"
|
|
10
14
|
}
|
|
11
15
|
declare enum TrackingEventCategory {
|
|
12
16
|
NAVIGATION = "navigation"
|
|
@@ -44,5 +48,15 @@ interface ImageViewTrackingEvent extends BaseTrackingEvent {
|
|
|
44
48
|
readonly productVariantId: string;
|
|
45
49
|
readonly perspective: MediaPerspective;
|
|
46
50
|
}
|
|
47
|
-
|
|
51
|
+
interface PressPricingTrackingEvent extends BaseTrackingEvent {
|
|
52
|
+
readonly collapse: boolean;
|
|
53
|
+
}
|
|
54
|
+
interface PressItemTrackingEvent extends BaseTrackingEvent {
|
|
55
|
+
readonly checkoutItemId: string;
|
|
56
|
+
}
|
|
57
|
+
type PressContinueTrackingEvent = BaseTrackingEvent;
|
|
58
|
+
interface TabViewTrackingEvent<T> extends BaseTrackingEvent {
|
|
59
|
+
readonly tab: T;
|
|
60
|
+
}
|
|
61
|
+
export type { BaseTrackingEvent, ImageViewTrackingEvent, ItemPageViewTrackingEvent, KeepItemTrackingEvent, PageViewTrackingEvent, PressContinueTrackingEvent, PressItemTrackingEvent, PressPricingTrackingEvent, ReplaceItemTrackingEvent, ResetItemTrackingEvent, ReturnItemTrackingEvent, TabViewTrackingEvent, };
|
|
48
62
|
export { TrackingEvent, TrackingEventCategory };
|
|
@@ -6,6 +6,10 @@ var TrackingEvent;
|
|
|
6
6
|
TrackingEvent["REPLACE_ITEM"] = "replace-item";
|
|
7
7
|
TrackingEvent["RESET_ITEM"] = "reset-item";
|
|
8
8
|
TrackingEvent["IMAGE_VIEW"] = "image-view";
|
|
9
|
+
TrackingEvent["PRESS_PRICING"] = "press-pricing";
|
|
10
|
+
TrackingEvent["PRESS_ITEM"] = "press-item";
|
|
11
|
+
TrackingEvent["PRESS_CONTINUE"] = "press-continue";
|
|
12
|
+
TrackingEvent["TAB_VIEW"] = "tab-view";
|
|
9
13
|
})(TrackingEvent || (TrackingEvent = {}));
|
|
10
14
|
var TrackingEventCategory;
|
|
11
15
|
(function (TrackingEventCategory) {
|