contentoh-components-library 21.4.7 → 21.4.9

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.
Files changed (108) hide show
  1. package/.env.development +1 -5
  2. package/.env.production +1 -3
  3. package/dist/assets/fonts/roboto/LICENSE.txt +202 -0
  4. package/dist/components/atoms/Avatar/index.js +2 -3
  5. package/dist/components/atoms/Card/index.js +5 -46
  6. package/dist/components/atoms/Card/styles.js +1 -3
  7. package/dist/components/atoms/CheckBox/index.js +2 -7
  8. package/dist/components/atoms/CheckBox/styles.js +1 -1
  9. package/dist/components/atoms/InputFormatter/styles.js +1 -1
  10. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  11. package/dist/components/molecules/HeaderTop/index.js +11 -68
  12. package/dist/components/molecules/TagAndInput/index.js +1 -1
  13. package/dist/components/organisms/Chat/Chat.stories.js +8 -27
  14. package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
  15. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  16. package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
  17. package/dist/components/organisms/Chat/Footer/index.js +39 -48
  18. package/dist/components/organisms/Chat/index.js +4 -49
  19. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  20. package/dist/components/organisms/Modal/styles.js +1 -1
  21. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +29 -169
  22. package/dist/components/pages/ProviderProductEdition/index.js +203 -213
  23. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  24. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +60 -85
  25. package/dist/components/pages/RetailerProductEdition/index.js +303 -315
  26. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  27. package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
  28. package/dist/index.js +52 -234
  29. package/package.json +1 -4
  30. package/src/components/atoms/Avatar/index.js +2 -8
  31. package/src/components/atoms/Card/index.js +2 -35
  32. package/src/components/atoms/Card/styles.js +5 -41
  33. package/src/components/atoms/CheckBox/index.js +1 -4
  34. package/src/components/atoms/CheckBox/styles.js +0 -2
  35. package/src/components/atoms/InputFormatter/styles.js +1 -2
  36. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  37. package/src/components/molecules/HeaderTop/index.js +6 -52
  38. package/src/components/molecules/TagAndInput/index.js +8 -10
  39. package/src/components/organisms/Chat/Chat.stories.js +7 -27
  40. package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
  41. package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
  42. package/src/components/organisms/Chat/ContentChat/index.js +12 -88
  43. package/src/components/organisms/Chat/Footer/index.js +0 -11
  44. package/src/components/organisms/Chat/index.js +4 -46
  45. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  46. package/src/components/organisms/Modal/styles.js +1 -4
  47. package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
  48. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +34 -188
  49. package/src/components/pages/ProviderProductEdition/index.js +132 -132
  50. package/src/components/pages/ProviderProductEdition/styles.js +1 -5
  51. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -72
  52. package/src/components/pages/RetailerProductEdition/index.js +138 -122
  53. package/src/components/pages/RetailerProductEdition/styles.js +0 -4
  54. package/src/components/pages/RetailerProductEdition/utils.js +0 -37
  55. package/src/index.js +0 -15
  56. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
  57. package/src/components/atoms/ImageCarousel/index.js +0 -103
  58. package/src/components/atoms/ImageCarousel/styles.js +0 -79
  59. package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
  60. package/src/components/atoms/PercentTag/index.js +0 -9
  61. package/src/components/atoms/PercentTag/styles.js +0 -69
  62. package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
  63. package/src/components/atoms/RatingStars/index.js +0 -31
  64. package/src/components/atoms/RatingStars/styles.js +0 -28
  65. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
  66. package/src/components/atoms/RetailerCatalog/index.js +0 -49
  67. package/src/components/atoms/RetailerCatalog/styles.js +0 -30
  68. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
  69. package/src/components/atoms/RetailerOption/index.js +0 -53
  70. package/src/components/atoms/RetailerOption/styles.js +0 -41
  71. package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
  72. package/src/components/atoms/RetailersList/index.js +0 -20
  73. package/src/components/atoms/RetailersList/styles.js +0 -19
  74. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
  75. package/src/components/atoms/UserCatalog/index.js +0 -96
  76. package/src/components/atoms/UserCatalog/styles.js +0 -24
  77. package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
  78. package/src/components/atoms/UserOption/index.js +0 -95
  79. package/src/components/atoms/UserOption/styles.js +0 -61
  80. package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
  81. package/src/components/atoms/UserSelector/index.js +0 -86
  82. package/src/components/atoms/UserSelector/styles.js +0 -55
  83. package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
  84. package/src/components/molecules/GridItem/index.js +0 -97
  85. package/src/components/molecules/GridItem/styles.js +0 -104
  86. package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
  87. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
  88. package/src/components/molecules/HeaderItem/index.js +0 -26
  89. package/src/components/molecules/HeaderItem/styles.js +0 -27
  90. package/src/components/molecules/RowItem/ColumnItem.js +0 -9
  91. package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
  92. package/src/components/molecules/RowItem/index.js +0 -45
  93. package/src/components/molecules/RowItem/styles.js +0 -40
  94. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
  95. package/src/components/molecules/StripeCardForm/index.js +0 -42
  96. package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
  97. package/src/components/molecules/StripeCardForm/styles.js +0 -73
  98. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
  99. package/src/components/molecules/StripeCardSelector/index.js +0 -44
  100. package/src/components/molecules/StripeCardSelector/styles.js +0 -4
  101. package/src/components/molecules/StripeCardSelector/utils.js +0 -17
  102. package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
  103. package/src/components/organisms/GridProducts/index.js +0 -50
  104. package/src/components/organisms/GridProducts/styles.js +0 -14
  105. package/src/components/organisms/GridProducts/utils.js +0 -111
  106. package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
  107. package/src/components/organisms/SideModal/index.js +0 -50
  108. package/src/components/organisms/SideModal/styles.js +0 -30
