@trafilea/afrodita-components 6.54.6 → 6.54.8
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/build/index.d.ts +14 -10
- package/build/index.esm.js +11 -11
- package/build/index.js +11 -11
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -114,19 +114,20 @@ interface PriceLabelProps {
|
|
|
114
114
|
}
|
|
115
115
|
declare const PriceLabel: react__default.FC<PriceLabelProps>;
|
|
116
116
|
|
|
117
|
-
declare type Props$
|
|
117
|
+
declare type Props$3 = PriceLabelProps & {
|
|
118
118
|
savingsDisplay?: boolean;
|
|
119
119
|
pricePerItem?: string;
|
|
120
120
|
hasRoundedSavings?: boolean;
|
|
121
|
+
showDecimals?: boolean;
|
|
121
122
|
};
|
|
122
|
-
declare const PriceLabelV2: react__default.FC<Props$
|
|
123
|
+
declare const PriceLabelV2: react__default.FC<Props$3>;
|
|
123
124
|
|
|
124
|
-
declare type Props$
|
|
125
|
+
declare type Props$2 = PriceLabelProps & {
|
|
125
126
|
savingsDisplay?: boolean;
|
|
126
127
|
itemsQuantity?: number;
|
|
127
128
|
packUnitPrice?: string;
|
|
128
129
|
};
|
|
129
|
-
declare const PriceLabelV3: react__default.FC<Props$
|
|
130
|
+
declare const PriceLabelV3: react__default.FC<Props$2>;
|
|
130
131
|
|
|
131
132
|
interface PriceLabelV5Props {
|
|
132
133
|
finalPrice: string | number;
|
|
@@ -225,8 +226,8 @@ declare type ToggleProps = {
|
|
|
225
226
|
|
|
226
227
|
declare const ToggleComponent: FC<ToggleProps>;
|
|
227
228
|
|
|
228
|
-
declare type Props = Omit<IconProps$1, 'name'>;
|
|
229
|
-
declare type IconComponent = react__default.FC<Props>;
|
|
229
|
+
declare type Props$1 = Omit<IconProps$1, 'name'>;
|
|
230
|
+
declare type IconComponent = react__default.FC<Props$1>;
|
|
230
231
|
|
|
231
232
|
declare const Add: IconComponent;
|
|
232
233
|
|
|
@@ -2810,6 +2811,7 @@ interface ProductItemSmallMobileProps extends ProductItemProps {
|
|
|
2810
2811
|
isCollections?: boolean;
|
|
2811
2812
|
};
|
|
2812
2813
|
likeBtn?: LikeButtonProps;
|
|
2814
|
+
showDecimals?: boolean;
|
|
2813
2815
|
}
|
|
2814
2816
|
|
|
2815
2817
|
declare function withProductGrid<P extends ProductItemProps>(ProductItemComponent: react__default.FC<P>, data: ProductItemProps[]): {
|
|
@@ -4465,10 +4467,12 @@ declare const buildImageUrl: BuildImageUrl;
|
|
|
4465
4467
|
*/
|
|
4466
4468
|
declare const decimalFormat: (number: number) => string;
|
|
4467
4469
|
|
|
4468
|
-
|
|
4469
|
-
locale?: string
|
|
4470
|
-
currency?: string
|
|
4471
|
-
|
|
4470
|
+
interface Props {
|
|
4471
|
+
locale?: string;
|
|
4472
|
+
currency?: string;
|
|
4473
|
+
decimals?: number;
|
|
4474
|
+
}
|
|
4475
|
+
declare const formatPrice: (value: number, { locale, currency, decimals }?: Props) => string;
|
|
4472
4476
|
|
|
4473
4477
|
declare const getSrcSet: (imgLink: string, ...breakpoints: number[]) => string;
|
|
4474
4478
|
|
package/build/index.esm.js
CHANGED
|
@@ -3115,15 +3115,15 @@ var localeOverrideByCurrency = {
|
|
|
3115
3115
|
};
|
|
3116
3116
|
var formatPrice = function (value, _a) {
|
|
3117
3117
|
var _b, _c;
|
|
3118
|
-
var _d = _a === void 0 ? {} : _a, _e = _d.locale, locale = _e === void 0 ? 'en-US' : _e, _f = _d.currency, currency = _f === void 0 ? 'USD' : _f;
|
|
3119
|
-
var
|
|
3118
|
+
var _d = _a === void 0 ? {} : _a, _e = _d.locale, locale = _e === void 0 ? 'en-US' : _e, _f = _d.currency, currency = _f === void 0 ? 'USD' : _f, _g = _d.decimals, decimals = _g === void 0 ? 3 : _g;
|
|
3119
|
+
var _h = value.toFixed(decimals).split('.'), integer = _h[0], fraction = _h[1];
|
|
3120
3120
|
// this prevents `Intl.NumberFormat` from rounding the number
|
|
3121
|
-
var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0,
|
|
3121
|
+
var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, decimals - 1)) !== null && _b !== void 0 ? _b : 0));
|
|
3122
3122
|
var overridedLocale = (_c = localeOverrideByCurrency[currency]) !== null && _c !== void 0 ? _c : locale;
|
|
3123
3123
|
var result = new Intl.NumberFormat(overridedLocale, {
|
|
3124
3124
|
style: 'currency',
|
|
3125
3125
|
currency: currency,
|
|
3126
|
-
maximumFractionDigits:
|
|
3126
|
+
maximumFractionDigits: decimals,
|
|
3127
3127
|
}).format(valueToFormat);
|
|
3128
3128
|
if (currency === 'SGD') {
|
|
3129
3129
|
// intlFormat does not support singapure currency
|
|
@@ -3470,7 +3470,7 @@ var templateObject_1$2y, templateObject_2$1Q, templateObject_3$1q;
|
|
|
3470
3470
|
var FinalPriceStyledContainer$3 = newStyled.div(templateObject_1$2x || (templateObject_1$2x = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
3471
3471
|
var PriceLabelV2$1 = function (_a) {
|
|
3472
3472
|
var _b;
|
|
3473
|
-
var finalPrice = _a.finalPrice, originalPrice = _a.originalPrice, discount = _a.discount, clubOffer = _a.clubOffer, color = _a.color, testId = _a.testId, _c = _a.originalPriceStyled, originalPriceStyled = _c === void 0 ? false : _c, _d = _a.originalPriceUnderlined, originalPriceUnderlined = _d === void 0 ? true : _d, _e = _a.size, size = _e === void 0 ? ComponentSize.Small : _e, _f = _a.bordersRounded, bordersRounded = _f === void 0 ? false : _f, _g = _a.savingsDisplay, savingsDisplay = _g === void 0 ? true : _g, pricePerItem = _a.pricePerItem, _h = _a.hasRoundedSavings, hasRoundedSavings = _h === void 0 ? true : _h, rest = __rest(_a, ["finalPrice", "originalPrice", "discount", "clubOffer", "color", "testId", "originalPriceStyled", "originalPriceUnderlined", "size", "bordersRounded", "savingsDisplay", "pricePerItem", "hasRoundedSavings"]);
|
|
3473
|
+
var finalPrice = _a.finalPrice, originalPrice = _a.originalPrice, discount = _a.discount, clubOffer = _a.clubOffer, color = _a.color, testId = _a.testId, _c = _a.originalPriceStyled, originalPriceStyled = _c === void 0 ? false : _c, _d = _a.originalPriceUnderlined, originalPriceUnderlined = _d === void 0 ? true : _d, _e = _a.size, size = _e === void 0 ? ComponentSize.Small : _e, _f = _a.bordersRounded, bordersRounded = _f === void 0 ? false : _f, _g = _a.savingsDisplay, savingsDisplay = _g === void 0 ? true : _g, pricePerItem = _a.pricePerItem, _h = _a.hasRoundedSavings, hasRoundedSavings = _h === void 0 ? true : _h, _j = _a.showDecimals, showDecimals = _j === void 0 ? true : _j, rest = __rest(_a, ["finalPrice", "originalPrice", "discount", "clubOffer", "color", "testId", "originalPriceStyled", "originalPriceUnderlined", "size", "bordersRounded", "savingsDisplay", "pricePerItem", "hasRoundedSavings", "showDecimals"]);
|
|
3474
3474
|
var theme = useTheme();
|
|
3475
3475
|
var productFinalPrice = pricePerItem ? pricePerItem : finalPrice;
|
|
3476
3476
|
var isDiffFinalAndOriginalPrice = originalPrice !== productFinalPrice;
|
|
@@ -3522,9 +3522,9 @@ var PriceLabelV2$1 = function (_a) {
|
|
|
3522
3522
|
theme.colors.shades['300'].color, margin: true, underlined: originalPriceUnderlined, "data-testid": getTestId$2(testId, 'original-product-price') }, { children: originalPrice }), void 0)); };
|
|
3523
3523
|
return (jsxs$1(Container$1w, __assign$1({}, rest, { id: "priceLabelV2" }, { children: [isOriginalPrice && jsx$1(OriginalPrice, {}, void 0), jsxs$1(FinalPriceStyledContainer$3, __assign$1({ "data-testid": getTestId$2(testId, 'final-product-price') }, { children: [jsx$1(Price$1, __assign$1({ margin: true, finalPriceStyledSmall: true }, priceCommonProps, { size: size }, { children: currencySymbol }), void 0), jsx$1(Price$1, __assign$1({ finalPriceStyled: true }, priceCommonProps, { size: size }, { children: finalPriceArray[0]
|
|
3524
3524
|
? finalPriceArray[0]
|
|
3525
|
-
: (_b = "".concat(productFinalPrice)) === null || _b === void 0 ? void 0 : _b.split(currencySymbol)[1] }), void 0), jsx$1(Price$1, __assign$1({ finalPriceStyledSmall: true, style: {
|
|
3525
|
+
: (_b = "".concat(productFinalPrice)) === null || _b === void 0 ? void 0 : _b.split(currencySymbol)[1] }), void 0), showDecimals && (jsx$1(Price$1, __assign$1({ finalPriceStyledSmall: true, style: {
|
|
3526
3526
|
marginTop: '-6px',
|
|
3527
|
-
} }, priceCommonProps, { size: size }, { children: finalPriceArray[1] ? finalPriceArray[1] : '00' }), void 0), pricePerItem && (jsx$1(Price$1, __assign$1({ size: ComponentSize.Small, color: theme.colors.pallete.secondary.color }, { children: "/each" }), void 0))] }), void 0), isDiscount && (jsx$1(TagContainer, __assign$1({ size: ComponentSize.Small }, { children: discount && (jsx$1(DiscountTag$4, __assign$1({}, discount, { size: ComponentSize.Medium, style: {
|
|
3527
|
+
} }, priceCommonProps, { size: size }, { children: finalPriceArray[1] ? finalPriceArray[1] : '00' }), void 0)), pricePerItem && (jsx$1(Price$1, __assign$1({ size: ComponentSize.Small, color: theme.colors.pallete.secondary.color }, { children: "/each" }), void 0))] }), void 0), isDiscount && (jsx$1(TagContainer, __assign$1({ size: ComponentSize.Small }, { children: discount && (jsx$1(DiscountTag$4, __assign$1({}, discount, { size: ComponentSize.Medium, style: {
|
|
3528
3528
|
letterSpacing: '-0.05rem',
|
|
3529
3529
|
}, bordersRounded: bordersRounded, savings: savingsDisplay ? "Save ".concat(currencySymbol).concat(savetoString) : undefined }), void 0)) }), void 0)), isClubOffer && (jsx$1(TagContainer, __assign$1({ size: ComponentSize.Medium }, { children: clubOffer && (jsx$1(ClubOfferTag, __assign$1({}, clubOffer, { size: ComponentSize.Small, style: {
|
|
3530
3530
|
borderRadius: '8px',
|
|
@@ -7448,7 +7448,7 @@ var ProductItemMobile = function (_a) {
|
|
|
7448
7448
|
} : _s, _t = _a.hasStrength, hasStrength = _t === void 0 ? {
|
|
7449
7449
|
strength: -1,
|
|
7450
7450
|
description: '',
|
|
7451
|
-
} : _t, _u = _a.clubPrice, clubPrice = _u === void 0 ? '' : _u, _v = _a.showClubPriceLabel, showClubPriceLabel = _v === void 0 ? false : _v, isRatingLoading = _a.isRatingLoading, _w = _a.version, version = _w === void 0 ? 1 : _w, _x = _a.showDiscountPercentageTag, showDiscountPercentageTag = _x === void 0 ? false : _x, discountTagLoading = _a.discountTagLoading, discountTag = _a.discountTag, _y = _a.isOnViewport, isOnViewport = _y === void 0 ? false : _y, _z = _a.hasDefaultSize, hasDefaultSize = _z === void 0 ? false : _z, clubOffer = _a.clubOffer, likeBtn = _a.likeBtn, onClickBottomButton = _a.onClickBottomButton;
|
|
7451
|
+
} : _t, _u = _a.clubPrice, clubPrice = _u === void 0 ? '' : _u, _v = _a.showClubPriceLabel, showClubPriceLabel = _v === void 0 ? false : _v, isRatingLoading = _a.isRatingLoading, _w = _a.version, version = _w === void 0 ? 1 : _w, _x = _a.showDiscountPercentageTag, showDiscountPercentageTag = _x === void 0 ? false : _x, discountTagLoading = _a.discountTagLoading, discountTag = _a.discountTag, _y = _a.isOnViewport, isOnViewport = _y === void 0 ? false : _y, _z = _a.hasDefaultSize, hasDefaultSize = _z === void 0 ? false : _z, clubOffer = _a.clubOffer, likeBtn = _a.likeBtn, onClickBottomButton = _a.onClickBottomButton, _0 = _a.showDecimals, showDecimals = _0 === void 0 ? true : _0;
|
|
7452
7452
|
var theme = useTheme();
|
|
7453
7453
|
var styles = getStylesBySize$b(size);
|
|
7454
7454
|
var isMobile = useWindowDimensions().isMobile;
|
|
@@ -7493,7 +7493,7 @@ var ProductItemMobile = function (_a) {
|
|
|
7493
7493
|
case 5:
|
|
7494
7494
|
return (jsx(ClubOfferPriceLabelWrapper, __assign$1({ style: clubOffer === null || clubOffer === void 0 ? void 0 : clubOffer.wrapperStyle }, { children: jsx(ClubPriceMemberLabel, { isClub: true, isPDP: true, finalPrice: (_e = clubOffer === null || clubOffer === void 0 ? void 0 : clubOffer.price) === null || _e === void 0 ? void 0 : _e.finalPrice, originalPrice: (_f = clubOffer === null || clubOffer === void 0 ? void 0 : clubOffer.price) === null || _f === void 0 ? void 0 : _f.originalPrice, finalPriceStyled: false, color: price.color, size: ComponentSize.Medium, testId: "volume-discount-v4", clubStyle: showClubPriceLabel, icon: clubOffer === null || clubOffer === void 0 ? void 0 : clubOffer.clubOfferIcon, isCollections: clubOffer === null || clubOffer === void 0 ? void 0 : clubOffer.isCollections }, void 0) }), void 0));
|
|
7495
7495
|
default:
|
|
7496
|
-
return priceDisplayType === 'styled' ? (jsx(PriceLabelV2$1, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, finalPriceStyled: false, color: price.color, size: ComponentSize.Large, testId: "volume-discount" }, void 0)) : (jsx(PriceLabel$1, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, finalPriceStyled: false, color: price.color, size: ComponentSize.Medium, testId: "volume-discount", clubStyle: showClubPriceLabel, finalPriceStyle: showClubPriceLabel
|
|
7496
|
+
return priceDisplayType === 'styled' ? (jsx(PriceLabelV2$1, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, finalPriceStyled: false, color: price.color, size: ComponentSize.Large, testId: "volume-discount", showDecimals: showDecimals }, void 0)) : (jsx(PriceLabel$1, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, finalPriceStyled: false, color: price.color, size: ComponentSize.Medium, testId: "volume-discount", clubStyle: showClubPriceLabel, finalPriceStyle: showClubPriceLabel
|
|
7497
7497
|
? !isMobile
|
|
7498
7498
|
? { fontSize: '16px', fontWeight: 700 }
|
|
7499
7499
|
: { fontSize: '12px', fontWeight: 700 }
|
|
@@ -7507,8 +7507,8 @@ var ProductItemMobile = function (_a) {
|
|
|
7507
7507
|
return jsx(Fragment, {}, void 0);
|
|
7508
7508
|
return (jsx(Rating, { size: size === ComponentSize.Large ? ComponentSize.Small : ComponentSize.XSmall, rating: rating.rating, reviews: rating.reviews, reviewsText: "", wrapWithParenthesis: true }, void 0));
|
|
7509
7509
|
};
|
|
7510
|
-
var
|
|
7511
|
-
var
|
|
7510
|
+
var _1 = useState((_b = likeBtn === null || likeBtn === void 0 ? void 0 : likeBtn.isLiked) !== null && _b !== void 0 ? _b : false), isLiked = _1[0], setIsLiked = _1[1];
|
|
7511
|
+
var _2 = useState((_c = likeBtn === null || likeBtn === void 0 ? void 0 : likeBtn.likes) !== null && _c !== void 0 ? _c : 0), likesCount = _2[0], setLikesCount = _2[1];
|
|
7512
7512
|
var handleLikeClick = function (e) {
|
|
7513
7513
|
e.stopPropagation();
|
|
7514
7514
|
if (isLiked) {
|
package/build/index.js
CHANGED
|
@@ -3141,15 +3141,15 @@ var localeOverrideByCurrency = {
|
|
|
3141
3141
|
};
|
|
3142
3142
|
var formatPrice = function (value, _a) {
|
|
3143
3143
|
var _b, _c;
|
|
3144
|
-
var _d = _a === void 0 ? {} : _a, _e = _d.locale, locale = _e === void 0 ? 'en-US' : _e, _f = _d.currency, currency = _f === void 0 ? 'USD' : _f;
|
|
3145
|
-
var
|
|
3144
|
+
var _d = _a === void 0 ? {} : _a, _e = _d.locale, locale = _e === void 0 ? 'en-US' : _e, _f = _d.currency, currency = _f === void 0 ? 'USD' : _f, _g = _d.decimals, decimals = _g === void 0 ? 3 : _g;
|
|
3145
|
+
var _h = value.toFixed(decimals).split('.'), integer = _h[0], fraction = _h[1];
|
|
3146
3146
|
// this prevents `Intl.NumberFormat` from rounding the number
|
|
3147
|
-
var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0,
|
|
3147
|
+
var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, decimals - 1)) !== null && _b !== void 0 ? _b : 0));
|
|
3148
3148
|
var overridedLocale = (_c = localeOverrideByCurrency[currency]) !== null && _c !== void 0 ? _c : locale;
|
|
3149
3149
|
var result = new Intl.NumberFormat(overridedLocale, {
|
|
3150
3150
|
style: 'currency',
|
|
3151
3151
|
currency: currency,
|
|
3152
|
-
maximumFractionDigits:
|
|
3152
|
+
maximumFractionDigits: decimals,
|
|
3153
3153
|
}).format(valueToFormat);
|
|
3154
3154
|
if (currency === 'SGD') {
|
|
3155
3155
|
// intlFormat does not support singapure currency
|
|
@@ -3496,7 +3496,7 @@ var templateObject_1$2y, templateObject_2$1Q, templateObject_3$1q;
|
|
|
3496
3496
|
var FinalPriceStyledContainer$3 = newStyled.div(templateObject_1$2x || (templateObject_1$2x = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
3497
3497
|
var PriceLabelV2$1 = function (_a) {
|
|
3498
3498
|
var _b;
|
|
3499
|
-
var finalPrice = _a.finalPrice, originalPrice = _a.originalPrice, discount = _a.discount, clubOffer = _a.clubOffer, color = _a.color, testId = _a.testId, _c = _a.originalPriceStyled, originalPriceStyled = _c === void 0 ? false : _c, _d = _a.originalPriceUnderlined, originalPriceUnderlined = _d === void 0 ? true : _d, _e = _a.size, size = _e === void 0 ? exports.ComponentSize.Small : _e, _f = _a.bordersRounded, bordersRounded = _f === void 0 ? false : _f, _g = _a.savingsDisplay, savingsDisplay = _g === void 0 ? true : _g, pricePerItem = _a.pricePerItem, _h = _a.hasRoundedSavings, hasRoundedSavings = _h === void 0 ? true : _h, rest = __rest(_a, ["finalPrice", "originalPrice", "discount", "clubOffer", "color", "testId", "originalPriceStyled", "originalPriceUnderlined", "size", "bordersRounded", "savingsDisplay", "pricePerItem", "hasRoundedSavings"]);
|
|
3499
|
+
var finalPrice = _a.finalPrice, originalPrice = _a.originalPrice, discount = _a.discount, clubOffer = _a.clubOffer, color = _a.color, testId = _a.testId, _c = _a.originalPriceStyled, originalPriceStyled = _c === void 0 ? false : _c, _d = _a.originalPriceUnderlined, originalPriceUnderlined = _d === void 0 ? true : _d, _e = _a.size, size = _e === void 0 ? exports.ComponentSize.Small : _e, _f = _a.bordersRounded, bordersRounded = _f === void 0 ? false : _f, _g = _a.savingsDisplay, savingsDisplay = _g === void 0 ? true : _g, pricePerItem = _a.pricePerItem, _h = _a.hasRoundedSavings, hasRoundedSavings = _h === void 0 ? true : _h, _j = _a.showDecimals, showDecimals = _j === void 0 ? true : _j, rest = __rest(_a, ["finalPrice", "originalPrice", "discount", "clubOffer", "color", "testId", "originalPriceStyled", "originalPriceUnderlined", "size", "bordersRounded", "savingsDisplay", "pricePerItem", "hasRoundedSavings", "showDecimals"]);
|
|
3500
3500
|
var theme = useTheme();
|
|
3501
3501
|
var productFinalPrice = pricePerItem ? pricePerItem : finalPrice;
|
|
3502
3502
|
var isDiffFinalAndOriginalPrice = originalPrice !== productFinalPrice;
|
|
@@ -3548,9 +3548,9 @@ var PriceLabelV2$1 = function (_a) {
|
|
|
3548
3548
|
theme.colors.shades['300'].color, margin: true, underlined: originalPriceUnderlined, "data-testid": getTestId$2(testId, 'original-product-price') }, { children: originalPrice }), void 0)); };
|
|
3549
3549
|
return (jsxRuntime.jsxs(Container$1w, __assign$1({}, rest, { id: "priceLabelV2" }, { children: [isOriginalPrice && jsxRuntime.jsx(OriginalPrice, {}, void 0), jsxRuntime.jsxs(FinalPriceStyledContainer$3, __assign$1({ "data-testid": getTestId$2(testId, 'final-product-price') }, { children: [jsxRuntime.jsx(Price$1, __assign$1({ margin: true, finalPriceStyledSmall: true }, priceCommonProps, { size: size }, { children: currencySymbol }), void 0), jsxRuntime.jsx(Price$1, __assign$1({ finalPriceStyled: true }, priceCommonProps, { size: size }, { children: finalPriceArray[0]
|
|
3550
3550
|
? finalPriceArray[0]
|
|
3551
|
-
: (_b = "".concat(productFinalPrice)) === null || _b === void 0 ? void 0 : _b.split(currencySymbol)[1] }), void 0), jsxRuntime.jsx(Price$1, __assign$1({ finalPriceStyledSmall: true, style: {
|
|
3551
|
+
: (_b = "".concat(productFinalPrice)) === null || _b === void 0 ? void 0 : _b.split(currencySymbol)[1] }), void 0), showDecimals && (jsxRuntime.jsx(Price$1, __assign$1({ finalPriceStyledSmall: true, style: {
|
|
3552
3552
|
marginTop: '-6px',
|
|
3553
|
-
} }, priceCommonProps, { size: size }, { children: finalPriceArray[1] ? finalPriceArray[1] : '00' }), void 0), pricePerItem && (jsxRuntime.jsx(Price$1, __assign$1({ size: exports.ComponentSize.Small, color: theme.colors.pallete.secondary.color }, { children: "/each" }), void 0))] }), void 0), isDiscount && (jsxRuntime.jsx(TagContainer, __assign$1({ size: exports.ComponentSize.Small }, { children: discount && (jsxRuntime.jsx(DiscountTag$4, __assign$1({}, discount, { size: exports.ComponentSize.Medium, style: {
|
|
3553
|
+
} }, priceCommonProps, { size: size }, { children: finalPriceArray[1] ? finalPriceArray[1] : '00' }), void 0)), pricePerItem && (jsxRuntime.jsx(Price$1, __assign$1({ size: exports.ComponentSize.Small, color: theme.colors.pallete.secondary.color }, { children: "/each" }), void 0))] }), void 0), isDiscount && (jsxRuntime.jsx(TagContainer, __assign$1({ size: exports.ComponentSize.Small }, { children: discount && (jsxRuntime.jsx(DiscountTag$4, __assign$1({}, discount, { size: exports.ComponentSize.Medium, style: {
|
|
3554
3554
|
letterSpacing: '-0.05rem',
|
|
3555
3555
|
}, bordersRounded: bordersRounded, savings: savingsDisplay ? "Save ".concat(currencySymbol).concat(savetoString) : undefined }), void 0)) }), void 0)), isClubOffer && (jsxRuntime.jsx(TagContainer, __assign$1({ size: exports.ComponentSize.Medium }, { children: clubOffer && (jsxRuntime.jsx(ClubOfferTag, __assign$1({}, clubOffer, { size: exports.ComponentSize.Small, style: {
|
|
3556
3556
|
borderRadius: '8px',
|
|
@@ -7474,7 +7474,7 @@ var ProductItemMobile = function (_a) {
|
|
|
7474
7474
|
} : _s, _t = _a.hasStrength, hasStrength = _t === void 0 ? {
|
|
7475
7475
|
strength: -1,
|
|
7476
7476
|
description: '',
|
|
7477
|
-
} : _t, _u = _a.clubPrice, clubPrice = _u === void 0 ? '' : _u, _v = _a.showClubPriceLabel, showClubPriceLabel = _v === void 0 ? false : _v, isRatingLoading = _a.isRatingLoading, _w = _a.version, version = _w === void 0 ? 1 : _w, _x = _a.showDiscountPercentageTag, showDiscountPercentageTag = _x === void 0 ? false : _x, discountTagLoading = _a.discountTagLoading, discountTag = _a.discountTag, _y = _a.isOnViewport, isOnViewport = _y === void 0 ? false : _y, _z = _a.hasDefaultSize, hasDefaultSize = _z === void 0 ? false : _z, clubOffer = _a.clubOffer, likeBtn = _a.likeBtn, onClickBottomButton = _a.onClickBottomButton;
|
|
7477
|
+
} : _t, _u = _a.clubPrice, clubPrice = _u === void 0 ? '' : _u, _v = _a.showClubPriceLabel, showClubPriceLabel = _v === void 0 ? false : _v, isRatingLoading = _a.isRatingLoading, _w = _a.version, version = _w === void 0 ? 1 : _w, _x = _a.showDiscountPercentageTag, showDiscountPercentageTag = _x === void 0 ? false : _x, discountTagLoading = _a.discountTagLoading, discountTag = _a.discountTag, _y = _a.isOnViewport, isOnViewport = _y === void 0 ? false : _y, _z = _a.hasDefaultSize, hasDefaultSize = _z === void 0 ? false : _z, clubOffer = _a.clubOffer, likeBtn = _a.likeBtn, onClickBottomButton = _a.onClickBottomButton, _0 = _a.showDecimals, showDecimals = _0 === void 0 ? true : _0;
|
|
7478
7478
|
var theme = useTheme();
|
|
7479
7479
|
var styles = getStylesBySize$b(size);
|
|
7480
7480
|
var isMobile = useWindowDimensions().isMobile;
|
|
@@ -7519,7 +7519,7 @@ var ProductItemMobile = function (_a) {
|
|
|
7519
7519
|
case 5:
|
|
7520
7520
|
return (jsx(ClubOfferPriceLabelWrapper, __assign$1({ style: clubOffer === null || clubOffer === void 0 ? void 0 : clubOffer.wrapperStyle }, { children: jsx(ClubPriceMemberLabel, { isClub: true, isPDP: true, finalPrice: (_e = clubOffer === null || clubOffer === void 0 ? void 0 : clubOffer.price) === null || _e === void 0 ? void 0 : _e.finalPrice, originalPrice: (_f = clubOffer === null || clubOffer === void 0 ? void 0 : clubOffer.price) === null || _f === void 0 ? void 0 : _f.originalPrice, finalPriceStyled: false, color: price.color, size: exports.ComponentSize.Medium, testId: "volume-discount-v4", clubStyle: showClubPriceLabel, icon: clubOffer === null || clubOffer === void 0 ? void 0 : clubOffer.clubOfferIcon, isCollections: clubOffer === null || clubOffer === void 0 ? void 0 : clubOffer.isCollections }, void 0) }), void 0));
|
|
7521
7521
|
default:
|
|
7522
|
-
return priceDisplayType === 'styled' ? (jsx(PriceLabelV2$1, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, finalPriceStyled: false, color: price.color, size: exports.ComponentSize.Large, testId: "volume-discount" }, void 0)) : (jsx(PriceLabel$1, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, finalPriceStyled: false, color: price.color, size: exports.ComponentSize.Medium, testId: "volume-discount", clubStyle: showClubPriceLabel, finalPriceStyle: showClubPriceLabel
|
|
7522
|
+
return priceDisplayType === 'styled' ? (jsx(PriceLabelV2$1, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, finalPriceStyled: false, color: price.color, size: exports.ComponentSize.Large, testId: "volume-discount", showDecimals: showDecimals }, void 0)) : (jsx(PriceLabel$1, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, finalPriceStyled: false, color: price.color, size: exports.ComponentSize.Medium, testId: "volume-discount", clubStyle: showClubPriceLabel, finalPriceStyle: showClubPriceLabel
|
|
7523
7523
|
? !isMobile
|
|
7524
7524
|
? { fontSize: '16px', fontWeight: 700 }
|
|
7525
7525
|
: { fontSize: '12px', fontWeight: 700 }
|
|
@@ -7533,8 +7533,8 @@ var ProductItemMobile = function (_a) {
|
|
|
7533
7533
|
return jsx(Fragment, {}, void 0);
|
|
7534
7534
|
return (jsx(Rating, { size: size === exports.ComponentSize.Large ? exports.ComponentSize.Small : exports.ComponentSize.XSmall, rating: rating.rating, reviews: rating.reviews, reviewsText: "", wrapWithParenthesis: true }, void 0));
|
|
7535
7535
|
};
|
|
7536
|
-
var
|
|
7537
|
-
var
|
|
7536
|
+
var _1 = React$2.useState((_b = likeBtn === null || likeBtn === void 0 ? void 0 : likeBtn.isLiked) !== null && _b !== void 0 ? _b : false), isLiked = _1[0], setIsLiked = _1[1];
|
|
7537
|
+
var _2 = React$2.useState((_c = likeBtn === null || likeBtn === void 0 ? void 0 : likeBtn.likes) !== null && _c !== void 0 ? _c : 0), likesCount = _2[0], setLikesCount = _2[1];
|
|
7538
7538
|
var handleLikeClick = function (e) {
|
|
7539
7539
|
e.stopPropagation();
|
|
7540
7540
|
if (isLiked) {
|
package/package.json
CHANGED