@lookiero/checkout 12.19.0 → 12.21.0
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/src/ExpoRoot.js +4 -4
- package/dist/src/infrastructure/ui/views/item/Item.js +4 -3
- package/dist/src/infrastructure/ui/views/item/Item.style.d.ts +13 -15
- package/dist/src/infrastructure/ui/views/item/Item.style.js +6 -7
- package/dist/src/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.d.ts +1 -0
- package/dist/src/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js +13 -7
- package/dist/src/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.d.ts +0 -1
- package/dist/src/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.js +2 -6
- package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.d.ts +1 -0
- package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.js +5 -3
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.d.ts +1 -0
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +6 -4
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.style.d.ts +0 -1
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.style.js +2 -6
- package/dist/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.d.ts +1 -0
- package/dist/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.js +2 -2
- package/dist/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.style.d.ts +1 -2
- package/dist/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.style.js +4 -5
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +5 -5
- package/src/ExpoRoot.tsx +4 -4
- package/src/infrastructure/ui/views/item/Item.style.ts +7 -7
- package/src/infrastructure/ui/views/item/Item.tsx +6 -2
- package/src/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.ts +2 -8
- package/src/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.tsx +37 -18
- package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +194 -188
- package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.tsx +7 -1
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.style.ts +2 -7
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +8 -2
- package/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.style.ts +4 -5
- package/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.tsx +4 -1
- package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +585 -567
package/dist/src/ExpoRoot.js
CHANGED
|
@@ -18,7 +18,7 @@ import { root } from "./infrastructure/ui/Root";
|
|
|
18
18
|
import { DOMAIN } from "./infrastructure/ui/i18n/i18n";
|
|
19
19
|
import { Router } from "./infrastructure/ui/routing/router/Router";
|
|
20
20
|
import { VERSION } from "./version";
|
|
21
|
-
const tradename = Tradename.
|
|
21
|
+
const tradename = Tradename.LOOKIERO;
|
|
22
22
|
const theme = themeByTradename({ tradename });
|
|
23
23
|
const locale = Locale.es_ES;
|
|
24
24
|
const subscription = "b";
|
|
@@ -28,8 +28,8 @@ const order = {
|
|
|
28
28
|
coupon: "MYLOOKIERO",
|
|
29
29
|
};
|
|
30
30
|
const customer = {
|
|
31
|
-
customerId: "
|
|
32
|
-
country: Country.
|
|
31
|
+
customerId: "6bf2156d-aa5f-432a-88c9-578e9b6992fa",
|
|
32
|
+
country: Country.ES,
|
|
33
33
|
segment: Segment.WOMEN,
|
|
34
34
|
email: "email@example.com",
|
|
35
35
|
name: "Adèle Léonce Émilie",
|
|
@@ -47,7 +47,7 @@ const apiUrl = Platform.OS !== "web"
|
|
|
47
47
|
? "/local-to-dev"
|
|
48
48
|
: "http://localhost:3004/local-to-dev"
|
|
49
49
|
: "/checkout/api";
|
|
50
|
-
const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
|
|
50
|
+
const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEzMTA4NTY4LCJleHAiOjE3NjAyNjEzNDIsImRpc3BsYXlOYW1lIjoiTWlrZWwiLCJjb3VudHJ5X2NvZGUiOiJFUyIsImFjY2Vzc1ZpYSI6ImVtYWlsIiwic3Vic2NyaXB0aW9uU3RhcnRpbmdEYXRlIjoiMjAyNS0wOS0xMSIsImltcGVyc29uYXRlZCI6ZmFsc2UsInV1aWQiOiJhYjIzN2FiMy1mOWY2LTRiNWItOTNjMi1lNjg3YzJmOTlkMmMiLCJ0cmFkZW5hbWUiOiJMT09LSUVSTyIsImlhdCI6MTc1NzY2OTM0Mn0.mw9E6PLIc0KeXe7AdDcxxJrZZuGATxVoht5jDOlDXrk";
|
|
51
51
|
const getAuthToken = () => Promise.resolve(authToken);
|
|
52
52
|
const externalTranslationsUrl = Platform.OS !== "web"
|
|
53
53
|
? "https://backend-for-user.dev.envs.lookiero.tech/api/v2/translations"
|
|
@@ -29,7 +29,7 @@ const Item = ({ layout: Layout }) => {
|
|
|
29
29
|
const logger = useLogger();
|
|
30
30
|
const navigate = useNavigate();
|
|
31
31
|
const { customer: { customerId, country, segment }, basePath, tradename, } = useStaticInfo();
|
|
32
|
-
const style = useMemo(() => itemStyle(), []);
|
|
32
|
+
const { style, headerHeight, headerWithDoubleHeight } = useMemo(() => itemStyle(), []);
|
|
33
33
|
const screenSize = useScreenSize();
|
|
34
34
|
const isDesktopScreen = screenSize !== "S";
|
|
35
35
|
const { id } = useParams();
|
|
@@ -144,11 +144,12 @@ const Item = ({ layout: Layout }) => {
|
|
|
144
144
|
if (!dependenciesLoaded) {
|
|
145
145
|
return React.createElement(Spinner, { testID: "spinner" });
|
|
146
146
|
}
|
|
147
|
+
const itemHeaderHeight = fiveItemsDiscount !== 0 ? headerWithDoubleHeight : headerHeight;
|
|
147
148
|
return (React.createElement(ReturnQuestionFeedbackProvider, { key: checkoutItem.id, feedback: checkoutItem.feedbacks || {} },
|
|
148
149
|
React.createElement(Layout, { footer: null, header: header, scrollEnabled: !itemWithoutCustomerDecission, style: {
|
|
149
|
-
header:
|
|
150
|
+
header: { height: itemHeaderHeight },
|
|
150
151
|
scrollView: { height: itemWithoutCustomerDecission ? "100%" : "auto" },
|
|
151
152
|
safeAreaView: isDesktopScreen ? style.safeAreaView : null,
|
|
152
|
-
} }, itemWithoutCustomerDecission ? (React.createElement(ItemWithoutCustomerDecission, { bookedProductsVariants: bookedProductsVariants, checkoutId: checkout.id, checkoutItem: checkoutItem, currentProductVariant: currentProductVariant, onReturn: goToReturnPage })) : (React.createElement(ItemWithCustomerDecission, { checkoutId: checkout.id, checkoutItem: checkoutItem, currentProductVariant: currentProductVariant, returnQuestions: returnQuestions, onEditFeedback: goToReturnPage })))));
|
|
153
|
+
} }, itemWithoutCustomerDecission ? (React.createElement(ItemWithoutCustomerDecission, { bookedProductsVariants: bookedProductsVariants, checkoutId: checkout.id, checkoutItem: checkoutItem, currentProductVariant: currentProductVariant, headerHeight: itemHeaderHeight, onReturn: goToReturnPage })) : (React.createElement(ItemWithCustomerDecission, { checkoutId: checkout.id, checkoutItem: checkoutItem, currentProductVariant: currentProductVariant, headerHeight: itemHeaderHeight, returnQuestions: returnQuestions, onEditFeedback: goToReturnPage })))));
|
|
153
154
|
};
|
|
154
155
|
export { Item };
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
declare const style: () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
flexDirection: "column";
|
|
14
|
-
};
|
|
15
|
-
safeAreaView: {
|
|
16
|
-
backgroundColor: string;
|
|
2
|
+
style: {
|
|
3
|
+
fiveItemsDiscountPadding: {
|
|
4
|
+
paddingTop: number;
|
|
5
|
+
};
|
|
6
|
+
headerWrapper: {
|
|
7
|
+
display: "flex";
|
|
8
|
+
flexDirection: "column";
|
|
9
|
+
};
|
|
10
|
+
safeAreaView: {
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
};
|
|
17
13
|
};
|
|
14
|
+
headerHeight: number;
|
|
15
|
+
headerWithDoubleHeight: number;
|
|
18
16
|
};
|
|
19
17
|
export { style };
|
|
@@ -3,16 +3,10 @@ import { theme } from "@lookiero/sty-psp-ui";
|
|
|
3
3
|
import { HEADER_HEIGHT } from "../../components/templates/header/Header.style";
|
|
4
4
|
const style = () => {
|
|
5
5
|
const { colorBgPrimaryLight, space12 } = theme();
|
|
6
|
-
|
|
6
|
+
const style = StyleSheet.create({
|
|
7
7
|
fiveItemsDiscountPadding: {
|
|
8
8
|
paddingTop: space12,
|
|
9
9
|
},
|
|
10
|
-
header: {
|
|
11
|
-
height: HEADER_HEIGHT,
|
|
12
|
-
},
|
|
13
|
-
headerWithDoubleHeight: {
|
|
14
|
-
height: HEADER_HEIGHT * 2,
|
|
15
|
-
},
|
|
16
10
|
headerWrapper: {
|
|
17
11
|
display: "flex",
|
|
18
12
|
flexDirection: "column",
|
|
@@ -21,5 +15,10 @@ const style = () => {
|
|
|
21
15
|
backgroundColor: colorBgPrimaryLight,
|
|
22
16
|
},
|
|
23
17
|
});
|
|
18
|
+
return {
|
|
19
|
+
style,
|
|
20
|
+
headerHeight: HEADER_HEIGHT,
|
|
21
|
+
headerWithDoubleHeight: HEADER_HEIGHT * 2,
|
|
22
|
+
};
|
|
24
23
|
};
|
|
25
24
|
export { style };
|
|
@@ -3,6 +3,7 @@ import { MediaProjection } from "../../../../../../projection/checkoutItem/check
|
|
|
3
3
|
interface ProductVariantSlider {
|
|
4
4
|
readonly producVariantMedia: MediaProjection[];
|
|
5
5
|
readonly onChanged?: (active: number) => void;
|
|
6
|
+
readonly availableHeight: number;
|
|
6
7
|
}
|
|
7
8
|
declare const ProductVariantSlider: FC<ProductVariantSlider>;
|
|
8
9
|
export { ProductVariantSlider };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useState } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
2
3
|
import { AspectRatioView, Bullets, Carousel, LazyImage, useScreenSize, } from "@lookiero/sty-psp-ui";
|
|
3
4
|
import { MediaPerspective } from "../../../../../../projection/checkoutItem/checkoutItem";
|
|
4
5
|
import { useMediaImage } from "../../../../hooks/useMediaImage";
|
|
5
6
|
import { style as productVariantSliderStyle } from "./ProductVariantSlider.style";
|
|
6
|
-
const ProductVariantSlider = ({ producVariantMedia, onChanged }) => {
|
|
7
|
+
const ProductVariantSlider = ({ producVariantMedia, onChanged, availableHeight }) => {
|
|
7
8
|
const cdnImageUrl = useMediaImage();
|
|
8
9
|
const screenSize = useScreenSize();
|
|
9
10
|
const isDesktopScreen = screenSize !== "S";
|
|
@@ -13,23 +14,28 @@ const ProductVariantSlider = ({ producVariantMedia, onChanged }) => {
|
|
|
13
14
|
setActiveIndex(activeIndex);
|
|
14
15
|
onChanged?.(activeIndex);
|
|
15
16
|
}, [onChanged]);
|
|
17
|
+
const [width, setWidth] = useState(0);
|
|
18
|
+
const handleOnLayout = useCallback(({ nativeEvent: { layout: { width }, }, }) => setWidth(width), []);
|
|
19
|
+
const aspectRatio = Math.min(4 / 3, availableHeight / width);
|
|
16
20
|
const renderItem = useCallback(({ item, index }) => {
|
|
17
21
|
const isCollageImage = item.perspective === MediaPerspective.COLLAGE;
|
|
18
22
|
const isLastItem = index === producVariantMedia.length - 1;
|
|
19
|
-
return (React.createElement(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
return (React.createElement(View, { onLayout: handleOnLayout },
|
|
24
|
+
React.createElement(AspectRatioView, { aspectRatio: aspectRatio, multiplier: isCollageImage && isLastItem ? 2 : 1, style: {
|
|
25
|
+
alignSelf: isCollageImage ? (isLastItem ? "flex-end" : "flex-start") : undefined,
|
|
26
|
+
} },
|
|
27
|
+
React.createElement(LazyImage, { hiResSrc: cdnImageUrl({ url: item.url, width: 600 }), resizeMode: isCollageImage ? "stretch" : "contain", src: cdnImageUrl({ url: item.url, width: 600, dpi: 1 }), style: { view: [style.image, isDesktopScreen ? style.largeImage : null] }, testID: "product-variant-image" }))));
|
|
24
28
|
}, [
|
|
29
|
+
aspectRatio,
|
|
25
30
|
cdnImageUrl,
|
|
31
|
+
handleOnLayout,
|
|
26
32
|
isDesktopScreen,
|
|
27
33
|
producVariantMedia.length,
|
|
28
34
|
style.image,
|
|
29
|
-
style.imageContainerMarginTop,
|
|
30
35
|
style.largeImage,
|
|
31
36
|
]);
|
|
32
37
|
const renderBullets = useCallback(({ activeIndex, count, onChange }) => React.createElement(Bullets, { activeIndex: activeIndex, count: count, onChange: onChange }), []);
|
|
38
|
+
console.log({ producVariantMedia });
|
|
33
39
|
return (React.createElement(Carousel, { activeIndex: activeIndex, bullets: renderBullets, data: producVariantMedia, onActiveIndexChanged: handleOnActiveChanged }, renderItem));
|
|
34
40
|
};
|
|
35
41
|
export { ProductVariantSlider };
|
|
@@ -2,8 +2,8 @@ import { StyleSheet } from "react-native";
|
|
|
2
2
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
3
|
const PAGINATION_SIZE = 37;
|
|
4
4
|
const style = () => {
|
|
5
|
-
const { borderRadius4, colorBgBase, colorBgPrimaryMediumLight, colorBorderActionSecondary, space4
|
|
6
|
-
|
|
5
|
+
const { borderRadius4, colorBgBase, colorBgPrimaryMediumLight, colorBorderActionSecondary, space4 } = theme();
|
|
6
|
+
return StyleSheet.create({
|
|
7
7
|
image: {
|
|
8
8
|
flex: 1,
|
|
9
9
|
},
|
|
@@ -30,9 +30,5 @@ const style = () => {
|
|
|
30
30
|
position: "relative",
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
|
-
return {
|
|
34
|
-
...styles,
|
|
35
|
-
imageContainerMarginTop: space16,
|
|
36
|
-
};
|
|
37
33
|
};
|
|
38
34
|
export { style };
|
|
@@ -12,6 +12,7 @@ interface ItemWithCustomerDecissionProps {
|
|
|
12
12
|
readonly returnQuestions: ReturnQuestionProjection[];
|
|
13
13
|
readonly currentProductVariant: ProductVariantProjection;
|
|
14
14
|
readonly onEditFeedback: () => void;
|
|
15
|
+
readonly headerHeight: number;
|
|
15
16
|
}
|
|
16
17
|
declare const ItemWithCustomerDecission: FC<ItemWithCustomerDecissionProps>;
|
|
17
18
|
export type { CheckoutItemWithCustomerDecission };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from "react";
|
|
2
|
-
import { View } from "react-native";
|
|
2
|
+
import { useWindowDimensions, View } from "react-native";
|
|
3
3
|
import { Spinner } from "@lookiero/aurora";
|
|
4
4
|
import { CommandStatus } from "@lookiero/messaging-react";
|
|
5
5
|
import { useLogger } from "@lookiero/sty-psp-logging";
|
|
@@ -14,8 +14,9 @@ import { CustomerDecissionBanner, } from "../../components/banner/CustomerDeciss
|
|
|
14
14
|
import { ReturnQuestionsFeedback } from "../../components/returnQuestionsFeedback/ReturnQuestionsFeedback";
|
|
15
15
|
import { ProductVariant } from "../../views/productVariant/ProductVariant";
|
|
16
16
|
import { style as itemWithCustomerDecissionStyle } from "./ItemWithCustomerDecission.style";
|
|
17
|
-
const ItemWithCustomerDecission = ({ checkoutId, checkoutItem, returnQuestions, currentProductVariant, onEditFeedback, }) => {
|
|
17
|
+
const ItemWithCustomerDecission = ({ checkoutId, checkoutItem, returnQuestions, currentProductVariant, onEditFeedback, headerHeight, }) => {
|
|
18
18
|
const style = useMemo(() => itemWithCustomerDecissionStyle(), []);
|
|
19
|
+
const { height } = useWindowDimensions();
|
|
19
20
|
const screenSize = useScreenSize();
|
|
20
21
|
const isMobile = screenSize === "S";
|
|
21
22
|
const logger = useLogger();
|
|
@@ -42,8 +43,9 @@ const ItemWithCustomerDecission = ({ checkoutId, checkoutItem, returnQuestions,
|
|
|
42
43
|
if (!dependenciesLoaded) {
|
|
43
44
|
return React.createElement(Spinner, { testID: "spinner" });
|
|
44
45
|
}
|
|
46
|
+
const sliderAvailableHeight = height - headerHeight;
|
|
45
47
|
return (React.createElement(Body, { style: { row: style.container } },
|
|
46
|
-
React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, segment: segment, tradename: tradename, customerDecissionBanner: React.createElement(CustomerDecissionBanner, { checkoutItemStatus: checkoutItem.status, onPress: resetItem }) }, checkoutItem.status === CheckoutItemStatus.RETURNED && (React.createElement(View, { style: [style.feedbackContainer, isMobile ? style.feedbackContainerMobile : undefined] },
|
|
48
|
+
React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, segment: segment, sliderAvailableHeight: sliderAvailableHeight, tradename: tradename, customerDecissionBanner: React.createElement(CustomerDecissionBanner, { checkoutItemStatus: checkoutItem.status, onPress: resetItem }) }, checkoutItem.status === CheckoutItemStatus.RETURNED && (React.createElement(View, { style: [style.feedbackContainer, isMobile ? style.feedbackContainerMobile : undefined] },
|
|
47
49
|
React.createElement(ReturnQuestionsFeedback, { returnQuestions: returnQuestions, onEditFeedback: onEditFeedback }))))));
|
|
48
50
|
};
|
|
49
51
|
export { ItemWithCustomerDecission };
|
|
@@ -12,6 +12,7 @@ interface ItemWithoutCustomerDecissionProps {
|
|
|
12
12
|
readonly bookedProductsVariants: BookedProductsVariantsProjection;
|
|
13
13
|
readonly currentProductVariant: ProductVariantProjection;
|
|
14
14
|
readonly onReturn: () => void;
|
|
15
|
+
readonly headerHeight: number;
|
|
15
16
|
}
|
|
16
17
|
declare const ItemWithoutCustomerDecission: FC<ItemWithoutCustomerDecissionProps>;
|
|
17
18
|
export type { CheckoutItemWithoutCustomerDecission };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useState } from "react";
|
|
2
|
-
import { Platform, ScrollView } from "react-native";
|
|
2
|
+
import { Platform, ScrollView, useWindowDimensions } from "react-native";
|
|
3
3
|
import { Spinner } from "@lookiero/aurora";
|
|
4
4
|
import { CommandStatus } from "@lookiero/messaging-react";
|
|
5
5
|
import { useLogger } from "@lookiero/sty-psp-logging";
|
|
@@ -15,10 +15,11 @@ import { ItemActions } from "../../components/itemActions/ItemActions";
|
|
|
15
15
|
import { SizeWithoutStockModal } from "../../components/sizeWithoutStockModal/SizeWithoutStockModal";
|
|
16
16
|
import { ProductVariant } from "../productVariant/ProductVariant";
|
|
17
17
|
import { style as itemWithoutCustomerDecissionStyle } from "./ItemWithoutCustomerDecission.style";
|
|
18
|
-
const ItemWithoutCustomerDecission = ({ checkoutId, checkoutItem, bookedProductsVariants, currentProductVariant, onReturn, }) => {
|
|
18
|
+
const ItemWithoutCustomerDecission = ({ checkoutId, checkoutItem, bookedProductsVariants, currentProductVariant, onReturn, headerHeight, }) => {
|
|
19
19
|
const logger = useLogger();
|
|
20
20
|
const { customer: { country, segment }, tradename, } = useStaticInfo();
|
|
21
21
|
const style = useMemo(() => itemWithoutCustomerDecissionStyle(), []);
|
|
22
|
+
const { height } = useWindowDimensions();
|
|
22
23
|
/* KeepCheckoutItem */
|
|
23
24
|
const [keepCheckoutItem, keepCheckoutItemStatus] = useKeepCheckoutItem({ checkoutItemId: checkoutItem.id, logger });
|
|
24
25
|
const trackKeepItem = useTrackKeepItem({
|
|
@@ -62,12 +63,13 @@ const ItemWithoutCustomerDecission = ({ checkoutId, checkoutItem, bookedProducts
|
|
|
62
63
|
if (!dependenciesLoaded) {
|
|
63
64
|
return React.createElement(Spinner, { testID: "spinner" });
|
|
64
65
|
}
|
|
66
|
+
const sliderAvailableHeight = height - headerHeight - stickyHeight;
|
|
65
67
|
return (React.createElement(React.Fragment, null,
|
|
66
68
|
React.createElement(SizeWithoutStockModal, { visible: sizeWithoutStockModalVisible, onDismiss: handleOnHideSizeWithoutStockModal }),
|
|
67
69
|
React.createElement(ScrollView, { showsVerticalScrollIndicator: false, testID: checkoutItem.id },
|
|
68
70
|
React.createElement(Body, { style: { row: style.container } },
|
|
69
|
-
React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, segment: segment, tradename: tradename, style: {
|
|
70
|
-
content: { paddingBottom: Platform.OS === "web" ?
|
|
71
|
+
React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, segment: segment, sliderAvailableHeight: sliderAvailableHeight, tradename: tradename, style: {
|
|
72
|
+
content: { paddingBottom: Platform.OS === "web" ? 0 : stickyHeight },
|
|
71
73
|
} }))),
|
|
72
74
|
React.createElement(ItemActions, { country: country, currentProductVariant: currentProductVariant, productVariants: bookedProductsVariants?.productVariants, onKeep: handleOnKeep, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: onReturn, onShowSizeWithoutStockModal: handleOnShowSizeWithoutStockModal })));
|
|
73
75
|
};
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
3
|
const style = () => {
|
|
4
|
-
const {
|
|
5
|
-
|
|
4
|
+
const { space10 } = theme();
|
|
5
|
+
return StyleSheet.create({
|
|
6
6
|
container: {
|
|
7
7
|
paddingBottom: space10,
|
|
8
8
|
paddingHorizontal: 0,
|
|
9
9
|
},
|
|
10
10
|
});
|
|
11
|
-
return {
|
|
12
|
-
...styles,
|
|
13
|
-
productVariantPaddingBottom: space6,
|
|
14
|
-
};
|
|
15
11
|
};
|
|
16
12
|
export { style };
|
|
@@ -16,6 +16,7 @@ interface ProductVariantProps {
|
|
|
16
16
|
readonly style?: Partial<Record<ProductVariantStyle, StyleProp<ViewStyle>>>;
|
|
17
17
|
readonly children?: ReactNode;
|
|
18
18
|
readonly customerDecissionBanner?: ReactNode;
|
|
19
|
+
readonly sliderAvailableHeight: number;
|
|
19
20
|
}
|
|
20
21
|
declare const ProductVariant: FC<ProductVariantProps>;
|
|
21
22
|
export { ProductVariant };
|
|
@@ -7,7 +7,7 @@ import { useTrackImageView } from "../../../../../tracking/useTrackImageView";
|
|
|
7
7
|
import { ProductVariantDescription } from "../../components/productVariantDescription/ProductVariantDescription";
|
|
8
8
|
import { ProductVariantSlider } from "../../components/productVariantSlider/ProductVariantSlider";
|
|
9
9
|
import { style as productVariantStyle } from "./ProductVariant.style";
|
|
10
|
-
const ProductVariant = ({ tradename, country, segment, checkoutId, checkoutItem, currentProductVariant, style: customStyle, children, customerDecissionBanner, }) => {
|
|
10
|
+
const ProductVariant = ({ tradename, country, segment, checkoutId, checkoutItem, currentProductVariant, style: customStyle, children, customerDecissionBanner, sliderAvailableHeight, }) => {
|
|
11
11
|
const screenSize = useScreenSize();
|
|
12
12
|
const isDesktopScreen = screenSize !== "S";
|
|
13
13
|
const style = useMemo(() => productVariantStyle(), []);
|
|
@@ -28,7 +28,7 @@ const ProductVariant = ({ tradename, country, segment, checkoutId, checkoutItem,
|
|
|
28
28
|
const { media, brand, name } = checkoutItem.productVariant;
|
|
29
29
|
const collage = media.find((m) => m.perspective === MediaPerspective.COLLAGE);
|
|
30
30
|
return (React.createElement(View, { style: [style.container, isDesktopScreen ? style.largeContainer : null], testID: "product-variant" },
|
|
31
|
-
React.createElement(ProductVariantSlider, { producVariantMedia: collage ? [...media, collage] : media, onChanged: handleOnChangedProductVariantSlider }),
|
|
31
|
+
React.createElement(ProductVariantSlider, { availableHeight: sliderAvailableHeight, producVariantMedia: collage ? [...media, { ...collage, id: `${collage.id}-collage` }] : media, onChanged: handleOnChangedProductVariantSlider }),
|
|
32
32
|
React.createElement(View, { style: [style.content, customStyle?.content] },
|
|
33
33
|
customerDecissionBanner,
|
|
34
34
|
React.createElement(ProductVariantDescription, { brand: brand, country: country, name: name, price: price, size: currentProductVariant.size }),
|
package/dist/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.style.d.ts
CHANGED
|
@@ -3,13 +3,12 @@ declare const style: () => {
|
|
|
3
3
|
backgroundColor: string;
|
|
4
4
|
};
|
|
5
5
|
content: {
|
|
6
|
-
|
|
6
|
+
paddingTop: number;
|
|
7
7
|
};
|
|
8
8
|
largeContainer: {
|
|
9
9
|
borderRadius: number;
|
|
10
10
|
marginTop: number;
|
|
11
11
|
padding: number;
|
|
12
|
-
paddingBottom: number;
|
|
13
12
|
};
|
|
14
13
|
};
|
|
15
14
|
export { style };
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
3
|
const style = () => {
|
|
4
|
-
const { space6,
|
|
4
|
+
const { space6, space8, colorBgBase, borderRadius4 } = theme();
|
|
5
5
|
return StyleSheet.create({
|
|
6
6
|
container: {
|
|
7
7
|
backgroundColor: colorBgBase,
|
|
8
8
|
},
|
|
9
9
|
content: {
|
|
10
|
-
|
|
10
|
+
paddingTop: space6,
|
|
11
11
|
},
|
|
12
12
|
largeContainer: {
|
|
13
13
|
borderRadius: borderRadius4,
|
|
14
|
-
marginTop:
|
|
15
|
-
padding:
|
|
16
|
-
paddingBottom: 0,
|
|
14
|
+
marginTop: space8,
|
|
15
|
+
padding: space8,
|
|
17
16
|
},
|
|
18
17
|
});
|
|
19
18
|
};
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "12.
|
|
1
|
+
export declare const VERSION = "12.21.0";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "12.
|
|
1
|
+
export const VERSION = "12.21.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.21.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": "false",
|
|
@@ -26,18 +26,18 @@
|
|
|
26
26
|
"@lookiero/sty-psp-http": "^2.1",
|
|
27
27
|
"@lookiero/sty-psp-i18n": "^1.3",
|
|
28
28
|
"@lookiero/sty-psp-locale": "^1.0",
|
|
29
|
-
"@lookiero/sty-psp-logging": "^
|
|
30
|
-
"@lookiero/sty-psp-notifications": "^2.
|
|
29
|
+
"@lookiero/sty-psp-logging": "^2.0",
|
|
30
|
+
"@lookiero/sty-psp-notifications": "^2.10",
|
|
31
31
|
"@lookiero/sty-psp-react-native": "^1.0",
|
|
32
32
|
"@lookiero/sty-psp-segment": "^0.1",
|
|
33
33
|
"@lookiero/sty-psp-storage": "^0.2",
|
|
34
34
|
"@lookiero/sty-psp-tracking": "^2.1",
|
|
35
|
-
"@lookiero/sty-psp-ui-settings": "^1.
|
|
35
|
+
"@lookiero/sty-psp-ui-settings": "^1.2",
|
|
36
36
|
"@lookiero/sty-psp-ui": "^3.0",
|
|
37
37
|
"@lookiero/sty-psp-units": "^0.1",
|
|
38
38
|
"@lookiero/sty-psp-uuid": "^0.2",
|
|
39
39
|
"@lookiero/sty-sp-tradename": "^1.0",
|
|
40
|
-
"@sentry/react-native": "^
|
|
40
|
+
"@sentry/react-native": "^7.3.0",
|
|
41
41
|
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
|
42
42
|
"react-native-svg": "15.8.0",
|
|
43
43
|
"tiny-invariant": "^1.3.1"
|
package/src/ExpoRoot.tsx
CHANGED
|
@@ -25,7 +25,7 @@ import { OrderProjection } from "./projection/order/order";
|
|
|
25
25
|
import { SubscriptionProjection } from "./projection/subscription/subscription";
|
|
26
26
|
import { VERSION } from "./version";
|
|
27
27
|
|
|
28
|
-
const tradename = Tradename.
|
|
28
|
+
const tradename = Tradename.LOOKIERO;
|
|
29
29
|
const theme = themeByTradename({ tradename });
|
|
30
30
|
const locale: Locale = Locale.es_ES;
|
|
31
31
|
|
|
@@ -37,8 +37,8 @@ const order: OrderProjection = {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
const customer: Customer = {
|
|
40
|
-
customerId: "
|
|
41
|
-
country: Country.
|
|
40
|
+
customerId: "6bf2156d-aa5f-432a-88c9-578e9b6992fa",
|
|
41
|
+
country: Country.ES,
|
|
42
42
|
segment: Segment.WOMEN,
|
|
43
43
|
email: "email@example.com",
|
|
44
44
|
name: "Adèle Léonce Émilie",
|
|
@@ -60,7 +60,7 @@ const apiUrl =
|
|
|
60
60
|
: "http://localhost:3004/local-to-dev"
|
|
61
61
|
: "/checkout/api";
|
|
62
62
|
const authToken =
|
|
63
|
-
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
|
|
63
|
+
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEzMTA4NTY4LCJleHAiOjE3NjAyNjEzNDIsImRpc3BsYXlOYW1lIjoiTWlrZWwiLCJjb3VudHJ5X2NvZGUiOiJFUyIsImFjY2Vzc1ZpYSI6ImVtYWlsIiwic3Vic2NyaXB0aW9uU3RhcnRpbmdEYXRlIjoiMjAyNS0wOS0xMSIsImltcGVyc29uYXRlZCI6ZmFsc2UsInV1aWQiOiJhYjIzN2FiMy1mOWY2LTRiNWItOTNjMi1lNjg3YzJmOTlkMmMiLCJ0cmFkZW5hbWUiOiJMT09LSUVSTyIsImlhdCI6MTc1NzY2OTM0Mn0.mw9E6PLIc0KeXe7AdDcxxJrZZuGATxVoht5jDOlDXrk";
|
|
64
64
|
const getAuthToken = () => Promise.resolve(authToken);
|
|
65
65
|
|
|
66
66
|
const externalTranslationsUrl =
|
|
@@ -5,16 +5,10 @@ import { HEADER_HEIGHT } from "../../components/templates/header/Header.style";
|
|
|
5
5
|
const style = () => {
|
|
6
6
|
const { colorBgPrimaryLight, space12 } = theme();
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const style = StyleSheet.create({
|
|
9
9
|
fiveItemsDiscountPadding: {
|
|
10
10
|
paddingTop: space12,
|
|
11
11
|
},
|
|
12
|
-
header: {
|
|
13
|
-
height: HEADER_HEIGHT,
|
|
14
|
-
},
|
|
15
|
-
headerWithDoubleHeight: {
|
|
16
|
-
height: HEADER_HEIGHT * 2,
|
|
17
|
-
},
|
|
18
12
|
headerWrapper: {
|
|
19
13
|
display: "flex",
|
|
20
14
|
flexDirection: "column",
|
|
@@ -23,6 +17,12 @@ const style = () => {
|
|
|
23
17
|
backgroundColor: colorBgPrimaryLight,
|
|
24
18
|
},
|
|
25
19
|
});
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
style,
|
|
23
|
+
headerHeight: HEADER_HEIGHT,
|
|
24
|
+
headerWithDoubleHeight: HEADER_HEIGHT * 2,
|
|
25
|
+
};
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
export { style };
|
|
@@ -66,7 +66,7 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
|
|
|
66
66
|
tradename,
|
|
67
67
|
} = useStaticInfo();
|
|
68
68
|
|
|
69
|
-
const style = useMemo(() => itemStyle(), []);
|
|
69
|
+
const { style, headerHeight, headerWithDoubleHeight } = useMemo(() => itemStyle(), []);
|
|
70
70
|
|
|
71
71
|
const screenSize = useScreenSize();
|
|
72
72
|
const isDesktopScreen = screenSize !== "S";
|
|
@@ -223,6 +223,8 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
|
|
|
223
223
|
return <Spinner testID="spinner" />;
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
const itemHeaderHeight = fiveItemsDiscount !== 0 ? headerWithDoubleHeight : headerHeight;
|
|
227
|
+
|
|
226
228
|
return (
|
|
227
229
|
<ReturnQuestionFeedbackProvider key={checkoutItem.id} feedback={checkoutItem.feedbacks || {}}>
|
|
228
230
|
<Layout
|
|
@@ -230,7 +232,7 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
|
|
|
230
232
|
header={header}
|
|
231
233
|
scrollEnabled={!itemWithoutCustomerDecission}
|
|
232
234
|
style={{
|
|
233
|
-
header:
|
|
235
|
+
header: { height: itemHeaderHeight },
|
|
234
236
|
scrollView: { height: itemWithoutCustomerDecission ? "100%" : "auto" },
|
|
235
237
|
safeAreaView: isDesktopScreen ? style.safeAreaView : null,
|
|
236
238
|
}}
|
|
@@ -241,6 +243,7 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
|
|
|
241
243
|
checkoutId={checkout.id}
|
|
242
244
|
checkoutItem={checkoutItem as CheckoutItemWithoutCustomerDecission}
|
|
243
245
|
currentProductVariant={currentProductVariant}
|
|
246
|
+
headerHeight={itemHeaderHeight}
|
|
244
247
|
onReturn={goToReturnPage}
|
|
245
248
|
/>
|
|
246
249
|
) : (
|
|
@@ -248,6 +251,7 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
|
|
|
248
251
|
checkoutId={checkout.id}
|
|
249
252
|
checkoutItem={checkoutItem as CheckoutItemWithCustomerDecission}
|
|
250
253
|
currentProductVariant={currentProductVariant}
|
|
254
|
+
headerHeight={itemHeaderHeight}
|
|
251
255
|
returnQuestions={returnQuestions}
|
|
252
256
|
onEditFeedback={goToReturnPage}
|
|
253
257
|
/>
|
|
@@ -4,10 +4,9 @@ import { theme } from "@lookiero/sty-psp-ui";
|
|
|
4
4
|
const PAGINATION_SIZE = 37;
|
|
5
5
|
|
|
6
6
|
const style = () => {
|
|
7
|
-
const { borderRadius4, colorBgBase, colorBgPrimaryMediumLight, colorBorderActionSecondary, space4
|
|
8
|
-
theme();
|
|
7
|
+
const { borderRadius4, colorBgBase, colorBgPrimaryMediumLight, colorBorderActionSecondary, space4 } = theme();
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
return StyleSheet.create({
|
|
11
10
|
image: {
|
|
12
11
|
flex: 1,
|
|
13
12
|
},
|
|
@@ -34,11 +33,6 @@ const style = () => {
|
|
|
34
33
|
position: "relative",
|
|
35
34
|
},
|
|
36
35
|
});
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
...styles,
|
|
40
|
-
imageContainerMarginTop: space16,
|
|
41
|
-
};
|
|
42
36
|
};
|
|
43
37
|
|
|
44
38
|
export { style };
|