@@ -1,96 +0,0 @@
1
- import { Container } from "./styles";
2
- import { Avatar } from "../Avatar";
3
- import { getProfilePicture } from "../../../global-files/data";
4
- import { UserOption } from "../UserOption";
5
- import { useCloseModal } from "../../../global-files/customHooks";
6
- export const UserCatalog = ({
7
- datasheet,
8
- description,
9
- images,
10
- auditor,
11
- auditors = [],
12
- textSpecialists = [],
13
- imagesSpecialists = [],
14
- id = "list-modal",
15
- onAssign,
16
- product,
17
- }) => {
18
- const [showList, setShowList] = useCloseModal(id);
19
-
20
- return (
21
- <Container
22
- id={id}
23
- onClick={(e) => {
24
- if (!e.target.closest(`#${id} .users-assigned-list`))
25
- setShowList(!showList);
26
- }}
27
- >
28
- {datasheet && (
29
- <Avatar
30
- image={getProfilePicture(datasheet, 26, 26)}
31
- altText={"datasheet specialist"}
32
- imageType={"medium-image"}
33
- />
34
- )}
35
- {description && (
36
- <Avatar
37
- image={getProfilePicture(description, 26, 26)}
38
- altText={"description specialist"}
39
- imageType={"medium-image"}
40
- />
41
- )}
42
- {images && (
43
- <Avatar
44
- image={getProfilePicture(images, 26, 26)}
45
- altText={"images specialist"}
46
- imageType={"medium-image"}
47
- />
48
- )}
49
- {auditor && (
50
- <Avatar
51
- image={getProfilePicture(auditor, 26, 26)}
52
- altText={"auditor"}
53
- imageType={"medium-image"}
54
- />
55
- )}
56
- {showList && (
57
- <div className="users-assigned-list">
58
- {product.datasheet_status !== "NS" && (
59
- <UserOption
60
- onAssign={onAssign}
61
- product={product}
62
- userId={datasheet}
63
- usersArray={textSpecialists}
64
- id={id + "-datasheet"}
65
- index={"datasheet"}
66
- />
67
- )}
68
- <UserOption
69
- onAssign={onAssign}
70
- product={product}
71
- userId={description}
72
- usersArray={textSpecialists}
73
- id={id + "-description"}
74
- index={"description"}
75
- />
76
- <UserOption
77
- onAssign={onAssign}
78
- product={product}
79
- userId={images}
80
- usersArray={imagesSpecialists}
81
- id={id + "-images"}
82
- index={"image"}
83
- />
84
- <UserOption
85
- onAssign={onAssign}
86
- product={product}
87
- userId={auditor}
88
- usersArray={auditors}
89
- id={id + "-auditor"}
90
- index={"auditor"}
91
- />
92
- </div>
93
- )}
94
- </Container>
95
- );
96
- };
@@ -1,24 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- export const Container = styled.div`
4
- display: flex;
5
- justify-content: center;
6
- width: 100%;
7
- height: 100%;
8
- cursor: pointer;
9
- position: relative;
10
-
11
- .users-assigned-list {
12
- background-color: white;
13
- padding: 10px;
14
- box-shadow: 0px 2px 4px #00000040;
15
- position: absolute;
16
- top: 100%;
17
- left: 0;
18
- z-index: 400;
19
- }
20
-
21
- > * + * {
22
- margin-left: -10px;
23
- }
24
- `;
@@ -1,25 +0,0 @@
1
- import { UserOption } from ".";
2
-
3
- export default {
4
- title: "Components/atoms/UserOption",
5
- component: UserOption,
6
- };
7
-
8
- const Template = (args) => <UserOption {...args} />;
9
- export const UserOptionDefault = Template.bind({});
10
- UserOptionDefault.args = {
11
- userId: 37,
12
- index: "datasheet",
13
- usersArray: [
14
- {
15
- name: "José",
16
- last_name: "Castañeda",
17
- id_user: 37,
18
- },
19
- {
20
- name: "Eduardo ",
21
- last_name: " Reyes",
22
- id_user: 195,
23
- },
24
- ],
25
- };
@@ -1,95 +0,0 @@
1
- import { Container } from "./styles";
2
- import { Avatar } from "../Avatar";
3
- import { useState } from "react";
4
- import { useEffect } from "react";
5
- import { getProfilePicture } from "../../../global-files/data";
6
- import { servicesCodeIcon } from "../../organisms/OrderDetail/utils/Table/utils";
7
- import { UserSelector } from "../UserSelector";
8
- import { useCloseModal } from "../../../global-files/customHooks";
9
-
10
- export const UserOption = ({
11
- userId,
12
- index,
13
- usersArray,
14
- id,
15
- onAssign,
16
- product,
17
- }) => {
18
- index === "auditor" && console.log(userId);
19
- const [userAssigned, setUserAssigned] = useState({});
20
- const [showSelector, setShowSelector] = useCloseModal(id);
21
- const [assignationTarget, setAssignationTarget] = useState("");
22
- const [concept, setConcept] = useState("");
23
- const [target, setTarget] = useState("");
24
-
25
- const icons = servicesCodeIcon;
26
-
27
- useEffect(() => {
28
- if (usersArray) {
29
- usersArray.forEach((user) => {
30
- if (user.id_user === userId) {
31
- setUserAssigned(user);
32
- }
33
- });
34
- }
35
- }, [userId, usersArray]);
36
-
37
- useEffect(() => {
38
- switch (index) {
39
- case "datasheet":
40
- case "description":
41
- setAssignationTarget(`id_${index}_especialist`);
42
- setConcept(index);
43
- setTarget("especialist");
44
- break;
45
- case "image":
46
- setAssignationTarget(`id_${index}s_especialist`);
47
- setConcept(index + "s");
48
- setTarget("especialist");
49
- break;
50
- case "auditor":
51
- setAssignationTarget(`id_${index}`);
52
- setConcept(index);
53
- setTarget(index);
54
- break;
55
- default:
56
- break;
57
- }
58
- }, [index]);
59
-
60
- return (
61
- <Container
62
- onClick={(e) => {
63
- setShowSelector(!showSelector);
64
- e.stopPropagation();
65
- }}
66
- id={id}
67
- >
68
- <div className="image-and-name">
69
- <Avatar
70
- image={getProfilePicture(userAssigned?.id_user, 26, 26)}
71
- altText={"datasheet especialist"}
72
- imageType={"medium-image"}
73
- />
74
- <p>
75
- {userAssigned?.name} {userAssigned?.last_name}
76
- </p>
77
- </div>
78
- <div className="icon-container">{icons[index]}</div>
79
- {showSelector && (
80
- <UserSelector
81
- id={id}
82
- searchLabel="Buscar Usuario"
83
- index={index}
84
- usersArray={usersArray}
85
- position="absolute"
86
- onAssign={onAssign}
87
- product={product}
88
- assignationTarget={assignationTarget}
89
- target={target}
90
- concept={concept}
91
- />
92
- )}
93
- </Container>
94
- );
95
- };
@@ -1,61 +0,0 @@
1
- import styled from "styled-components";
2
- import { FontFamily } from "../../../global-files/variables";
3
-
4
- export const Container = styled.div`
5
- border: 1px solid #f0f0f0;
6
- border-radius: 5px;
7
- color: #262626;
8
- font-size: 12px;
9
- font-family: ${FontFamily.Lato};
10
- display: flex;
11
- align-items: center;
12
- padding: 5px 10px;
13
- justify-content: space-between;
14
- cursor: pointer;
15
- position: relative;
16
- background-color: white;
17
-
18
- .image-and-name {
19
- display: flex;
20
- align-items: center;
21
-
22
- div + p {
23
- margin-left: 10px;
24
- white-space: nowrap;
25
- }
26
-
27
- & + * {
28
- margin-left: 10px;
29
- }
30
- }
31
-
32
- .icon-container {
33
- position: relative;
34
- span {
35
- color: #808080;
36
- cursor: pointer;
37
-
38
- & + span {
39
- display: none;
40
- position: absolute;
41
- right: 120%;
42
- top: 50%;
43
- transform: translateY(-50%);
44
- white-space: nowrap;
45
- border: 1px solid #f0f0f0;
46
- padding: 5px;
47
- background-color: white;
48
- }
49
-
50
- &:hover {
51
- & + span {
52
- display: block;
53
- }
54
- }
55
- }
56
- }
57
-
58
- & + * {
59
- margin-top: 5px;
60
- }
61
- `;
@@ -1,25 +0,0 @@
1
- import { UserSelector } from ".";
2
-
3
- export default {
4
- title: "Components/atoms/UserSelector",
5
- component: UserSelector,
6
- };
7
-
8
- const Template = (args) => <UserSelector {...args} />;
9
- export const UserSelectorDefault = Template.bind({});
10
- UserSelectorDefault.args = {
11
- searchLabel: "Buscar auditor",
12
- index: "auditor",
13
- usersArray: [
14
- {
15
- name: "José",
16
- last_name: "Castañeda",
17
- id_user: 37,
18
- },
19
- {
20
- name: "Eduardo ",
21
- last_name: " Reyes",
22
- id_user: 195,
23
- },
24
- ],
25
- };
@@ -1,86 +0,0 @@
1
- import { Container } from "./styles";
2
- import { faSearch } from "@fortawesome/free-solid-svg-icons";
3
- import { FontAwesomeIcon as Icon } from "@fortawesome/react-fontawesome";
4
- import { Avatar } from "../Avatar";
5
- import { getProfilePicture } from "../../../global-files/data";
6
- import { useState } from "react";
7
- import { useEffect } from "react";
8
-
9
- export const UserSelector = ({
10
- searchLabel,
11
- usersArray,
12
- position,
13
- id,
14
- onAssign,
15
- product,
16
- assignationTarget,
17
- target,
18
- concept,
19
- }) => {
20
- const [text, setText] = useState([]);
21
- const [userFiltered, setUsersFiltered] = useState([]);
22
-
23
- useEffect(() => {
24
- if (usersArray) setUsersFiltered(usersArray);
25
- }, [usersArray]);
26
-
27
- const onChangeText = (e) => {
28
- setText(e.target.value);
29
- if (usersArray)
30
- setUsersFiltered(
31
- usersArray.filter((user) =>
32
- (user.name + " " + user.last_name)
33
- .toLowerCase()
34
- .includes(e.target.value.toLowerCase())
35
- )
36
- );
37
- };
38
-
39
- return (
40
- <Container position={position} id={id + "users-list"}>
41
- <div className="search-cotainer">
42
- <Icon icon={faSearch} />
43
- <input
44
- type="text"
45
- className="search"
46
- placeholder={searchLabel}
47
- value={text}
48
- onChange={onChangeText}
49
- autoFocus
50
- />
51
- </div>
52
- <div className="selector-container">
53
- {userFiltered.length ? (
54
- userFiltered.map((user, i) => (
55
- <div
56
- key={user.id_user + "-" + i}
57
- className="user-item"
58
- onClick={() => {
59
- onAssign(
60
- product,
61
- user.id_user,
62
- assignationTarget,
63
- target,
64
- concept
65
- );
66
- }}
67
- >
68
- <Avatar
69
- image={getProfilePicture(user.id_user, 26, 26)}
70
- altText={"profile image"}
71
- imageType={"medium-image"}
72
- />
73
- <p>
74
- {user.name} {user.last_name}
75
- </p>
76
- </div>
77
- ))
78
- ) : (
79
- <div>
80
- <p>Sin usuarios para asignar</p>
81
- </div>
82
- )}
83
- </div>
84
- </Container>
85
- );
86
- };
@@ -1,55 +0,0 @@
1
- import styled from "styled-components";
2
- import { FontFamily } from "../../../global-files/variables";
3
-
4
- export const Container = styled.div`
5
- box-shadow: 0px 2px 4px #00000040;
6
- width: 197px;
7
- border-radius: 5px;
8
- position: ${({ position }) => (position ? position : "initial")};
9
- top: ${({ position }) => (position ? "100%" : "initial")};
10
- left: ${({ position }) => (position ? "50%" : "initial")};
11
- transform: ${({ position }) => (position ? "translateX(-50%)" : "initial")};
12
- z-index: 500;
13
- background-color: white;
14
-
15
- .search-cotainer {
16
- display: flex;
17
- padding-left: 10px;
18
- align-items: center;
19
- border-bottom: 1px solid #f0f0f0;
20
-
21
- svg {
22
- & + * {
23
- margin-left: 10px;
24
- }
25
- }
26
-
27
- input {
28
- border: none;
29
- width: 100%;
30
- padding: 10px;
31
- outline: none;
32
- }
33
- }
34
-
35
- .selector-container {
36
- max-height: 184px;
37
- overflow: auto;
38
- .user-item {
39
- display: flex;
40
- font-family: ${FontFamily.Lato};
41
- font-size: 12px;
42
- align-items: center;
43
- padding: 10px;
44
- cursor: pointer;
45
-
46
- &:hover {
47
- background-color: #f0f0f0;
48
- }
49
-
50
- > * + * {
51
- margin-left: 10px;
52
- }
53
- }
54
- }
55
- `;
@@ -1,126 +0,0 @@
1
- import { GridItem } from ".";
2
-
3
- export default { title: "Components/molecules/GridItem", component: GridItem };
4
-
5
- const Template = (args) => <GridItem {...args} />;
6
- export const GridItemDefault = Template.bind({});
7
- GridItemDefault.args = {
8
- article: {
9
- services: {
10
- datasheets: 1,
11
- descriptions: 1,
12
- images: 1,
13
- },
14
- orderId: 15254,
15
- status: "Ex",
16
- datasheet_status: "Ex",
17
- prio: "none",
18
- version: 15,
19
- description_status: "Ex",
20
- images_status: "Ex",
21
- statusByRetailer: {
22
- 70: {
23
- datasheet: "Ex",
24
- description: "Ex",
25
- images: "Ex",
26
- },
27
- },
28
- id_article: 38443,
29
- id_category: "4319",
30
- name: "Im Polvo Compacto Natural 2",
31
- upc: "7501611823017",
32
- timestamp: "2023-03-15T05:54:54.000Z",
33
- id_user: 133,
34
- status: "Ex",
35
- active: 1,
36
- company_id: 912,
37
- company_name: "GRUPO BRAHMA",
38
- country: "México",
39
- id_order: 15254,
40
- id_datasheet_especialist: 1841,
41
- id_datasheet_facilitator: null,
42
- id_description_especialist: 509,
43
- id_description_facilitator: null,
44
- id_images_especialist: 289,
45
- id_images_facilitator: 160,
46
- id_auditor: 493,
47
- id_recepcionist: null,
48
- category: "Salud y Belleza|Cosméticos|Cosméticos",
49
- missingAttributes: 0,
50
- missingDescriptions: 0,
51
- missingImages: 0,
52
- retailers: [
53
- {
54
- id: 70,
55
- name: "Bodega Aurrera",
56
- },
57
- ],
58
- country: "México",
59
- upc: "7501611823017",
60
- imageArray: [
61
- {
62
- id: 35596,
63
- status: null,
64
- image_id: 1,
65
- packing_type: "3",
66
- image_type: "1",
67
- article_id: "38443",
68
- src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMS1kNDQ2ZjIwNy0wYTkzLTQyNzgtYWZjNi01MTY2ZjIyY2EzNDMucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
69
- timestamp: "2023-05-30T03:01:12.000Z",
70
- id_version: 15,
71
- width: null,
72
- height: null,
73
- scene_type: null,
74
- image_shot_type: null,
75
- last_modified: "2023-06-05T23:49:49.000Z",
76
- name: "Central (Frente Comercial)",
77
- version: 15,
78
- ext: "png",
79
- uuid: "d446f207-0a93-4278-afc6-5166f22ca343",
80
- srcDB: "id-38443/15/1-d446f207-0a93-4278-afc6-5166f22ca343.png",
81
- },
82
- {
83
- id: 35597,
84
- status: null,
85
- image_id: 3,
86
- packing_type: "3",
87
- image_type: "1",
88
- article_id: "38443",
89
- src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMy0yOTZkMzU3ZC00OTUzLTRiMzktYjFjMy04YWZmZDI2NDgwMWIucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
90
- timestamp: "2023-05-30T03:01:12.000Z",
91
- id_version: 15,
92
- width: null,
93
- height: null,
94
- scene_type: null,
95
- image_shot_type: null,
96
- last_modified: "2023-06-05T23:49:49.000Z",
97
- name: "Trasera (Back)",
98
- version: 15,
99
- ext: "png",
100
- uuid: "296d357d-4953-4b39-b1c3-8affd264801b",
101
- srcDB: "id-38443/15/3-296d357d-4953-4b39-b1c3-8affd264801b.png",
102
- },
103
- {
104
- id: 35598,
105
- status: null,
106
- image_id: 16,
107
- packing_type: "3",
108
- image_type: "1",
109
- article_id: "38443",
110
- src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMTYtOGMzNDIzM2YtZTRiMC00MjU0LWFlYzUtZjEyN2ZiYjhkYmVkLnBuZyIsImVkaXRzIjp7InJlc2l6ZSI6eyJ3aWR0aCI6MTAwMCwiaGVpZ2h0IjoxMDAwLCJmaXQiOiJjb250YWluIiwiYmFja2dyb3VuZCI6eyJyIjoyNTUsImciOjI1NSwiYiI6MjU1LCJhbHBoYSI6MX19fX0=",
111
- timestamp: "2023-05-30T03:01:12.000Z",
112
- id_version: 15,
113
- width: null,
114
- height: null,
115
- scene_type: null,
116
- image_shot_type: null,
117
- last_modified: "2023-06-05T23:49:49.000Z",
118
- name: "Detalle / Características 1",
119
- version: 15,
120
- ext: "png",
121
- uuid: "8c34233f-e4b0-4254-aec5-f127fbb8dbed",
122
- srcDB: "id-38443/15/16-8c34233f-e4b0-4254-aec5-f127fbb8dbed.png",
123
- },
124
- ],
125
- },
126
- };
@@ -1,97 +0,0 @@
1
- import { Container } from "./styles";
2
- import { ImageCarousel } from "../../atoms/ImageCarousel";
3
- import { Status } from "../../atoms/Status";
4
- import { PercentTag } from "../../atoms/PercentTag";
5
- import { ButtonV2 } from "../../atoms/ButtonV2";
6
- import { faStar as starIcon } from "@fortawesome/free-regular-svg-icons";
7
- import { faCartPlus as cartIcon } from "@fortawesome/free-solid-svg-icons";
8
- import { RatingStars } from "../../atoms/RatingStars";
9
- import { CheckBox } from "../../atoms/CheckBox";
10
-
11
- export const GridItem = ({
12
- gridElement = {},
13
- product,
14
- id,
15
- isMerchans,
16
- chkOnChange,
17
- onGridClick,
18
- chkChecked,
19
- index,
20
- }) => {
21
- const { images = [], info = [], status = [], catalogs = {} } = gridElement;
22
-
23
- const getSrvName = (srv) => {
24
- switch (srv) {
25
- case "datasheet":
26
- return "F.T.";
27
- case "description":
28
- return "D.C.";
29
- case "images":
30
- return "IMG";
31
- }
32
- };
33
-
34
- return (
35
- <Container onClick={(e) => onGridClick && onGridClick(e, product, index)}>
36
- <div className="chk-container" onClick={(e) => e.stopPropagation()}>
37
- <CheckBox
38
- id={id}
39
- name={id}
40
- className="chk-absolute"
41
- onChange={(e) => chkOnChange && chkOnChange(e, product)}
42
- defaultChecked={chkChecked && chkChecked(product)}
43
- />
44
- </div>
45
- <ImageCarousel imageArray={images} />
46
- <div className="data-body">
47
- {info?.map((item, i) =>
48
- i === 0 ? <h3 key={i}>{item.value}</h3> : <p key={i}>{item.value}</p>
49
- )}
50
- </div>
51
- <div className="status-slider">
52
- {status?.map((item) => (
53
- <div className="status-element">
54
- <div className="srv-name">
55
- <p>{getSrvName(item.title)}</p>
56
- </div>
57
- <Status statusType={item.value} />
58
- <PercentTag percent={item.percent} progressBarType={item.value} />
59
- </div>
60
- ))}
61
- </div>
62
- {isMerchans ? (
63
- <div className="cart-and-raiting">
64
- <ButtonV2
65
- borderType="circle"
66
- type="whiteS2"
67
- icon={starIcon}
68
- size={10}
69
- className="star-button"
70
- />
71
- <ButtonV2
72
- borderType="circle"
73
- type="whiteS2"
74
- icon={cartIcon}
75
- size={10}
76
- className="star-button"
77
- />
78
- <ButtonV2
79
- borderType="circle"
80
- type="whiteS2"
81
- icon={cartIcon}
82
- size={10}
83
- className="star-button"
84
- />
85
- <RatingStars ratingValue={4} />
86
- </div>
87
- ) : (
88
- catalogs && (
89
- <div className="retailers-and-user">
90
- <div className="retailers-container">{catalogs.leftSide}</div>
91
- <div className="users-container">{catalogs.rightSide}</div>
92
- </div>
93
- )
94
- )}
95
- </Container>
96
- );
97
- };