@lookiero/checkout 3.9.0-beta.0 → 3.9.0-beta.1
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/views/item/components/productVariantSlider/ProductVariantSlider.js +11 -8
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.d.ts +3 -3
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.js +4 -4
- package/dist/infrastructure/ui/views/item/views/productVariant/ProductVariant.js +5 -6
- package/package.json +1 -1
package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from "react";
|
|
2
|
-
import { Image } from "react-native";
|
|
2
|
+
import { Image, View } from "react-native";
|
|
3
|
+
import { AspectRatioView } from "../../../../../../shared/ui/components/atoms/aspectRatioView/AspectRatioView";
|
|
3
4
|
import { Carousel2, } from "../../../../../../shared/ui/components/layouts/carousel/Carousel2";
|
|
4
5
|
import { Bullets } from "../../../../../../shared/ui/components/layouts/slider/Bullets";
|
|
5
6
|
import { useMediaImage } from "../../../../hooks/useMediaImage";
|
|
@@ -7,13 +8,15 @@ import { style } from "./ProductVariantSlider.style";
|
|
|
7
8
|
const ProductVariantSlider = ({ producVariantMedia, onChanged }) => {
|
|
8
9
|
const cdnImageUrl = useMediaImage();
|
|
9
10
|
const handleOnActiveChanged = useCallback((activeIndex) => onChanged?.(activeIndex), [onChanged]);
|
|
10
|
-
const renderItem = useCallback(({ item }) => (React.createElement(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const renderItem = useCallback(({ item }) => (React.createElement(View, { style: style.slide },
|
|
12
|
+
React.createElement(AspectRatioView, { aspectRatio: 4 / 3 },
|
|
13
|
+
React.createElement(Image, { resizeMode: "contain", style: style.image, testID: "product-variant-image", source: {
|
|
14
|
+
uri: cdnImageUrl({
|
|
15
|
+
url: item.url,
|
|
16
|
+
width: 600,
|
|
17
|
+
}),
|
|
18
|
+
} })))), [cdnImageUrl]);
|
|
16
19
|
const renderBullets = useCallback(({ activeIndex, count, onChange }) => React.createElement(Bullets, { activeIndex: activeIndex, count: count, onChange: onChange }), []);
|
|
17
|
-
return (React.createElement(Carousel2, { bullets: renderBullets, data: producVariantMedia,
|
|
20
|
+
return (React.createElement(Carousel2, { bullets: renderBullets, data: producVariantMedia, onActiveIndexChanged: handleOnActiveChanged }, renderItem));
|
|
18
21
|
};
|
|
19
22
|
export { ProductVariantSlider };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
declare const style: {
|
|
2
|
-
carousel: {
|
|
3
|
-
overflow: "visible";
|
|
4
|
-
};
|
|
5
2
|
image: {
|
|
6
3
|
flex: number;
|
|
7
4
|
};
|
|
@@ -24,5 +21,8 @@ declare const style: {
|
|
|
24
21
|
marginTop: number;
|
|
25
22
|
position: "relative";
|
|
26
23
|
};
|
|
24
|
+
slide: {
|
|
25
|
+
paddingHorizontal: number;
|
|
26
|
+
};
|
|
27
27
|
};
|
|
28
28
|
export { style };
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../../../theme/theme";
|
|
3
|
-
const { colorBase, colorGrayscaleL, colorContent, spaceM } = theme();
|
|
3
|
+
const { colorBase, colorGrayscaleL, colorContent, spaceM, spaceXL } = theme();
|
|
4
4
|
const PAGINATION_SIZE = 37;
|
|
5
5
|
const style = StyleSheet.create({
|
|
6
|
-
carousel: {
|
|
7
|
-
overflow: "visible",
|
|
8
|
-
},
|
|
9
6
|
image: {
|
|
10
7
|
flex: 1,
|
|
11
8
|
},
|
|
@@ -28,5 +25,8 @@ const style = StyleSheet.create({
|
|
|
28
25
|
marginTop: spaceM,
|
|
29
26
|
position: "relative",
|
|
30
27
|
},
|
|
28
|
+
slide: {
|
|
29
|
+
paddingHorizontal: spaceXL,
|
|
30
|
+
},
|
|
31
31
|
});
|
|
32
32
|
export { style };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { useTrackImageView } from "../../../../../../shared/tracking/infrastructure/useTrackImageView";
|
|
4
|
-
import { AspectRatioView } from "../../../../../../shared/ui/components/atoms/aspectRatioView/AspectRatioView";
|
|
5
4
|
import { TrackingPage } from "../../../../../tracking/tracking";
|
|
6
5
|
import { ProductVariantDescription } from "../../components/productVariantDescription/ProductVariantDescription";
|
|
7
6
|
import { ProductVariantSlider } from "../../components/productVariantSlider/ProductVariantSlider";
|
|
@@ -20,10 +19,10 @@ const ProductVariant = ({ country, checkoutId, checkoutItem, currentProductVaria
|
|
|
20
19
|
const handleOnChangedProductVariantSlider = useCallback((active) => trackImageView({ perspective: checkoutItem.productVariant.media[active]?.perspective }), [checkoutItem.productVariant.media, trackImageView]);
|
|
21
20
|
const { price } = checkoutItem;
|
|
22
21
|
const { media, brand, name, color } = checkoutItem.productVariant;
|
|
23
|
-
return (React.createElement(View, {
|
|
24
|
-
React.createElement(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
return (React.createElement(View, { testID: "product-variant" },
|
|
23
|
+
React.createElement(ProductVariantSlider, { producVariantMedia: media, onChanged: handleOnChangedProductVariantSlider }),
|
|
24
|
+
React.createElement(View, { style: [style.content, customStyle?.content] },
|
|
25
|
+
React.createElement(ProductVariantDescription, { brand: brand, color: color, country: country, name: name, price: price, size: currentProductVariant.size }),
|
|
26
|
+
children)));
|
|
28
27
|
};
|
|
29
28
|
export { ProductVariant };
|