@plurix/ecom-components 1.4.0-commerce.SCS-2154.0 → 1.4.0-commerce.SCS-2157.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.
@@ -1,77 +1,77 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
- import { useMemo as l } from "react";
3
- import { formatEspecifications as z, formatBrazilianPrice as v, formatedMultiply as U } from "../../../utils/changerOrderModal.js";
4
- import { Icons as A } from "../assets/icons.js";
5
- import { isMobile as B } from "../../../constants/index.js";
6
- const O = ({
1
+ import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
+ import { useMemo as c } from "react";
3
+ import { formatEspecifications as w, formatBrazilianPrice as u, formatedMultiply as z } from "../../../utils/changerOrderModal.js";
4
+ import { Icons as S } from "../assets/icons.js";
5
+ import { isMobile as U } from "../../../constants/index.js";
6
+ const H = ({
7
7
  similarProduct: a,
8
- similarProductSelect: s,
9
- setSimilarProductSelect: N,
10
- isClubClient: d
8
+ similarProductSelect: r,
9
+ setSimilarProductSelect: f,
10
+ isClubClient: v
11
11
  }) => {
12
12
  const {
13
- images: b,
14
- name: m,
15
- productId: h,
16
- sellingPrice: n,
13
+ images: N,
14
+ name: d,
15
+ productId: m,
16
+ sellingPrice: o,
17
17
  measurementUnit: y,
18
- unitMultiplier: C,
19
- hasDiscount: I,
20
- listPrice: r,
21
- isClub: p,
22
- skuSpecifications: g
23
- } = a, [{ imageUrl: M }] = b, c = l(() => B ? 48 : 80, []), u = l(
24
- () => h === (s == null ? void 0 : s.productId),
25
- [s]
26
- ), i = l(() => z(g || []), [g]), {
27
- discountPorcent: P,
28
- frontLstPrice: k,
29
- frontSellingPrice: L,
18
+ unitMultiplier: b,
19
+ hasDiscount: C,
20
+ listPrice: n,
21
+ isClub: I,
22
+ skuSpecifications: h
23
+ } = a, [{ imageUrl: M }] = N, l = c(() => U ? 48 : 80, []), p = c(
24
+ () => m === (r == null ? void 0 : r.productId),
25
+ [r]
26
+ ), i = c(() => w(h || []), [h]), {
27
+ discountPorcent: k,
28
+ frontLstPrice: L,
29
+ frontSellingPrice: P,
30
30
  frontPriceMultiply: j
31
- } = l(() => !n || !r ? {} : {
32
- discountPorcent: Math.round((r - n) / r * 100) * -1,
33
- frontLstPrice: v(r || 0),
34
- frontSellingPrice: v(n || 0),
35
- frontPriceMultiply: U(y, C)
36
- }, [n, r]), x = {
31
+ } = c(() => !o || !n ? {} : {
32
+ discountPorcent: Math.round((n - o) / n * 100) * -1,
33
+ frontLstPrice: u(n || 0),
34
+ frontSellingPrice: u(o || 0),
35
+ frontPriceMultiply: z(y, b)
36
+ }, [o, n]), x = {
37
37
  Vegano: "var(--color-seals-veg)",
38
38
  Orgânico: "var(--color-seals-org)",
39
39
  "Sem Glúten": "var(--color-seals-gluten-free)",
40
40
  "Sem Lactose": "var(--color-seals-lactose-free)",
41
41
  "Sem Açúcar": "var(--color-seals-sugar-free)"
42
- }, f = u ? "var(--color-main)" : "var(--color-grayScale-lightest)", w = () => {
43
- h !== (s == null ? void 0 : s.productId) && N(a);
44
- };
45
- return console.log("sellingPrice", n), console.log("listPrice", r), console.log("isClub", p), console.log("isClubClient", d), /* @__PURE__ */ o(
42
+ }, g = p ? "var(--color-main)" : "var(--color-grayScale-lightest)";
43
+ return /* @__PURE__ */ s(
46
44
  "div",
47
45
  {
48
46
  className: "similar-product-list-item",
49
- onClick: w,
47
+ onClick: () => {
48
+ m !== (r == null ? void 0 : r.productId) && f(a);
49
+ },
50
50
  style: {
51
- borderColor: f
51
+ borderColor: g
52
52
  },
53
53
  children: [
54
- /* @__PURE__ */ e("div", { style: { width: c }, children: /* @__PURE__ */ e(
54
+ /* @__PURE__ */ e("div", { style: { width: l }, children: /* @__PURE__ */ e(
55
55
  "img",
56
56
  {
57
- height: c,
58
- width: c,
57
+ height: l,
58
+ width: l,
59
59
  src: M,
60
- alt: m,
60
+ alt: d,
61
61
  style: { objectFit: "contain" }
62
62
  }
63
63
  ) }),
64
- /* @__PURE__ */ o("div", { className: "infos", children: [
65
- /* @__PURE__ */ o("div", { className: "description", children: [
66
- /* @__PURE__ */ e("h4", { className: "product-name", children: m }),
64
+ /* @__PURE__ */ s("div", { className: "infos", children: [
65
+ /* @__PURE__ */ s("div", { className: "description", children: [
66
+ /* @__PURE__ */ e("h4", { className: "product-name", children: d }),
67
67
  /* @__PURE__ */ e(
68
68
  "span",
69
69
  {
70
70
  className: "choose-icon",
71
71
  style: {
72
- backgroundColor: f
72
+ backgroundColor: g
73
73
  },
74
- children: u && /* @__PURE__ */ e(A, { iconId: "Check" })
74
+ children: p && /* @__PURE__ */ e(S, { iconId: "Check" })
75
75
  }
76
76
  )
77
77
  ] }),
@@ -83,18 +83,18 @@ const O = ({
83
83
  children: t
84
84
  }
85
85
  )) }),
86
- /* @__PURE__ */ o("div", { className: "prices", children: [
87
- I && /* @__PURE__ */ o("div", { className: "discount", children: [
88
- /* @__PURE__ */ e("p", { className: "list-price", children: k }),
89
- /* @__PURE__ */ o("span", { className: "badge", children: [
90
- P,
86
+ /* @__PURE__ */ s("div", { className: "prices", children: [
87
+ C && /* @__PURE__ */ s("div", { className: "discount", children: [
88
+ /* @__PURE__ */ e("p", { className: "list-price", children: L }),
89
+ /* @__PURE__ */ s("span", { className: "badge", children: [
90
+ k,
91
91
  "%"
92
92
  ] })
93
93
  ] }),
94
- /* @__PURE__ */ o("p", { className: "sellingPrice", children: [
95
- L,
94
+ /* @__PURE__ */ s("p", { className: "sellingPrice", children: [
95
+ P,
96
96
  /* @__PURE__ */ e("span", { className: "sellingPrice-multiply", children: j }),
97
- p && d && /* @__PURE__ */ e("span", { className: "badge", children: "Clube" })
97
+ I && v && /* @__PURE__ */ e("span", { className: "badge", children: "Clube" })
98
98
  ] })
99
99
  ] })
100
100
  ] })
@@ -103,5 +103,5 @@ const O = ({
103
103
  );
104
104
  };
105
105
  export {
106
- O as SimilarProductItem
106
+ H as SimilarProductItem
107
107
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@plurix/ecom-components",
3
3
  "author": "Plurix",
4
4
  "private": false,
5
- "version": "1.4.0-commerce.SCS-2154.0",
5
+ "version": "1.4.0-commerce.SCS-2157.0",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",