@lookiero/checkout 0.2.15 → 0.2.17
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/README.md +1 -1
- package/dist/infrastructure/domain/checkoutBooking/react/useBookSizeReplaceableProductVariantsForCheckoutItem.d.ts +0 -1
- package/dist/infrastructure/domain/checkoutBooking/react/useBookSizeReplaceableProductVariantsForCheckoutItem.js +0 -1
- package/dist/infrastructure/domain/uiSetting/react/useUpdateUiSetting.d.ts +0 -1
- package/dist/infrastructure/domain/uiSetting/react/useUpdateUiSetting.js +0 -1
- package/dist/infrastructure/projection/checkout/checkout.mock.d.ts +0 -1
- package/dist/infrastructure/projection/checkout/checkout.mock.js +0 -1
- package/dist/infrastructure/projection/checkoutItem/checkoutItem.mock.d.ts +0 -1
- package/dist/infrastructure/projection/checkoutItem/checkoutItem.mock.js +0 -1
- package/dist/infrastructure/ui/components/atoms/modal/Modal.d.ts +7 -0
- package/dist/infrastructure/ui/components/atoms/modal/Modal.js +7 -0
- package/dist/infrastructure/ui/components/atoms/modal/Modal.style.d.ts +21 -0
- package/dist/infrastructure/ui/components/atoms/modal/Modal.style.js +24 -0
- package/dist/infrastructure/ui/i18n/i18n.d.ts +13 -2
- package/dist/infrastructure/ui/i18n/i18n.js +12 -1
- package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +12 -6
- package/dist/infrastructure/ui/views/item/Item.js +5 -1
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.d.ts +8 -0
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +32 -0
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +16 -0
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +19 -0
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +3 -2
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +7 -0
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +23 -0
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +13 -0
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +16 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.d.ts +7 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +23 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.d.ts +13 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.js +16 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useCommand } from "@lookiero/messaging-react";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
|
-
import "react-native-get-random-values";
|
|
4
3
|
import { v4 as uuid } from "uuid";
|
|
5
4
|
import { bookSizeReplaceableProductVariantsForCheckoutItem } from "../../../../domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem";
|
|
6
5
|
const useBookSizeReplaceableProductVariantsForCheckoutItem = ({ checkoutId, checkoutItemId, checkoutBookingId }) => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useCommand } from "@lookiero/messaging-react";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
|
-
import "react-native-get-random-values";
|
|
4
3
|
import { v4 as uuid } from "uuid";
|
|
5
4
|
import { updateUiSetting } from "../../../../domain/uiSetting/command/updateUiSetting";
|
|
6
5
|
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Modal as RNModal, View } from "react-native";
|
|
3
|
+
import { style } from "./Modal.style";
|
|
4
|
+
const Modal = ({ children, visible }) => (React.createElement(RNModal, { transparent: true, visible: visible },
|
|
5
|
+
React.createElement(View, { style: style.centeredView },
|
|
6
|
+
React.createElement(View, { style: style.modalView }, children))));
|
|
7
|
+
export { Modal };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const style: {
|
|
2
|
+
centeredView: {
|
|
3
|
+
flex: number;
|
|
4
|
+
justifyContent: "center";
|
|
5
|
+
backgroundColor: string;
|
|
6
|
+
paddingHorizontal: number;
|
|
7
|
+
};
|
|
8
|
+
modalView: {
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
padding: number;
|
|
11
|
+
shadowColor: string;
|
|
12
|
+
shadowOffset: {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
16
|
+
shadowOpacity: number;
|
|
17
|
+
shadowRadius: number;
|
|
18
|
+
elevation: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export { style };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "../../../theme/theme";
|
|
3
|
+
const { colorBase, colorContent, colorOverlay, spaceXL } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
centeredView: {
|
|
6
|
+
flex: 1,
|
|
7
|
+
justifyContent: "center",
|
|
8
|
+
backgroundColor: colorOverlay,
|
|
9
|
+
paddingHorizontal: spaceXL,
|
|
10
|
+
},
|
|
11
|
+
modalView: {
|
|
12
|
+
backgroundColor: colorBase,
|
|
13
|
+
padding: spaceXL,
|
|
14
|
+
shadowColor: colorContent,
|
|
15
|
+
shadowOffset: {
|
|
16
|
+
width: 0,
|
|
17
|
+
height: 2,
|
|
18
|
+
},
|
|
19
|
+
shadowOpacity: 0.25,
|
|
20
|
+
shadowRadius: 4,
|
|
21
|
+
elevation: 5,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
export { style };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
declare const COLOR_I18N_PREFIX = "color.";
|
|
1
2
|
declare enum I18nMessages {
|
|
2
3
|
INTRO_TITLE = "intro.title",
|
|
3
4
|
INTRO_SUBTITLE = "intro.subtitle",
|
|
@@ -15,6 +16,16 @@ declare enum I18nMessages {
|
|
|
15
16
|
ITEM_BANNER_CUSTOMER_KEPT_DECISSION = "item.banner_customer_kept_decission",
|
|
16
17
|
ITEM_BANNER_CUSTOMER_REPLACED_DECISSION = "item.banner_customer_replaced_decission",
|
|
17
18
|
ITEM_BANNER_CUSTOMER_RETURNED_DECISSION = "item.banner_customer_returned_decission",
|
|
18
|
-
ITEM_BANNER_BUTTON = "item.banner_button"
|
|
19
|
+
ITEM_BANNER_BUTTON = "item.banner_button",
|
|
20
|
+
SIZE_CHANGE_MODAL_TITLE = "size_change_modal.title",
|
|
21
|
+
SIZE_CHANGE_MODAL_DESCRIPTION = "size_change_modal.description",
|
|
22
|
+
SIZE_CHANGE_MODAL_BUTTON = "size_change_modal.button",
|
|
23
|
+
SIZE_WITHOUT_STOCK_MODAL_TITLE = "size_without_stock_modal.title",
|
|
24
|
+
SIZE_WITHOUT_STOCK_MODAL_DESCRIPTION = "size_without_stock_modal.description",
|
|
25
|
+
SIZE_WITHOUT_STOCK_MODAL_BUTTON = "size_without_stock_modal.button",
|
|
26
|
+
GET_OUT_OF_CHECKOUT_MODAL_TITLE = "get_out_of_checkout_modal.title",
|
|
27
|
+
GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION = "get_out_of_checkout_modal.description",
|
|
28
|
+
GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON = "get_out_of_checkout_modal.dismiss_button",
|
|
29
|
+
GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON = "get_out_of_checkout_modal.confirm_button"
|
|
19
30
|
}
|
|
20
|
-
export { I18nMessages };
|
|
31
|
+
export { I18nMessages, COLOR_I18N_PREFIX };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const COLOR_I18N_PREFIX = "color.";
|
|
1
2
|
var I18nMessages;
|
|
2
3
|
(function (I18nMessages) {
|
|
3
4
|
I18nMessages["INTRO_TITLE"] = "intro.title";
|
|
@@ -17,5 +18,15 @@ var I18nMessages;
|
|
|
17
18
|
I18nMessages["ITEM_BANNER_CUSTOMER_REPLACED_DECISSION"] = "item.banner_customer_replaced_decission";
|
|
18
19
|
I18nMessages["ITEM_BANNER_CUSTOMER_RETURNED_DECISSION"] = "item.banner_customer_returned_decission";
|
|
19
20
|
I18nMessages["ITEM_BANNER_BUTTON"] = "item.banner_button";
|
|
21
|
+
I18nMessages["SIZE_CHANGE_MODAL_TITLE"] = "size_change_modal.title";
|
|
22
|
+
I18nMessages["SIZE_CHANGE_MODAL_DESCRIPTION"] = "size_change_modal.description";
|
|
23
|
+
I18nMessages["SIZE_CHANGE_MODAL_BUTTON"] = "size_change_modal.button";
|
|
24
|
+
I18nMessages["SIZE_WITHOUT_STOCK_MODAL_TITLE"] = "size_without_stock_modal.title";
|
|
25
|
+
I18nMessages["SIZE_WITHOUT_STOCK_MODAL_DESCRIPTION"] = "size_without_stock_modal.description";
|
|
26
|
+
I18nMessages["SIZE_WITHOUT_STOCK_MODAL_BUTTON"] = "size_without_stock_modal.button";
|
|
27
|
+
I18nMessages["GET_OUT_OF_CHECKOUT_MODAL_TITLE"] = "get_out_of_checkout_modal.title";
|
|
28
|
+
I18nMessages["GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION"] = "get_out_of_checkout_modal.description";
|
|
29
|
+
I18nMessages["GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON"] = "get_out_of_checkout_modal.dismiss_button";
|
|
30
|
+
I18nMessages["GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON"] = "get_out_of_checkout_modal.confirm_button";
|
|
20
31
|
})(I18nMessages || (I18nMessages = {}));
|
|
21
|
-
export { I18nMessages };
|
|
32
|
+
export { I18nMessages, COLOR_I18N_PREFIX };
|
|
@@ -10,9 +10,9 @@ const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner,
|
|
|
10
10
|
const [checkoutIntroShown, checkoutIntroShownStatus] = useViewCheckoutIntroShown();
|
|
11
11
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
12
12
|
const firstItemWithoutCustomerDecision = checkout?.items.find((item) => [CheckoutItemStatus.EXPIRED, CheckoutItemStatus.INITIAL].includes(item.status));
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
13
|
+
const introRouteMatch = useMatch(Routes.INTRO);
|
|
14
|
+
const itemRouteMatch = useMatch(Routes.ITEM);
|
|
15
|
+
const summaryRouteMatch = useMatch(Routes.SUMMARY);
|
|
16
16
|
const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
|
|
17
17
|
const dependenciesLoaded = dependenciesLoadedStatuses.includes(checkoutIntroShownStatus) &&
|
|
18
18
|
dependenciesLoadedStatuses.includes(checkoutStatus);
|
|
@@ -20,15 +20,21 @@ const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner,
|
|
|
20
20
|
return loader;
|
|
21
21
|
}
|
|
22
22
|
if (!checkoutIntroShown) {
|
|
23
|
-
if (!
|
|
23
|
+
if (!introRouteMatch) {
|
|
24
24
|
return React.createElement(Navigate, { replace: true, to: Routes.INTRO });
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
if (
|
|
28
|
+
if (itemRouteMatch) {
|
|
29
|
+
const checkoutItem = checkout?.items.find((item) => item.id === itemRouteMatch.params.id);
|
|
30
|
+
if (!checkoutItem) {
|
|
31
|
+
return React.createElement(Navigate, { replace: true, to: Routes.CHECKOUT });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (firstItemWithoutCustomerDecision && !itemRouteMatch) {
|
|
29
35
|
return React.createElement(Navigate, { replace: true, to: generatePath(Routes.ITEM, { id: firstItemWithoutCustomerDecision.id }) });
|
|
30
36
|
}
|
|
31
|
-
if (firstItemWithoutCustomerDecision === undefined && !
|
|
37
|
+
if (firstItemWithoutCustomerDecision === undefined && !summaryRouteMatch) {
|
|
32
38
|
return React.createElement(Navigate, { replace: true, to: Routes.SUMMARY });
|
|
33
39
|
}
|
|
34
40
|
}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
import { QueryStatus } from "@lookiero/messaging-react";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { SafeAreaView, ScrollView, View } from "react-native";
|
|
3
4
|
import { useParams } from "react-router-native";
|
|
4
5
|
import "../../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
|
|
5
6
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
7
|
+
import { Spinner } from "../../components/atoms/spinner/Spinner";
|
|
6
8
|
import { Body } from "../../components/layouts/body/Body";
|
|
7
9
|
import { style } from "./Item.style";
|
|
8
10
|
import { ProductVariantDescription } from "./components/productVariantDescription/ProductVariantDescription";
|
|
9
11
|
import { ProductVariantSlider } from "./components/productVariantSlider/ProductVariantSlider";
|
|
10
12
|
const Item = ({ customerId }) => {
|
|
11
13
|
const { id } = useParams();
|
|
12
|
-
const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
14
|
+
const [checkout, status] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
15
|
+
if (status === QueryStatus.LOADING)
|
|
16
|
+
return React.createElement(Spinner, null);
|
|
13
17
|
const checkoutItem = checkout?.items.find((checkoutItem) => checkoutItem.id === id);
|
|
14
18
|
const { media, brand, name, price, size, color } = checkoutItem?.productVariant;
|
|
15
19
|
return (React.createElement(SafeAreaView, { style: style.container },
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
interface GetOutOfCheckoutModalProps {
|
|
3
|
+
readonly visible: boolean;
|
|
4
|
+
readonly onDismiss: () => void;
|
|
5
|
+
readonly onConfirm: () => void;
|
|
6
|
+
}
|
|
7
|
+
declare const GetOutOfCheckoutModal: FC<GetOutOfCheckoutModalProps>;
|
|
8
|
+
export { GetOutOfCheckoutModal };
|
package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
|
|
2
|
+
import { BUTTON_VARIANT } from "@lookiero/aurora-next/build/components/atoms/Button/Button.definition";
|
|
3
|
+
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
4
|
+
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { Modal } from "../../../../components/atoms/modal/Modal";
|
|
7
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
8
|
+
import { style } from "./GetOutOfCheckoutModal.style";
|
|
9
|
+
const GetOutOfCheckoutModal = ({ visible, onDismiss, onConfirm }) => {
|
|
10
|
+
const titleText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_TITLE });
|
|
11
|
+
const descriptionText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION });
|
|
12
|
+
const dismissButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON });
|
|
13
|
+
const confirmButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON });
|
|
14
|
+
return (React.createElement(Modal, { visible: visible },
|
|
15
|
+
React.createElement(Text, { body: true, level: 1, style: style.modalTitle }, titleText),
|
|
16
|
+
React.createElement(Text, { body: true, level: 3, style: style.modalDescription }, descriptionText),
|
|
17
|
+
React.createElement(Button
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
, {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
style: style.button, onPress: onDismiss }, dismissButtonText),
|
|
24
|
+
React.createElement(Button
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
, {
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
style: [style.button, style.confirmButton], variant: BUTTON_VARIANT.SECONDARY, onPress: onConfirm }, confirmButtonText)));
|
|
31
|
+
};
|
|
32
|
+
export { GetOutOfCheckoutModal };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const style: {
|
|
2
|
+
modalTitle: {
|
|
3
|
+
textAlign: "center";
|
|
4
|
+
};
|
|
5
|
+
modalDescription: {
|
|
6
|
+
marginVertical: number;
|
|
7
|
+
textAlign: "center";
|
|
8
|
+
};
|
|
9
|
+
button: {
|
|
10
|
+
flex: number;
|
|
11
|
+
};
|
|
12
|
+
confirmButton: {
|
|
13
|
+
marginTop: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export { style };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "../../../../theme/theme";
|
|
3
|
+
const { spaceXL } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
modalTitle: {
|
|
6
|
+
textAlign: "center",
|
|
7
|
+
},
|
|
8
|
+
modalDescription: {
|
|
9
|
+
marginVertical: spaceXL,
|
|
10
|
+
textAlign: "center",
|
|
11
|
+
},
|
|
12
|
+
button: {
|
|
13
|
+
flex: 0,
|
|
14
|
+
},
|
|
15
|
+
confirmButton: {
|
|
16
|
+
marginTop: spaceXL,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export { style };
|
|
@@ -3,12 +3,13 @@ import { useI18nMessage } from "@lookiero/i18n-react";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { View } from "react-native";
|
|
5
5
|
import { Price } from "../../../../components/atoms/price/Price";
|
|
6
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
6
|
+
import { COLOR_I18N_PREFIX, I18nMessages } from "../../../../i18n/i18n";
|
|
7
7
|
import { style } from "./ProductVariantDescription.style";
|
|
8
8
|
const ProductVariantDescription = ({ brand, name, price, size, color }) => {
|
|
9
9
|
const sizeText = useI18nMessage({ id: I18nMessages.ITEM_SIZE });
|
|
10
10
|
const colorText = useI18nMessage({ id: I18nMessages.ITEM_COLOR });
|
|
11
11
|
const uniqueText = useI18nMessage({ id: I18nMessages.ITEM_UNIQUE });
|
|
12
|
+
const colorLabel = useI18nMessage({ id: color.label, prefix: COLOR_I18N_PREFIX });
|
|
12
13
|
return (React.createElement(View, { style: style.container },
|
|
13
14
|
React.createElement(Text, { detail: true, level: 3, style: style.brand }, brand),
|
|
14
15
|
React.createElement(Text, { body: true, level: 2, style: style.name }, name),
|
|
@@ -20,6 +21,6 @@ const ProductVariantDescription = ({ brand, name, price, size, color }) => {
|
|
|
20
21
|
React.createElement(Text, { detail: true, level: 2 },
|
|
21
22
|
colorText,
|
|
22
23
|
": ",
|
|
23
|
-
React.createElement(Text, { style: style.text },
|
|
24
|
+
React.createElement(Text, { style: style.text }, colorLabel))));
|
|
24
25
|
};
|
|
25
26
|
export { ProductVariantDescription };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
|
|
2
|
+
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
3
|
+
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Modal } from "../../../../components/atoms/modal/Modal";
|
|
6
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
7
|
+
import { style } from "./SizeChangeModal.style";
|
|
8
|
+
const SizeChangeModal = ({ visible, onDismiss }) => {
|
|
9
|
+
const titleText = useI18nMessage({ id: I18nMessages.SIZE_CHANGE_MODAL_TITLE });
|
|
10
|
+
const descriptionText = useI18nMessage({ id: I18nMessages.SIZE_CHANGE_MODAL_DESCRIPTION });
|
|
11
|
+
const buttonText = useI18nMessage({ id: I18nMessages.SIZE_CHANGE_MODAL_BUTTON });
|
|
12
|
+
return (React.createElement(Modal, { visible: visible },
|
|
13
|
+
React.createElement(Text, { body: true, level: 1, style: style.modalTitle }, titleText),
|
|
14
|
+
React.createElement(Text, { body: true, level: 3, style: style.modalDescription }, descriptionText),
|
|
15
|
+
React.createElement(Button
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
, {
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
style: style.button, onPress: onDismiss }, buttonText)));
|
|
22
|
+
};
|
|
23
|
+
export { SizeChangeModal };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "../../../../theme/theme";
|
|
3
|
+
const { spaceXL } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
modalTitle: {
|
|
6
|
+
textAlign: "center",
|
|
7
|
+
},
|
|
8
|
+
modalDescription: {
|
|
9
|
+
marginVertical: spaceXL,
|
|
10
|
+
textAlign: "center",
|
|
11
|
+
},
|
|
12
|
+
button: {
|
|
13
|
+
flex: 0,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export { style };
|
package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
|
|
2
|
+
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
3
|
+
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Modal } from "../../../../components/atoms/modal/Modal";
|
|
6
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
7
|
+
import { style } from "./SizeWithoutStockModal.style";
|
|
8
|
+
const SizeWithoutStockModal = ({ visible, onDismiss }) => {
|
|
9
|
+
const titleText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_TITLE });
|
|
10
|
+
const descriptionText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_DESCRIPTION });
|
|
11
|
+
const buttonText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_BUTTON });
|
|
12
|
+
return (React.createElement(Modal, { visible: visible },
|
|
13
|
+
React.createElement(Text, { body: true, level: 1, style: style.modalTitle }, titleText),
|
|
14
|
+
React.createElement(Text, { body: true, level: 3, style: style.modalDescription }, descriptionText),
|
|
15
|
+
React.createElement(Button
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
, {
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
style: style.button, onPress: onDismiss }, buttonText)));
|
|
22
|
+
};
|
|
23
|
+
export { SizeWithoutStockModal };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "../../../../theme/theme";
|
|
3
|
+
const { spaceXL } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
modalTitle: {
|
|
6
|
+
textAlign: "center",
|
|
7
|
+
},
|
|
8
|
+
modalDescription: {
|
|
9
|
+
marginVertical: spaceXL,
|
|
10
|
+
textAlign: "center",
|
|
11
|
+
},
|
|
12
|
+
button: {
|
|
13
|
+
flex: 0,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export { style };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.17",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"@lookiero/i18n-react": "^0.8.0",
|
|
28
28
|
"@lookiero/messaging": "^8.0.0",
|
|
29
29
|
"@lookiero/messaging-react": "^8.0.0",
|
|
30
|
-
"react-native-get-random-values": "^1.8.0",
|
|
31
30
|
"react-router-dom": "^6.4.1",
|
|
32
31
|
"react-router-native": "^6.3.0",
|
|
33
32
|
"tiny-invariant": "^1.2.0",
|
|
@@ -37,7 +36,7 @@
|
|
|
37
36
|
"@lookiero/aurora-next": "^3.0.181",
|
|
38
37
|
"react": "^18.0.0",
|
|
39
38
|
"react-dom": "^18.0.0",
|
|
40
|
-
"react-native": "^0.
|
|
39
|
+
"react-native": "^0.70.1",
|
|
41
40
|
"react-native-web": "^0.18.9"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
@@ -50,7 +49,7 @@
|
|
|
50
49
|
"@testing-library/react-hooks": "^8.0.1",
|
|
51
50
|
"@testing-library/react-native": "^11.0.0",
|
|
52
51
|
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
|
|
53
|
-
"@types/jest": "^
|
|
52
|
+
"@types/jest": "^29.1.0",
|
|
54
53
|
"@types/react": "~18.0.0",
|
|
55
54
|
"@types/react-dom": "~18.0.0",
|
|
56
55
|
"@types/react-native": "~0.69.1",
|
|
@@ -67,14 +66,15 @@
|
|
|
67
66
|
"expo": "~46.0.8",
|
|
68
67
|
"expo-status-bar": "~1.4.0",
|
|
69
68
|
"husky": "^8.0.1",
|
|
70
|
-
"jest": "^
|
|
69
|
+
"jest": "^29.1.1",
|
|
71
70
|
"jest-expo": "^46.0.1",
|
|
72
71
|
"jest-mock-extended": "^2.0.7",
|
|
73
72
|
"lint-staged": "^13.0.3",
|
|
74
73
|
"prettier": "^2.7.1",
|
|
75
74
|
"react": "^18.0.0",
|
|
76
75
|
"react-dom": "^18.0.0",
|
|
77
|
-
"react-native": "^0.
|
|
76
|
+
"react-native": "^0.70.1",
|
|
77
|
+
"react-native-get-random-values": "^1.8.0",
|
|
78
78
|
"react-native-web": "^0.18.9",
|
|
79
79
|
"react-test-renderer": "^18.0.0",
|
|
80
80
|
"typescript": "^4.6.3",
|