contentoh-components-library 21.3.94 → 21.3.96

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 (153) hide show
  1. package/.env.development +5 -0
  2. package/.env.production +3 -0
  3. package/dist/components/atoms/Avatar/index.js +3 -2
  4. package/dist/components/atoms/Card/index.js +46 -5
  5. package/dist/components/atoms/Card/styles.js +3 -1
  6. package/dist/components/atoms/CheckBox/index.js +7 -2
  7. package/dist/components/atoms/CheckBox/styles.js +1 -1
  8. package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +90 -0
  9. package/dist/components/atoms/ImageCarousel/index.js +120 -0
  10. package/dist/components/atoms/ImageCarousel/styles.js +18 -0
  11. package/dist/components/atoms/InputFormatter/styles.js +1 -1
  12. package/dist/components/atoms/PercentTag/PercentTag.stories.js +31 -0
  13. package/dist/components/atoms/PercentTag/index.js +23 -0
  14. package/dist/components/atoms/PercentTag/styles.js +22 -0
  15. package/dist/components/atoms/RatingStars/RatingStars.stories.js +30 -0
  16. package/dist/components/atoms/RatingStars/index.js +53 -0
  17. package/dist/components/atoms/RatingStars/styles.js +18 -0
  18. package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +48 -0
  19. package/dist/components/atoms/RetailerCatalog/index.js +70 -0
  20. package/dist/components/atoms/RetailerCatalog/styles.js +20 -0
  21. package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +33 -0
  22. package/dist/components/atoms/RetailerOption/index.js +62 -0
  23. package/dist/components/atoms/RetailerOption/styles.js +20 -0
  24. package/dist/components/atoms/RetailersList/RetailersList.stories.js +45 -0
  25. package/dist/components/atoms/RetailersList/index.js +44 -0
  26. package/dist/components/atoms/RetailersList/styles.js +18 -0
  27. package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +72 -0
  28. package/dist/components/atoms/UserCatalog/index.js +89 -0
  29. package/dist/components/atoms/UserCatalog/styles.js +18 -0
  30. package/dist/components/atoms/UserOption/UserOption.stories.js +40 -0
  31. package/dist/components/atoms/UserOption/index.js +80 -0
  32. package/dist/components/atoms/UserOption/styles.js +20 -0
  33. package/dist/components/atoms/UserSelector/UserSelector.stories.js +40 -0
  34. package/dist/components/atoms/UserSelector/index.js +91 -0
  35. package/dist/components/atoms/UserSelector/styles.js +32 -0
  36. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  37. package/dist/components/molecules/GridItem/GridItem.stories.js +123 -0
  38. package/dist/components/molecules/GridItem/index.js +122 -0
  39. package/dist/components/molecules/GridItem/styles.js +20 -0
  40. package/dist/components/molecules/HeaderItem/ColumnItem.js +23 -0
  41. package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +70 -0
  42. package/dist/components/molecules/HeaderItem/index.js +42 -0
  43. package/dist/components/molecules/HeaderItem/styles.js +30 -0
  44. package/dist/components/molecules/HeaderTop/index.js +68 -11
  45. package/dist/components/molecules/RowItem/ColumnItem.js +23 -0
  46. package/dist/components/molecules/RowItem/RowItem.stories.js +5242 -0
  47. package/dist/components/molecules/RowItem/index.js +59 -0
  48. package/dist/components/molecules/RowItem/styles.js +30 -0
  49. package/dist/components/molecules/TabsMenu/index.js +7 -13
  50. package/dist/components/molecules/TagAndInput/index.js +1 -1
  51. package/dist/components/organisms/Chat/Chat.stories.js +27 -8
  52. package/dist/components/organisms/Chat/ContainerItems/index.js +19 -3
  53. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  54. package/dist/components/organisms/Chat/ContentChat/index.js +350 -197
  55. package/dist/components/organisms/Chat/Footer/index.js +48 -39
  56. package/dist/components/organisms/Chat/index.js +49 -4
  57. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  58. package/dist/components/organisms/FullTabsMenu/index.js +1 -3
  59. package/dist/components/organisms/GridProducts/GridProducts.stories.js +5093 -0
  60. package/dist/components/organisms/GridProducts/index.js +68 -0
  61. package/dist/components/organisms/GridProducts/styles.js +18 -0
  62. package/dist/components/organisms/GridProducts/utils.js +139 -0
  63. package/dist/components/organisms/Modal/styles.js +1 -1
  64. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +171 -96
  65. package/dist/components/pages/ProviderProductEdition/index.js +190 -178
  66. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  67. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +77 -52
  68. package/dist/components/pages/RetailerProductEdition/index.js +290 -276
  69. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  70. package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
  71. package/dist/index.js +182 -52
  72. package/package.json +4 -1
  73. package/src/components/atoms/Avatar/index.js +8 -2
  74. package/src/components/atoms/Card/index.js +35 -2
  75. package/src/components/atoms/Card/styles.js +41 -5
  76. package/src/components/atoms/CheckBox/index.js +4 -1
  77. package/src/components/atoms/CheckBox/styles.js +2 -0
  78. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +76 -0
  79. package/src/components/atoms/ImageCarousel/index.js +103 -0
  80. package/src/components/atoms/ImageCarousel/styles.js +79 -0
  81. package/src/components/atoms/InputFormatter/styles.js +2 -1
  82. package/src/components/atoms/PercentTag/PercentTag.stories.js +7 -0
  83. package/src/components/atoms/PercentTag/index.js +9 -0
  84. package/src/components/atoms/PercentTag/styles.js +69 -0
  85. package/src/components/atoms/RatingStars/RatingStars.stories.js +10 -0
  86. package/src/components/atoms/RatingStars/index.js +31 -0
  87. package/src/components/atoms/RatingStars/styles.js +28 -0
  88. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +36 -0
  89. package/src/components/atoms/RetailerCatalog/index.js +50 -0
  90. package/src/components/atoms/RetailerCatalog/styles.js +30 -0
  91. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +15 -0
  92. package/src/components/atoms/RetailerOption/index.js +53 -0
  93. package/src/components/atoms/RetailerOption/styles.js +41 -0
  94. package/src/components/atoms/RetailersList/RetailersList.stories.js +33 -0
  95. package/src/components/atoms/RetailersList/index.js +20 -0
  96. package/src/components/atoms/RetailersList/styles.js +19 -0
  97. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +66 -0
  98. package/src/components/atoms/UserCatalog/index.js +77 -0
  99. package/src/components/atoms/UserCatalog/styles.js +24 -0
  100. package/src/components/atoms/UserOption/UserOption.stories.js +25 -0
  101. package/src/components/atoms/UserOption/index.js +49 -0
  102. package/src/components/atoms/UserOption/styles.js +54 -0
  103. package/src/components/atoms/UserSelector/UserSelector.stories.js +25 -0
  104. package/src/components/atoms/UserSelector/index.js +70 -0
  105. package/src/components/atoms/UserSelector/styles.js +55 -0
  106. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  107. package/src/components/molecules/GridItem/GridItem.stories.js +126 -0
  108. package/src/components/molecules/GridItem/index.js +82 -0
  109. package/src/components/molecules/GridItem/styles.js +85 -0
  110. package/src/components/molecules/HeaderItem/ColumnItem.js +9 -0
  111. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +24 -0
  112. package/src/components/molecules/HeaderItem/index.js +26 -0
  113. package/src/components/molecules/HeaderItem/styles.js +25 -0
  114. package/src/components/molecules/HeaderTop/index.js +52 -6
  115. package/src/components/molecules/RowItem/ColumnItem.js +9 -0
  116. package/src/components/molecules/RowItem/RowItem.stories.js +5660 -0
  117. package/src/components/molecules/RowItem/index.js +45 -0
  118. package/src/components/molecules/RowItem/styles.js +38 -0
  119. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +13 -0
  120. package/src/components/molecules/StripeCardForm/index.js +42 -0
  121. package/src/components/molecules/StripeCardForm/paymentForm.js +124 -0
  122. package/src/components/molecules/StripeCardForm/styles.js +73 -0
  123. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +12 -0
  124. package/src/components/molecules/StripeCardSelector/index.js +44 -0
  125. package/src/components/molecules/StripeCardSelector/styles.js +4 -0
  126. package/src/components/molecules/StripeCardSelector/utils.js +17 -0
  127. package/src/components/molecules/TabsMenu/index.js +10 -16
  128. package/src/components/molecules/TagAndInput/index.js +10 -8
  129. package/src/components/organisms/Chat/Chat.stories.js +27 -7
  130. package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
  131. package/src/components/organisms/Chat/ContainerItems/styles.js +10 -2
  132. package/src/components/organisms/Chat/ContentChat/index.js +88 -12
  133. package/src/components/organisms/Chat/Footer/index.js +11 -0
  134. package/src/components/organisms/Chat/index.js +46 -4
  135. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  136. package/src/components/organisms/FullTabsMenu/index.js +1 -3
  137. package/src/components/organisms/GridProducts/GridProducts.stories.js +5474 -0
  138. package/src/components/organisms/GridProducts/index.js +53 -0
  139. package/src/components/organisms/GridProducts/styles.js +15 -0
  140. package/src/components/organisms/GridProducts/utils.js +103 -0
  141. package/src/components/organisms/Modal/styles.js +4 -1
  142. package/src/components/organisms/SideModal/SideModal.stories.js +23 -0
  143. package/src/components/organisms/SideModal/index.js +50 -0
  144. package/src/components/organisms/SideModal/styles.js +30 -0
  145. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +181 -98
  146. package/src/components/pages/ProviderProductEdition/index.js +134 -132
  147. package/src/components/pages/ProviderProductEdition/styles.js +5 -1
  148. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +76 -46
  149. package/src/components/pages/RetailerProductEdition/index.js +123 -138
  150. package/src/components/pages/RetailerProductEdition/styles.js +4 -0
  151. package/src/components/pages/RetailerProductEdition/utils.js +37 -0
  152. package/src/index.js +11 -0
  153. package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
