@lookiero/checkout 0.6.1 → 0.6.3

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.
@@ -27,7 +27,7 @@ const CheckoutQuestionsForm = ({ checkoutQuestions, submitButtonDisabled, onSubm
27
27
  const filteredCheckoutQuestions = useMemo(() => {
28
28
  const responses = Object.values(feedback);
29
29
  return checkoutQuestions.filter((checkoutQuestion) => checkoutQuestion.showCondition.length === 0 ||
30
- checkoutQuestion.showCondition.every((condition) => responses.includes(condition)));
30
+ checkoutQuestion.showCondition.some((condition) => responses.includes(condition)));
31
31
  }, [checkoutQuestions, feedback]);
32
32
  return (React.createElement(React.Fragment, null,
33
33
  React.createElement(CheckoutQuestionItemProvider, { checkoutQuestionItems: checkoutQuestionItems },
@@ -2,20 +2,26 @@ import { useLayoutEffect } from "react";
2
2
  import { PROJECT } from "../../../infrastructure/tracking/tracking";
3
3
  import { TrackingEvent, TrackingEventCategory } from "../tracking";
4
4
  import { useEmitUserEvent } from "./useEmitUserEvent";
5
- const usePageView = ({ page, country, checkoutId, ...props }) => {
5
+ const usePageView = ({ page, country, checkoutId, checkoutItemId }) => {
6
6
  const emitUserEvent = useEmitUserEvent();
7
7
  useLayoutEffect(() => {
8
8
  if (!checkoutId) {
9
9
  return;
10
10
  }
11
- emitUserEvent({
11
+ const baseTrackingEvent = {
12
12
  event: TrackingEvent.PAGEVIEW,
13
13
  eventCategory: TrackingEventCategory.NAVIGATION,
14
14
  section: `${PROJECT}_${page}`,
15
15
  store: country,
16
16
  checkoutId,
17
- ...props,
18
- });
19
- }, [checkoutId, country, emitUserEvent, page, props]);
17
+ };
18
+ const pageViewTrackingEvent = checkoutItemId
19
+ ? {
20
+ ...baseTrackingEvent,
21
+ checkoutItemId,
22
+ }
23
+ : baseTrackingEvent;
24
+ emitUserEvent(pageViewTrackingEvent);
25
+ }, [checkoutId, checkoutItemId, country, emitUserEvent, page]);
20
26
  };
21
27
  export { usePageView };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [