@lookiero/checkout 0.2.32 → 0.2.33
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/delivery/mock/checkoutDataSource.d.ts +1 -1
- package/dist/infrastructure/delivery/mock/checkoutDataSource.js +1 -1
- package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +10 -0
- package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +11 -0
- package/dist/infrastructure/persistence/asyncStorageStorage.js +1 -1
- package/dist/infrastructure/persistence/storage.d.ts +1 -1
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.js +1 -3
- package/dist/infrastructure/projection/checkout/httpCheckoutByIdView.js +1 -1
- package/dist/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.js +1 -1
- package/dist/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.js +1 -3
- package/dist/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.js +1 -3
- package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +6 -0
- package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +7 -0
- package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +6 -0
- package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +9 -0
- package/dist/infrastructure/projection/uiSetting/storageUiSettingByKeyView.js +1 -1
- package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +10 -6
- package/dist/infrastructure/ui/settings/UISettings.d.ts +1 -1
- package/dist/infrastructure/ui/settings/UISettings.js +1 -1
- package/dist/infrastructure/ui/views/intro/Intro.js +7 -8
- package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +3 -0
- package/dist/infrastructure/ui/views/intro/Intro.style.js +3 -0
- package/dist/infrastructure/ui/views/item/Item.js +3 -6
- package/dist/projection/bookedSizeReplaceableProductVariants/viewBookedSizeReplaceableProductVariantsForCheckoutItem.d.ts +1 -1
- package/dist/projection/checkout/viewCheckoutById.d.ts +1 -1
- package/dist/projection/checkout/viewFirstAvailableCheckoutByCustomerId.d.ts +1 -1
- package/dist/projection/checkoutItem/viewCheckoutItemById.d.ts +1 -1
- package/dist/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.d.ts +1 -1
- package/dist/projection/uiSetting/viewUiSettingByKey.d.ts +1 -1
- package/package.json +1 -1
- package/dist/infrastructure/domain/uiSetting/react/useSetCheckoutIntroShown.d.ts +0 -10
- package/dist/infrastructure/domain/uiSetting/react/useSetCheckoutIntroShown.js +0 -9
- package/dist/infrastructure/projection/uiSetting/react/useViewCheckoutIntroShown.d.ts +0 -2
- package/dist/infrastructure/projection/uiSetting/react/useViewCheckoutIntroShown.js +0 -6
|
@@ -6,7 +6,7 @@ interface CheckoutDataSourceFunctionArgs {
|
|
|
6
6
|
interface CheckoutDataSource {
|
|
7
7
|
readonly getCheckout: () => CheckoutProjection;
|
|
8
8
|
readonly saveCheckout: (checkout: CheckoutProjection) => void;
|
|
9
|
-
readonly getCheckoutItem: (id: string) => CheckoutItemProjection |
|
|
9
|
+
readonly getCheckoutItem: (id: string) => CheckoutItemProjection | null;
|
|
10
10
|
readonly saveCheckoutItem: (checkoutItem: CheckoutItemProjection) => void;
|
|
11
11
|
}
|
|
12
12
|
interface CheckoutDataSourceFunction {
|
|
@@ -4,7 +4,7 @@ const checkoutDataSource = ({ data: initialData }) => {
|
|
|
4
4
|
const saveCheckout = (checkout) => {
|
|
5
5
|
data = checkout;
|
|
6
6
|
};
|
|
7
|
-
const getCheckoutItem = (id) => data.items.find((item) => item.id === id);
|
|
7
|
+
const getCheckoutItem = (id) => data.items.find((item) => item.id === id) || null;
|
|
8
8
|
const saveCheckoutItem = (checkoutItem) => {
|
|
9
9
|
data = { ...data, items: data.items.map((item) => (item.id === checkoutItem.id ? checkoutItem : item)) };
|
|
10
10
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CommandStatus } from "@lookiero/messaging-react";
|
|
2
|
+
interface IncrementIntroShownCountFunction {
|
|
3
|
+
(): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
declare type UseIncrementIntroShownCount = [incrementIntroShownCount: IncrementIntroShownCountFunction, status: CommandStatus];
|
|
6
|
+
interface UseIncrementIntroShownCountFunction {
|
|
7
|
+
(): UseIncrementIntroShownCount;
|
|
8
|
+
}
|
|
9
|
+
declare const useIncrementIntroShownCount: UseIncrementIntroShownCountFunction;
|
|
10
|
+
export { useIncrementIntroShownCount };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { useViewIntroShownCount } from "../../../projection/uiSetting/react/useViewIntroShownCount";
|
|
3
|
+
import { UISettings } from "../../../ui/settings/UISettings";
|
|
4
|
+
import { useUpdateUiSetting } from "./useUpdateUiSetting";
|
|
5
|
+
const useIncrementIntroShownCount = () => {
|
|
6
|
+
const [update, status] = useUpdateUiSetting();
|
|
7
|
+
const [introShownCount] = useViewIntroShownCount();
|
|
8
|
+
const incrementIntroShownCount = useCallback(() => update({ key: UISettings.INTRO_SHOWN_COUNT, value: introShownCount + 1 }), [introShownCount, update]);
|
|
9
|
+
return [incrementIntroShownCount, status];
|
|
10
|
+
};
|
|
11
|
+
export { useIncrementIntroShownCount };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
2
2
|
const read = async (key) => {
|
|
3
3
|
const value = await AsyncStorage.getItem(key);
|
|
4
|
-
return value ? JSON.parse(value) :
|
|
4
|
+
return value ? JSON.parse(value) : null;
|
|
5
5
|
};
|
|
6
6
|
const write = async (key, value) => AsyncStorage.setItem(key, JSON.stringify(value));
|
|
7
7
|
export { read, write };
|
|
@@ -21,8 +21,6 @@ const httpBookedSizeReplaceableProductVariantsForCheckoutItemView = ({ httpPost
|
|
|
21
21
|
body: { checkout_item_id: checkoutItemId },
|
|
22
22
|
signal,
|
|
23
23
|
});
|
|
24
|
-
return response.status === 404
|
|
25
|
-
? undefined
|
|
26
|
-
: toBookedSizeReplaceableProductVariants((await response.json()).result);
|
|
24
|
+
return response.status === 404 ? null : toBookedSizeReplaceableProductVariants((await response.json()).result);
|
|
27
25
|
};
|
|
28
26
|
export { toBookedSizeReplaceableProductVariants, httpBookedSizeReplaceableProductVariantsForCheckoutItemView };
|
|
@@ -5,6 +5,6 @@ const httpCheckoutByIdView = ({ httpPost }) => async ({ checkoutId, signal }) =>
|
|
|
5
5
|
body: { checkout_id: checkoutId },
|
|
6
6
|
signal,
|
|
7
7
|
});
|
|
8
|
-
return !response.ok || response.status === 404 ?
|
|
8
|
+
return !response.ok || response.status === 404 ? null : toCheckoutProjection((await response.json()).result);
|
|
9
9
|
};
|
|
10
10
|
export { httpCheckoutByIdView };
|
package/dist/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.js
CHANGED
|
@@ -5,6 +5,6 @@ const httpFirstAvailableCheckoutByCustomerIdView = ({ httpPost }) => async ({ cu
|
|
|
5
5
|
body: { customer_id: customerId },
|
|
6
6
|
signal,
|
|
7
7
|
});
|
|
8
|
-
return !response.ok || response.status === 404 ?
|
|
8
|
+
return !response.ok || response.status === 404 ? null : toCheckoutProjection((await response.json()).result);
|
|
9
9
|
};
|
|
10
10
|
export { httpFirstAvailableCheckoutByCustomerIdView };
|
|
@@ -5,8 +5,6 @@ const httpCheckoutItemByIdView = ({ httpPost }) => async ({ checkoutItemId, sign
|
|
|
5
5
|
body: { checkout_item_id: checkoutItemId },
|
|
6
6
|
signal,
|
|
7
7
|
});
|
|
8
|
-
return !response.ok || response.status === 404
|
|
9
|
-
? undefined
|
|
10
|
-
: toCheckoutItemProjection((await response.json()).result);
|
|
8
|
+
return !response.ok || response.status === 404 ? null : toCheckoutItemProjection((await response.json()).result);
|
|
11
9
|
};
|
|
12
10
|
export { httpCheckoutItemByIdView };
|
package/dist/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.js
CHANGED
|
@@ -5,8 +5,6 @@ const httpReturnQuestionsByCheckoutItemIdView = ({ httpPost }) => async ({ check
|
|
|
5
5
|
body: { checkout_item_id: checkoutItemId },
|
|
6
6
|
signal,
|
|
7
7
|
});
|
|
8
|
-
return !response.ok || response.status === 404
|
|
9
|
-
? undefined
|
|
10
|
-
: toReturnQuestionsProjection((await response.json()).result);
|
|
8
|
+
return !response.ok || response.status === 404 ? null : toReturnQuestionsProjection((await response.json()).result);
|
|
11
9
|
};
|
|
12
10
|
export { httpReturnQuestionsByCheckoutItemIdView };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useViewIntroShownCount } from "./useViewIntroShownCount";
|
|
2
|
+
const MAX_INTRO_SHOWN_COUNT = 2;
|
|
3
|
+
const useShouldIntroBeShown = () => {
|
|
4
|
+
const [introShownCount, introShownCountStatus] = useViewIntroShownCount();
|
|
5
|
+
return [introShownCount < MAX_INTRO_SHOWN_COUNT, introShownCountStatus];
|
|
6
|
+
};
|
|
7
|
+
export { useShouldIntroBeShown };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UISettings } from "../../../ui/settings/UISettings";
|
|
2
|
+
import { useViewUiSettingByKey } from "./useViewUiSettingByKey";
|
|
3
|
+
const useViewIntroShownCount = () => {
|
|
4
|
+
const [introShownCount, introShownCountStatus] = useViewUiSettingByKey({
|
|
5
|
+
key: UISettings.INTRO_SHOWN_COUNT,
|
|
6
|
+
});
|
|
7
|
+
return [introShownCount?.value || 0, introShownCountStatus];
|
|
8
|
+
};
|
|
9
|
+
export { useViewIntroShownCount };
|
|
@@ -6,7 +6,7 @@ const toUiSettingProjection = (uiSettingDto) => ({
|
|
|
6
6
|
const storageUiSettingByKeyView = ({ read }) => async ({ key }) => {
|
|
7
7
|
try {
|
|
8
8
|
const uiSettingDto = await read(key);
|
|
9
|
-
return uiSettingDto ? toUiSettingProjection(uiSettingDto) :
|
|
9
|
+
return uiSettingDto ? toUiSettingProjection(uiSettingDto) : null;
|
|
10
10
|
}
|
|
11
11
|
catch (ignored) {
|
|
12
12
|
throw new Error("Could not fetch the uiSetting");
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { QueryStatus } from "@lookiero/messaging-react";
|
|
2
|
-
import React from "react";
|
|
2
|
+
import React, { useRef } from "react";
|
|
3
3
|
import { generatePath, Navigate, Outlet, useMatch } from "react-router-native";
|
|
4
4
|
import { CheckoutItemStatus } from "../../../domain/checkoutItem/model/checkoutItem";
|
|
5
5
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
6
|
-
import {
|
|
6
|
+
import { useShouldIntroBeShown } from "../../projection/uiSetting/react/useShouldIntroBeShown";
|
|
7
7
|
import { Spinner } from "../shared/components/atoms/spinner/Spinner";
|
|
8
8
|
import { Routes } from "./routes";
|
|
9
9
|
const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner, null) }) => {
|
|
10
|
-
const
|
|
10
|
+
const introShown = useRef(false);
|
|
11
|
+
const [shouldIntroBeShown, shouldIntroBeShownStatus] = useShouldIntroBeShown();
|
|
11
12
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
12
13
|
const firstItemWithoutCustomerDecision = checkout?.items.find((item) => [CheckoutItemStatus.EXPIRED, CheckoutItemStatus.INITIAL].includes(item.status));
|
|
13
14
|
const introRouteMatch = useMatch(Routes.INTRO);
|
|
14
15
|
const itemRouteMatch = useMatch(Routes.ITEM);
|
|
15
16
|
const summaryRouteMatch = useMatch(Routes.SUMMARY);
|
|
16
17
|
const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
|
|
17
|
-
const dependenciesLoaded = dependenciesLoadedStatuses.includes(
|
|
18
|
+
const dependenciesLoaded = dependenciesLoadedStatuses.includes(shouldIntroBeShownStatus) &&
|
|
18
19
|
dependenciesLoadedStatuses.includes(checkoutStatus);
|
|
19
20
|
if (!dependenciesLoaded) {
|
|
20
21
|
return loader;
|
|
21
22
|
}
|
|
22
|
-
if (!
|
|
23
|
-
if (
|
|
23
|
+
if (shouldIntroBeShown && !introShown.current) {
|
|
24
|
+
if (introRouteMatch) {
|
|
25
|
+
introShown.current = true;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
24
28
|
return React.createElement(Navigate, { to: Routes.INTRO, replace: true });
|
|
25
29
|
}
|
|
26
30
|
}
|
|
@@ -3,9 +3,9 @@ import { Icon } from "@lookiero/aurora-next/build/components/primitives/Icon/Ico
|
|
|
3
3
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
5
|
import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
|
|
6
|
-
import React
|
|
6
|
+
import React from "react";
|
|
7
7
|
import { View } from "react-native";
|
|
8
|
-
import {
|
|
8
|
+
import { useIncrementIntroShownCount } from "../../../domain/uiSetting/react/useIncrementIntroShownCount";
|
|
9
9
|
import { useViewFiveItemsDiscountByCustomerId } from "../../../projection/checkout/react/useViewFiveItemsDiscountByCustomerId";
|
|
10
10
|
import { Body } from "../../components/layouts/body/Body";
|
|
11
11
|
import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
|
|
@@ -23,15 +23,14 @@ const Intro = ({ customerId }) => {
|
|
|
23
23
|
const bulletTwoText = useI18nMessage({ id: I18nMessages.INTRO_BULLET_TWO });
|
|
24
24
|
const bulletThreeText = useI18nMessage({ id: I18nMessages.INTRO_BULLET_THREE });
|
|
25
25
|
const buttonText = useI18nMessage({ id: I18nMessages.INTRO_BUTTON });
|
|
26
|
-
const [fiveItemsDiscount,
|
|
26
|
+
const [fiveItemsDiscount, fiveItemsDiscountStatus] = useViewFiveItemsDiscountByCustomerId({
|
|
27
27
|
customerId,
|
|
28
28
|
});
|
|
29
|
-
const [
|
|
30
|
-
|
|
31
|
-
if (fiveItemsDiscountState === QueryStatus.LOADING)
|
|
29
|
+
const [incrementIntroShownCount, incrementIntroShownCountStatus] = useIncrementIntroShownCount();
|
|
30
|
+
if (fiveItemsDiscountStatus === QueryStatus.LOADING)
|
|
32
31
|
return React.createElement(Spinner, null);
|
|
33
32
|
return (React.createElement(SafeAreaScrollView, null,
|
|
34
|
-
React.createElement(Body,
|
|
33
|
+
React.createElement(Body, { style: { column: style.bodyColumn } },
|
|
35
34
|
React.createElement(View, { style: style.container },
|
|
36
35
|
React.createElement(View, { style: style.content },
|
|
37
36
|
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
@@ -47,6 +46,6 @@ const Intro = ({ customerId }) => {
|
|
|
47
46
|
React.createElement(Bullet, { text: bulletOneText }),
|
|
48
47
|
React.createElement(Bullet, { text: bulletTwoText }),
|
|
49
48
|
React.createElement(Bullet, { text: bulletThreeText }))),
|
|
50
|
-
React.createElement(Button, { disabled:
|
|
49
|
+
React.createElement(Button, { disabled: incrementIntroShownCountStatus === CommandStatus.LOADING, onPress: incrementIntroShownCount }, buttonText)))));
|
|
51
50
|
};
|
|
52
51
|
export { Intro };
|
|
@@ -2,6 +2,9 @@ import { StyleSheet } from "react-native";
|
|
|
2
2
|
import { theme } from "../../theme/theme";
|
|
3
3
|
const { borderSize, colorAccent, spaceXS, spaceS, spaceM, spaceL, spaceXL } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
|
+
bodyColumn: {
|
|
6
|
+
paddingHorizontal: spaceXL,
|
|
7
|
+
},
|
|
5
8
|
bullet: {
|
|
6
9
|
alignItems: "center",
|
|
7
10
|
flexDirection: "row",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QueryStatus } from "@lookiero/messaging-react";
|
|
2
2
|
import React, { useCallback, useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { View } from "react-native";
|
|
4
4
|
import { useParams } from "react-router-native";
|
|
5
5
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
6
6
|
import "../../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
|
|
@@ -34,7 +34,7 @@ const Item = ({ customerId }) => {
|
|
|
34
34
|
const handleOnSubmit = useCallback(() => handleOnHideReturnQuestions(), [handleOnHideReturnQuestions]);
|
|
35
35
|
const handleOnKeep = useCallback(() => void 0, []);
|
|
36
36
|
const handleOnReplace = useCallback(() => void 0, []);
|
|
37
|
-
const handleOnReturn = useCallback(() =>
|
|
37
|
+
const handleOnReturn = useCallback(() => handleOnShowReturnQuestions(), [handleOnShowReturnQuestions]);
|
|
38
38
|
const handleOnBannerPress = useCallback(() => void 0, []);
|
|
39
39
|
const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
|
|
40
40
|
const dependenciesLoaded = dependenciesLoadedStatuses.includes(returnQuestionsStatus) && dependenciesLoadedStatuses.includes(checkoutStatus);
|
|
@@ -56,10 +56,7 @@ const Item = ({ customerId }) => {
|
|
|
56
56
|
React.createElement(ProductVariantSlider, { producVariantMedia: media })),
|
|
57
57
|
React.createElement(ProductVariantDescription, { brand: brand, color: color, name: name, price: price, size: size }),
|
|
58
58
|
Object.entries(feedback).length !== 0 && (React.createElement(View, { style: style.feedbackContainer },
|
|
59
|
-
React.createElement(ReturnQuestionsFeedback, { feedback: feedback, returnQuestions: returnQuestions, onEditFeedback: handleOnEditFeedback }))),
|
|
60
|
-
React.createElement(View, { style: { flexDirection: "row", justifyContent: "center" } },
|
|
61
|
-
React.createElement(TouchableHighlight, { onPress: handleOnShowReturnQuestions },
|
|
62
|
-
React.createElement(Text, { style: { padding: 16 } }, "show return questions")))))),
|
|
59
|
+
React.createElement(ReturnQuestionsFeedback, { feedback: feedback, returnQuestions: returnQuestions, onEditFeedback: handleOnEditFeedback })))))),
|
|
63
60
|
customerDecissionMade && (React.createElement(ItemActions, { size: checkoutItem.productVariant.size, sizes: sizes, onKeep: handleOnKeep, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: handleOnReturn })),
|
|
64
61
|
React.createElement(ReturnQuestionsForm, { checkoutItemPrice: checkoutItem.price, feedback: feedback, productVariant: checkoutItem.productVariant, returnQuestions: returnQuestions, visible: returnQuestionsVisible, onClose: handleOnHideReturnQuestions, onSubmit: handleOnSubmit })));
|
|
65
62
|
};
|
|
@@ -18,7 +18,7 @@ interface ViewBookedSizeReplaceableProductVariantsForCheckoutItemFunction {
|
|
|
18
18
|
(payload: ViewBookedSizeReplaceableProductVariantsForCheckoutItemPayload): ViewBookedSizeReplaceableProductVariantsForCheckoutItem;
|
|
19
19
|
}
|
|
20
20
|
declare const viewBookedSizeReplaceableProductVariantsForCheckoutItem: ViewBookedSizeReplaceableProductVariantsForCheckoutItemFunction;
|
|
21
|
-
declare type ViewBookedSizeReplaceableProductVariantsForCheckoutItemResult = BookedSizeReplaceableProductVariantsProjection |
|
|
21
|
+
declare type ViewBookedSizeReplaceableProductVariantsForCheckoutItemResult = BookedSizeReplaceableProductVariantsProjection | null;
|
|
22
22
|
interface BookedSizeReplaceableProductVariantsForCheckoutItemViewArgs extends CancelableQueryViewArgs {
|
|
23
23
|
readonly checkoutItemId: string;
|
|
24
24
|
}
|
|
@@ -10,7 +10,7 @@ interface ViewCheckoutByIdFunction {
|
|
|
10
10
|
(payload: ViewCheckoutByIdPayload): ViewCheckoutById;
|
|
11
11
|
}
|
|
12
12
|
declare const viewCheckoutById: ViewCheckoutByIdFunction;
|
|
13
|
-
declare type ViewCheckoutByIdResult = CheckoutProjection |
|
|
13
|
+
declare type ViewCheckoutByIdResult = CheckoutProjection | null;
|
|
14
14
|
interface CheckoutByIdViewArgs extends CancelableQueryViewArgs {
|
|
15
15
|
readonly checkoutId: string;
|
|
16
16
|
}
|
|
@@ -10,7 +10,7 @@ interface ViewFirstAvailableCheckoutByCustomerIdFunction {
|
|
|
10
10
|
(payload: ViewFirstAvailableCheckoutByCustomerIdPayload): ViewFirstAvailableCheckoutByCustomerId;
|
|
11
11
|
}
|
|
12
12
|
declare const viewFirstAvailableCheckoutByCustomerId: ViewFirstAvailableCheckoutByCustomerIdFunction;
|
|
13
|
-
declare type ViewFirstAvailableCheckoutByCustomerIdResult = CheckoutProjection |
|
|
13
|
+
declare type ViewFirstAvailableCheckoutByCustomerIdResult = CheckoutProjection | null;
|
|
14
14
|
interface FirstAvailableCheckoutByCustomerIdViewArgs extends CancelableQueryViewArgs {
|
|
15
15
|
readonly customerId: string;
|
|
16
16
|
}
|
|
@@ -10,7 +10,7 @@ interface ViewCheckoutItemByIdFunction {
|
|
|
10
10
|
(payload: ViewCheckoutItemByIdPayload): ViewCheckoutItemById;
|
|
11
11
|
}
|
|
12
12
|
declare const viewCheckoutItemById: ViewCheckoutItemByIdFunction;
|
|
13
|
-
declare type ViewCheckoutItemByIdResult = CheckoutItemProjection |
|
|
13
|
+
declare type ViewCheckoutItemByIdResult = CheckoutItemProjection | null;
|
|
14
14
|
interface CheckoutItemByIdViewArgs extends CancelableQueryViewArgs {
|
|
15
15
|
readonly checkoutItemId: string;
|
|
16
16
|
}
|
|
@@ -10,7 +10,7 @@ interface ListReturnQuestionsByCheckoutItemIdFunction {
|
|
|
10
10
|
(payload: ListReturnQuestionsByCheckoutItemIdPayload): ListReturnQuestionsByCheckoutItemId;
|
|
11
11
|
}
|
|
12
12
|
declare const listReturnQuestionsByCheckoutItemId: ListReturnQuestionsByCheckoutItemIdFunction;
|
|
13
|
-
declare type ListReturnQuestionsByCheckoutItemIdResult = ReturnQuestionProjection[] |
|
|
13
|
+
declare type ListReturnQuestionsByCheckoutItemIdResult = ReturnQuestionProjection[] | null;
|
|
14
14
|
interface ReturnQuestionsByCheckoutItemIdViewArgs extends CancelableQueryViewArgs {
|
|
15
15
|
readonly checkoutItemId: string;
|
|
16
16
|
}
|
|
@@ -14,7 +14,7 @@ interface ViewUiSettingByKeyFunction {
|
|
|
14
14
|
(payload: ViewUiSettingByKeyPayload): ViewUiSettingByKey;
|
|
15
15
|
}
|
|
16
16
|
declare const viewUiSettingByKey: ViewUiSettingByKeyFunction;
|
|
17
|
-
declare type ViewUiSettingByKeyResult = UiSettingProjection |
|
|
17
|
+
declare type ViewUiSettingByKeyResult = UiSettingProjection | null;
|
|
18
18
|
interface UiSettingByKeyViewArgs {
|
|
19
19
|
readonly key: string;
|
|
20
20
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CommandStatus } from "@lookiero/messaging-react";
|
|
2
|
-
interface SetCheckoutIntroShownFunction {
|
|
3
|
-
(): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
declare type UseSetCheckoutIntroShown = [setCheckoutIntroShown: SetCheckoutIntroShownFunction, status: CommandStatus];
|
|
6
|
-
interface UseSetCheckoutIntroShownFunction {
|
|
7
|
-
(): UseSetCheckoutIntroShown;
|
|
8
|
-
}
|
|
9
|
-
declare const useSetCheckoutIntroShown: UseSetCheckoutIntroShownFunction;
|
|
10
|
-
export { useSetCheckoutIntroShown };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { useCallback } from "react";
|
|
2
|
-
import { UISettings } from "../../../ui/settings/UISettings";
|
|
3
|
-
import { useUpdateUiSetting } from "./useUpdateUiSetting";
|
|
4
|
-
const useSetCheckoutIntroShown = () => {
|
|
5
|
-
const [update, status] = useUpdateUiSetting();
|
|
6
|
-
const setCheckoutIntroShown = useCallback(() => update({ key: UISettings.CHECKOUT_INTRO_SHOWN, value: true }), [update]);
|
|
7
|
-
return [setCheckoutIntroShown, status];
|
|
8
|
-
};
|
|
9
|
-
export { useSetCheckoutIntroShown };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { UISettings } from "../../../ui/settings/UISettings";
|
|
2
|
-
import { useViewUiSettingByKey } from "./useViewUiSettingByKey";
|
|
3
|
-
const useViewCheckoutIntroShown = () => useViewUiSettingByKey({
|
|
4
|
-
key: UISettings.CHECKOUT_INTRO_SHOWN,
|
|
5
|
-
});
|
|
6
|
-
export { useViewCheckoutIntroShown };
|