@@ -0,0 +1,126 @@
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
+ };
@@ -0,0 +1,82 @@
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
+ }) => {
20
+ const { images = [], info = [], status = [], catalogs = {} } = gridElement;
21
+
22
+ return (
23
+ <Container onClick={() => onGridClick && onGridClick(product)}>
24
+ <div className="chk-container" onClick={(e) => e.stopPropagation()}>
25
+ <CheckBox
26
+ id={id}
27
+ name={id}
28
+ className="chk-absolute"
29
+ onChange={(e) => chkOnChange && chkOnChange(e, product)}
30
+ defaultChecked={chkChecked && chkChecked(product)}
31
+ />
32
+ </div>
33
+ <ImageCarousel imageArray={images} />
34
+ <div className="data-body">
35
+ {info?.map((item, i) =>
36
+ i === 0 ? <h3 key={i}>{item.value}</h3> : <p key={i}>{item.value}</p>
37
+ )}
38
+ </div>
39
+ <div className="status-slider">
40
+ {status?.map((item) => (
41
+ <>
42
+ <Status statusType={item.value} />
43
+ <PercentTag percent={item.percent} progressBarType={item.value} />
44
+ </>
45
+ ))}
46
+ </div>
47
+ {isMerchans ? (
48
+ <div className="cart-and-raiting">
49
+ <ButtonV2
50
+ borderType="circle"
51
+ type="whiteS2"
52
+ icon={starIcon}
53
+ size={10}
54
+ className="star-button"
55
+ />
56
+ <ButtonV2
57
+ borderType="circle"
58
+ type="whiteS2"
59
+ icon={cartIcon}
60
+ size={10}
61
+ className="star-button"
62
+ />
63
+ <ButtonV2
64
+ borderType="circle"
65
+ type="whiteS2"
66
+ icon={cartIcon}
67
+ size={10}
68
+ className="star-button"
69
+ />
70
+ <RatingStars ratingValue={4} />
71
+ </div>
72
+ ) : (
73
+ catalogs && (
74
+ <div className="retailers-and-user">
75
+ <div className="retailers-container">{catalogs.leftSide}</div>
76
+ <div className="users-container">{catalogs.rightSide}</div>
77
+ </div>
78
+ )
79
+ )}
80
+ </Container>
81
+ );
82
+ };
@@ -0,0 +1,85 @@
1
+ import styled from "styled-components";
2
+ import { FontFamily } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ width: 175px;
6
+ border: 1px solid #f0f0f0;
7
+ position: relative;
8
+
9
+ .chk-container {
10
+ position: absolute;
11
+ top: 5px;
12
+ left: 5px;
13
+ z-index: 10;
14
+ height: 16px;
15
+ }
16
+
17
+ .data-body {
18
+ padding: 10px;
19
+ border-bottom: 1px solid #f0f0f0;
20
+
21
+ h3,
22
+ p {
23
+ color: #262626;
24
+ font-family: ${FontFamily.Lato};
25
+ font-size: 12px;
26
+ line-height: 16px;
27
+ overflow: hidden;
28
+ white-space: nowrap;
29
+ text-overflow: ellipsis;
30
+
31
+ & + p {
32
+ margin-top: 5px;
33
+ }
34
+ }
35
+ p {
36
+ font-size: 10px;
37
+ line-height: 12px;
38
+ color: #808080;
39
+ }
40
+ }
41
+
42
+ .status-slider {
43
+ display: flex;
44
+ padding: 5px 10px;
45
+ overflow: auto;
46
+ border-bottom: 1px solid #f0f0f0;
47
+ flex-wrap: nowrap;
48
+
49
+ .status-element {
50
+ display: flex;
51
+ }
52
+
53
+ * + * {
54
+ margin-left: 10px;
55
+ }
56
+ }
57
+
58
+ .cart-and-raiting,
59
+ .retailers-and-user {
60
+ display: flex;
61
+ align-items: center;
62
+ justify-content: space-between;
63
+ padding: 5px 10px;
64
+ .star-button {
65
+ button {
66
+ padding: 3px;
67
+ color: transparent;
68
+ -webkit-text-stroke: 1px #808080;
69
+ }
70
+ }
71
+ }
72
+
73
+ .retailers-and-user {
74
+ padding: 0;
75
+ > * {
76
+ flex: 1 0 50%;
77
+ display: flex;
78
+ padding: 5px;
79
+ height: 36px;
80
+ }
81
+ .retailers-container {
82
+ border-right: 1px solid #f0f0f0;
83
+ }
84
+ }
85
+ `;
@@ -0,0 +1,9 @@
1
+ import { Column } from "./styles";
2
+
3
+ export const ColumnItem = ({ name, flex, minWidth }) => {
4
+ return (
5
+ <Column flex={flex} minWidth={minWidth}>
6
+ {name}
7
+ </Column>
8
+ );
9
+ };
@@ -0,0 +1,24 @@
1
+ import { HeaderItem } from ".";
2
+
3
+ export default {
4
+ title: "Components/molecules/HeaderItem",
5
+ component: HeaderItem,
6
+ };
7
+
8
+ const Template = (args) => <HeaderItem {...args} />;
9
+ export const HeaderItemDefault = Template.bind({});
10
+
11
+ HeaderItemDefault.args = {
12
+ columnsArray: [
13
+ { name: "Reg", flex: 1, minWidth: 100 },
14
+ { name: "Orden", flex: 1, minWidth: 100 },
15
+ { name: "UPC", flex: 1, minWidth: 100 },
16
+ { name: "Nombre", flex: 1, minWidth: 100 },
17
+ { name: "Marca", flex: 1, minWidth: 100 },
18
+ { name: "Estatus", flex: 1, minWidth: 100 },
19
+ { name: "Cadenas", flex: 1, minWidth: 100 },
20
+ { name: "Prio", flex: 1, minWidth: 100 },
21
+ { name: "E.D", flex: 1, minWidth: 100 },
22
+ { name: "Cont.", flex: 1, minWidth: 100 },
23
+ ],
24
+ };
@@ -0,0 +1,26 @@
1
+ import { Container } from "./styles";
2
+ import { ColumnItem } from "./ColumnItem";
3
+ import { CheckBox } from "../../atoms/CheckBox";
4
+
5
+ export const HeaderItem = ({ columnsArray = [], checkAll, chkCheckedAll }) => {
6
+ return (
7
+ <Container>
8
+ <div className="chk-global-container">
9
+ <CheckBox
10
+ id={"chk-global"}
11
+ name={"chk-global"}
12
+ onChange={(e) => checkAll && checkAll(e)}
13
+ checked={chkCheckedAll && chkCheckedAll()}
14
+ />
15
+ </div>
16
+ {columnsArray.map((col, i) => (
17
+ <ColumnItem
18
+ key={i}
19
+ flex={col.flex}
20
+ name={col.name}
21
+ minWidth={col.minWidth}
22
+ />
23
+ ))}
24
+ </Container>
25
+ );
26
+ };
@@ -0,0 +1,25 @@
1
+ import styled from "styled-components";
2
+ import { FontFamily } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ background-color: #f0f0f0;
6
+ display: flex;
7
+
8
+ .chk-global-container {
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: center;
12
+ min-width: 30px;
13
+ }
14
+ `;
15
+
16
+ export const Column = styled.div`
17
+ flex: ${({ flex }) => (flex ? flex : 1)};
18
+ min-width: ${({ minWidth }) => (minWidth ? minWidth : 100)}px;
19
+ text-align: center;
20
+ color: #262626;
21
+ font-family: ${FontFamily.Lato};
22
+ font-size: 12px;
23
+ line-height: 16px;
24
+ padding: 10px 5px;
25
+ `;
@@ -4,10 +4,13 @@ import { Button } from "../../atoms/GeneralButton/index";
4
4
  import { useEffect, useRef } from "react";
5
5
  import { Chat } from "../../organisms/Chat";
6
6
  import auditIcon from "../../../../src/assets/images/generalButton/Icono AB.svg";
7
+ import { useState } from "react";
8
+ import { render } from "@testing-library/react";
7
9
 
8
10
  export const HeaderTop = ({
9
11
  setHeaderTop,
10
12
  withChat,
13
+ chatType,
11
14
  productSelected,
12
15
  token,
13
16
  auditableVersion,
@@ -16,16 +19,51 @@ export const HeaderTop = ({
16
19
  activeRetailer,
17
20
  }) => {
18
21
  const headerTop = useRef();
22
+ const [chat, setChat] = useState(null);
23
+ const [chatData, setChatData] = useState(null);
24
+
25
+ useEffect(() => {
26
+ if (activeRetailer.id && productSelected && token.length) {
27
+ setChatData({
28
+ id: productSelected?.article?.id_article || productSelected?.id_article,
29
+ version: productSelected?.version,
30
+ retailerId: activeRetailer?.id,
31
+ status: productSelected?.status,
32
+ userToken: token,
33
+ });
34
+ }
35
+ }, [activeRetailer, productSelected, token]);
36
+
37
+ useEffect(() => {
38
+ if (chatType) renderChat(chatType);
39
+ }, [chatData, chatType]);
19
40
 
20
41
  useEffect(() => {
21
42
  setHeaderTop && setHeaderTop(headerTop.current.clientHeight);
22
43
  }, []);
23
44
 
24
- return (
25
- <Container ref={headerTop}>
26
- <ScreenHeader text="Edición de producto" />
27
- <div className="buttons-container">
28
- {withChat && (
45
+ const renderChat = (chatType) => {
46
+ switch (chatType) {
47
+ case "product_status":
48
+ chatData &&
49
+ setChat(
50
+ <Chat
51
+ chatType="product_status"
52
+ chatContainerType="popUp"
53
+ chatData={{
54
+ id: chatData?.id,
55
+ version: chatData?.version,
56
+ retailerId: chatData?.retailerId,
57
+ status: chatData?.status,
58
+ userToken: chatData?.userToken,
59
+ }}
60
+ size={18}
61
+ activeRetailer={activeRetailer}
62
+ />
63
+ );
64
+ break;
65
+ default:
66
+ setChat(
29
67
  <Chat
30
68
  chatType="merchant_product"
31
69
  chatContainerType="popUp"
@@ -37,8 +75,16 @@ export const HeaderTop = ({
37
75
  size={18}
38
76
  activeRetailer={activeRetailer}
39
77
  />
40
- )}
78
+ );
79
+ break;
80
+ }
81
+ };
41
82
 
83
+ return (
84
+ <Container ref={headerTop}>
85
+ <ScreenHeader text="Edición de producto" />
86
+ <div className="buttons-container">
87
+ {withChat && chat}
42
88
  {isAuditor && auditableVersion && (
43
89
  <Button
44
90
  buttonType="general-white-button circular-button"
@@ -0,0 +1,9 @@
1
+ import { Column } from "./styles";
2
+
3
+ export const ColumnItem = ({ element, flex, minWidth }) => {
4
+ return (
5
+ <Column flex={flex} minWidth={minWidth}>
6
+ {element}
7
+ </Column>
8
+ );
9
+ };