contentoh-components-library 21.4.22 → 21.4.24

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 (168) hide show
  1. package/.env.development +2 -5
  2. package/.env.production +1 -3
  3. package/dist/components/atoms/Avatar/index.js +2 -3
  4. package/dist/components/atoms/Card/index.js +5 -46
  5. package/dist/components/atoms/Card/styles.js +1 -3
  6. package/dist/components/atoms/CheckBox/index.js +2 -7
  7. package/dist/components/atoms/CheckBox/styles.js +1 -1
  8. package/dist/components/atoms/InputFormatter/styles.js +1 -1
  9. package/dist/components/atoms/SliderToolTip/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 +116 -60
  22. package/dist/components/pages/ProviderProductEdition/index.js +142 -117
  23. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  24. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +4 -8
  25. package/dist/components/pages/RetailerProductEdition/index.js +308 -316
  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 -247
  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/atoms/SliderToolTip/styles.js +1 -1
  37. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  38. package/src/components/molecules/HeaderTop/index.js +6 -52
  39. package/src/components/molecules/TagAndInput/index.js +8 -10
  40. package/src/components/organisms/Chat/Chat.stories.js +7 -27
  41. package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
  42. package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
  43. package/src/components/organisms/Chat/ContentChat/index.js +12 -88
  44. package/src/components/organisms/Chat/Footer/index.js +0 -11
  45. package/src/components/organisms/Chat/index.js +4 -46
  46. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  47. package/src/components/organisms/Modal/styles.js +1 -4
  48. package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
  49. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +116 -66
  50. package/src/components/pages/ProviderProductEdition/index.js +129 -97
  51. package/src/components/pages/ProviderProductEdition/styles.js +1 -5
  52. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +3 -7
  53. package/src/components/pages/RetailerProductEdition/index.js +184 -158
  54. package/src/components/pages/RetailerProductEdition/styles.js +0 -4
  55. package/src/components/pages/RetailerProductEdition/utils.js +0 -37
  56. package/src/index.js +0 -16
  57. package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -90
  58. package/dist/components/atoms/ImageCarousel/index.js +0 -120
  59. package/dist/components/atoms/ImageCarousel/styles.js +0 -18
  60. package/dist/components/atoms/PercentTag/PercentTag.stories.js +0 -31
  61. package/dist/components/atoms/PercentTag/index.js +0 -23
  62. package/dist/components/atoms/PercentTag/styles.js +0 -22
  63. package/dist/components/atoms/RatingStars/RatingStars.stories.js +0 -30
  64. package/dist/components/atoms/RatingStars/index.js +0 -53
  65. package/dist/components/atoms/RatingStars/styles.js +0 -18
  66. package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -48
  67. package/dist/components/atoms/RetailerCatalog/index.js +0 -69
  68. package/dist/components/atoms/RetailerCatalog/styles.js +0 -20
  69. package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +0 -33
  70. package/dist/components/atoms/RetailerOption/index.js +0 -62
  71. package/dist/components/atoms/RetailerOption/styles.js +0 -20
  72. package/dist/components/atoms/RetailersList/RetailersList.stories.js +0 -45
  73. package/dist/components/atoms/RetailersList/index.js +0 -46
  74. package/dist/components/atoms/RetailersList/styles.js +0 -18
  75. package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +0 -73
  76. package/dist/components/atoms/UserCatalog/index.js +0 -101
  77. package/dist/components/atoms/UserCatalog/styles.js +0 -18
  78. package/dist/components/atoms/UserOption/UserOption.stories.js +0 -40
  79. package/dist/components/atoms/UserOption/index.js +0 -130
  80. package/dist/components/atoms/UserOption/styles.js +0 -20
  81. package/dist/components/atoms/UserSelector/UserSelector.stories.js +0 -40
  82. package/dist/components/atoms/UserSelector/index.js +0 -98
  83. package/dist/components/atoms/UserSelector/styles.js +0 -32
  84. package/dist/components/molecules/GridItem/GridItem.stories.js +0 -123
  85. package/dist/components/molecules/GridItem/index.js +0 -152
  86. package/dist/components/molecules/GridItem/styles.js +0 -20
  87. package/dist/components/molecules/HeaderItem/ColumnItem.js +0 -23
  88. package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +0 -70
  89. package/dist/components/molecules/HeaderItem/index.js +0 -42
  90. package/dist/components/molecules/HeaderItem/styles.js +0 -30
  91. package/dist/components/molecules/RowItem/ColumnItem.js +0 -23
  92. package/dist/components/molecules/RowItem/RowItem.stories.js +0 -5242
  93. package/dist/components/molecules/RowItem/index.js +0 -58
  94. package/dist/components/molecules/RowItem/styles.js +0 -30
  95. package/dist/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -31
  96. package/dist/components/molecules/StripeCardForm/index.js +0 -87
  97. package/dist/components/molecules/StripeCardForm/paymentForm.js +0 -191
  98. package/dist/components/molecules/StripeCardForm/styles.js +0 -24
  99. package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -30
  100. package/dist/components/molecules/StripeCardSelector/index.js +0 -107
  101. package/dist/components/molecules/StripeCardSelector/styles.js +0 -19
  102. package/dist/components/molecules/StripeCardSelector/utils.js +0 -56
  103. package/dist/components/organisms/GridProducts/GridProducts.stories.js +0 -5097
  104. package/dist/components/organisms/GridProducts/index.js +0 -63
  105. package/dist/components/organisms/GridProducts/styles.js +0 -18
  106. package/dist/components/organisms/GridProducts/utils.js +0 -149
  107. package/dist/components/organisms/PanelLayout/PanelLayout.stories.js +0 -87
  108. package/dist/components/organisms/PanelLayout/index.js +0 -29
  109. package/dist/components/organisms/PanelLayout/styles.js +0 -32
  110. package/dist/components/organisms/SideModal/SideModal.stories.js +0 -42
  111. package/dist/components/organisms/SideModal/index.js +0 -72
  112. package/dist/components/organisms/SideModal/styles.js +0 -18
  113. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
  114. package/src/components/atoms/ImageCarousel/index.js +0 -103
  115. package/src/components/atoms/ImageCarousel/styles.js +0 -79
  116. package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
  117. package/src/components/atoms/PercentTag/index.js +0 -9
  118. package/src/components/atoms/PercentTag/styles.js +0 -69
  119. package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
  120. package/src/components/atoms/RatingStars/index.js +0 -31
  121. package/src/components/atoms/RatingStars/styles.js +0 -28
  122. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
  123. package/src/components/atoms/RetailerCatalog/index.js +0 -49
  124. package/src/components/atoms/RetailerCatalog/styles.js +0 -30
  125. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
  126. package/src/components/atoms/RetailerOption/index.js +0 -53
  127. package/src/components/atoms/RetailerOption/styles.js +0 -41
  128. package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
  129. package/src/components/atoms/RetailersList/index.js +0 -20
  130. package/src/components/atoms/RetailersList/styles.js +0 -19
  131. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
  132. package/src/components/atoms/UserCatalog/index.js +0 -100
  133. package/src/components/atoms/UserCatalog/styles.js +0 -24
  134. package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
  135. package/src/components/atoms/UserOption/index.js +0 -95
  136. package/src/components/atoms/UserOption/styles.js +0 -61
  137. package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
  138. package/src/components/atoms/UserSelector/index.js +0 -86
  139. package/src/components/atoms/UserSelector/styles.js +0 -55
  140. package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
  141. package/src/components/molecules/GridItem/index.js +0 -105
  142. package/src/components/molecules/GridItem/styles.js +0 -104
  143. package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
  144. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
  145. package/src/components/molecules/HeaderItem/index.js +0 -26
  146. package/src/components/molecules/HeaderItem/styles.js +0 -27
  147. package/src/components/molecules/RowItem/ColumnItem.js +0 -9
  148. package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
  149. package/src/components/molecules/RowItem/index.js +0 -45
  150. package/src/components/molecules/RowItem/styles.js +0 -40
  151. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
  152. package/src/components/molecules/StripeCardForm/index.js +0 -42
  153. package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
  154. package/src/components/molecules/StripeCardForm/styles.js +0 -73
  155. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
  156. package/src/components/molecules/StripeCardSelector/index.js +0 -44
  157. package/src/components/molecules/StripeCardSelector/styles.js +0 -4
  158. package/src/components/molecules/StripeCardSelector/utils.js +0 -17
  159. package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
  160. package/src/components/organisms/GridProducts/index.js +0 -50
  161. package/src/components/organisms/GridProducts/styles.js +0 -14
  162. package/src/components/organisms/GridProducts/utils.js +0 -111
  163. package/src/components/organisms/PanelLayout/PanelLayout.stories.js +0 -63
  164. package/src/components/organisms/PanelLayout/index.js +0 -11
  165. package/src/components/organisms/PanelLayout/styles.js +0 -39
  166. package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
  167. package/src/components/organisms/SideModal/index.js +0 -50
  168. package/src/components/organisms/SideModal/styles.js +0 -30
@@ -1,103 +0,0 @@
1
- import { Container } from "./styles";
2
- import { useState, useEffect } from "react";
3
- import ReactImageFallback from "react-image-fallback";
4
- import spinner from "../../../assets/images/Icons/Spinner.gif";
5
- import ArrowBackIosIcon from "@mui/icons-material/ArrowBackIos";
6
- import productImage from "../../../assets/images/defaultImages/defaultProductImage.png";
7
-
8
- export const ImageCarousel = ({ imageArray = [] }) => {
9
- const [currentIndex, setCurrentIndex] = useState(0);
10
- const [transitioning, setTransitioning] = useState(false);
11
- const [isHover, setIsHover] = useState(false);
12
-
13
- const goToNextSlide = () => {
14
- if (!transitioning) {
15
- setTransitioning(true);
16
- setCurrentIndex((prevIndex) => (prevIndex + 1) % imageArray.length);
17
-
18
- setTimeout(() => {
19
- setTransitioning(false);
20
- }, 500); // Adjust the transition duration to match your CSS
21
- }
22
- };
23
-
24
- const goToPrevSlide = () => {
25
- if (!transitioning) {
26
- setTransitioning(true);
27
- setCurrentIndex(
28
- (prevIndex) => (prevIndex - 1 + imageArray.length) % imageArray.length
29
- );
30
-
31
- setTimeout(() => {
32
- setTransitioning(false);
33
- }, 500); // Adjust the transition duration to match your CSS
34
- }
35
- };
36
-
37
- // useEffect(() => {
38
- // const delay = 0;
39
- // let repeat;
40
- // setTimeout(() => {
41
- // repeat = setInterval(() => {
42
- // if (!isHover && imageArray.length > 1) goToNextSlide();
43
- // }, 10000);
44
- // }, delay);
45
- // return () => {
46
- // clearInterval(repeat);
47
- // };
48
- // }, [isHover]);
49
-
50
- return (
51
- <Container
52
- // onMouseEnter={() => setIsHover(true)}
53
- // onMouseLeave={() => setIsHover(false)}
54
- >
55
- {imageArray.length > 1 && (
56
- <button
57
- className="prev"
58
- onClick={(e) => {
59
- e.stopPropagation();
60
- goToPrevSlide();
61
- }}
62
- >
63
- <ArrowBackIosIcon />
64
- </button>
65
- )}
66
- <div className="slide-container">
67
- {imageArray.length ? (
68
- imageArray.map((img, index) => (
69
- <div
70
- key={index}
71
- className={`image-container slide ${
72
- index === currentIndex ? "active" : ""
73
- }`}
74
- >
75
- <ReactImageFallback
76
- key={index}
77
- src={`https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${img.src}`}
78
- fallbackImage={spinner}
79
- alt={img?.name}
80
- style={{
81
- transform: `translateX(-${currentIndex * 100}%)`,
82
- }}
83
- />
84
- </div>
85
- ))
86
- ) : (
87
- <img src={productImage} alt="not image" />
88
- )}
89
- </div>
90
- {imageArray.length > 1 && (
91
- <button
92
- className="next"
93
- onClick={(e) => {
94
- e.stopPropagation();
95
- goToNextSlide();
96
- }}
97
- >
98
- <ArrowBackIosIcon />
99
- </button>
100
- )}
101
- </Container>
102
- );
103
- };
@@ -1,79 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- export const Container = styled.div`
4
- width: 174px;
5
- height: 175px;
6
- border-radius: 5px 5px 0px 0px;
7
- position: relative;
8
- overflow: hidden;
9
- display: flex;
10
- background-color: #f0f0f0;
11
-
12
- .slide-container {
13
- display: flex;
14
- width: 100%;
15
-
16
- .image-container {
17
- width: 100%;
18
- height: 100%;
19
-
20
- img {
21
- width: 100%;
22
- height: 100%;
23
- object-fit: fill;
24
- }
25
-
26
- &.slide {
27
- flex: 0 0 100%;
28
- opacity: 0;
29
- transition: opacity 0.5s ease-in-out;
30
-
31
- &.active {
32
- opacity: 1;
33
- }
34
- }
35
- }
36
-
37
- & > img {
38
- width: 100%;
39
- }
40
- }
41
-
42
- button {
43
- position: absolute;
44
- top: 0;
45
- border: none;
46
- cursor: pointer;
47
- background-color: transparent;
48
- color: white;
49
- z-index: 1;
50
- height: 100%;
51
- width: 30px;
52
-
53
- svg {
54
- font-size: 24px;
55
- }
56
-
57
- &.prev {
58
- left: 0;
59
-
60
- &:hover {
61
- background: linear-gradient(90deg, darkgray, transparent);
62
- }
63
- }
64
- &.next {
65
- right: 0;
66
-
67
- svg {
68
- transform: rotate(180deg);
69
- }
70
- &:hover {
71
- background: linear-gradient(-90deg, darkgray, transparent);
72
- }
73
- }
74
- }
75
-
76
- button:focus {
77
- outline: none;
78
- }
79
- `;
@@ -1,7 +0,0 @@
1
- import { PercentTag } from ".";
2
-
3
- export default { title: "Components/atoms/PercentTag", component: PercentTag };
4
-
5
- const Template = (args) => <PercentTag {...args} />;
6
- export const PercentTagDefault = Template.bind({});
7
- PercentTagDefault.args = { percent: 88, progressBarType: "AA" };
@@ -1,9 +0,0 @@
1
- import { Container } from "./styles";
2
-
3
- export const PercentTag = ({ percent, progressBarType }) => {
4
- return (
5
- <Container className={`status-${progressBarType}`}>
6
- <p>{percent}%</p>
7
- </Container>
8
- );
9
- };
@@ -1,69 +0,0 @@
1
- import styled from "styled-components";
2
- import { GlobalColors, FontFamily } from "../../../global-files/variables";
3
-
4
- export const Container = styled.div`
5
- background-color: ${GlobalColors.s3};
6
- display: inline-block;
7
- padding: 0 10px;
8
- border-radius: 5px;
9
- font-family: ${FontFamily.Lato};
10
- font-weight: 600;
11
- font-size: 12px;
12
- line-height: 20px;
13
- color: ${(backgroundColor) =>
14
- backgroundColor === "s2" || backgroundColor === "s1"
15
- ? GlobalColors.s4
16
- : GlobalColors.white};
17
-
18
- &.status-CA,
19
- &.status-IE {
20
- background-color: ${GlobalColors.in_progress};
21
- }
22
-
23
- &.status-R,
24
- &.status-AS,
25
- &.status-PA {
26
- background-color: ${GlobalColors.reception};
27
- }
28
-
29
- &.status-AA,
30
- &.status-AP,
31
- &.status-ACA,
32
- &.status-AC {
33
- background-color: ${GlobalColors.finished};
34
- }
35
-
36
- &.status-RA,
37
- &.status-RC,
38
- &.status-RP,
39
- &.status-RCA {
40
- background-color: ${GlobalColors.rejected_status};
41
- }
42
-
43
- &.status-Dat,
44
- &.status-Dsc,
45
- &.status-Imgs {
46
- background-color: ${GlobalColors.s4};
47
- }
48
-
49
- &.status-Ex {
50
- background-color: ${GlobalColors.exported};
51
- }
52
-
53
- &.status-DDI {
54
- background-color: ${GlobalColors.original_purpura};
55
- }
56
-
57
- &.status-GLD {
58
- background-color: ${GlobalColors.in_progress};
59
- }
60
-
61
- &.status-TAB {
62
- background-color: ${GlobalColors.deep_gray};
63
- }
64
-
65
- &.status-Pt {
66
- background-color: ${GlobalColors.s2};
67
- color: ${GlobalColors.s4};
68
- }
69
- `;
@@ -1,10 +0,0 @@
1
- import { RatingStars } from ".";
2
-
3
- export default {
4
- title: "Components/atoms/RatingStars",
5
- component: RatingStars,
6
- };
7
-
8
- const Template = (args) => <RatingStars {...args} />;
9
- export const RatingStarsDefault = Template.bind({});
10
- RatingStarsDefault.args = { percent: 80 };
@@ -1,31 +0,0 @@
1
- import { Container } from "./styles";
2
- import { faStar as starIcon } from "@fortawesome/free-regular-svg-icons";
3
- import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
4
- import { useEffect } from "react";
5
- import { useState } from "react";
6
-
7
- export const RatingStars = ({ ratingValue = 0 }) => {
8
- const [rating, setRating] = useState(0);
9
-
10
- const handleRating = (value) => {
11
- setRating(value);
12
- };
13
-
14
- useEffect(() => {
15
- setRating(ratingValue);
16
- }, []);
17
-
18
- return (
19
- <Container>
20
- {[...Array(5)].map((_, index) => (
21
- <span
22
- key={index}
23
- className={`star ${index < rating ? "active" : ""}`}
24
- onClick={() => handleRating(index + 1)}
25
- >
26
-
27
- </span>
28
- ))}
29
- </Container>
30
- );
31
- };
@@ -1,28 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- export const Container = styled.div`
4
- font-size: 10px;
5
- display: flex;
6
- align-items: center;
7
-
8
- .star {
9
- cursor: pointer;
10
- font-size: 12px;
11
- color: #d9d9d9;
12
- transition: color 0.3s;
13
- line-height: 10px;
14
-
15
- &:hover {
16
- color: gold;
17
- }
18
-
19
- &.active {
20
- transform: scale(1.2);
21
- color: #8a6caa;
22
- }
23
-
24
- &:not(:first-child) {
25
- margin-left: 5px;
26
- }
27
- }
28
- `;
@@ -1,36 +0,0 @@
1
- import { RetailerCatalog } from ".";
2
-
3
- export default {
4
- title: "Components/atoms/RetailerCatalog",
5
- component: RetailerCatalog,
6
- };
7
-
8
- const Template = (args) => <RetailerCatalog {...args} />;
9
- export const RetailerCatalogDefault = Template.bind({});
10
- RetailerCatalogDefault.args = {
11
- limit: 3,
12
- articleId: 39474,
13
- orderId: 15270,
14
- retailers: [
15
- {
16
- id: 58,
17
- name: "The Home Depot Golden",
18
- },
19
- {
20
- id: 59,
21
- name: "The Home Depot Platinum",
22
- },
23
- {
24
- id: 60,
25
- name: "The Home Depot Resizing",
26
- },
27
- {
28
- id: 61,
29
- name: "Home Depot TAB",
30
- },
31
- {
32
- id: 68,
33
- name: "The Home Depot Dropship",
34
- },
35
- ],
36
- };
@@ -1,49 +0,0 @@
1
- import { useState } from "react";
2
- import { Avatar } from "../Avatar";
3
- import { Container } from "./styles";
4
- import { useEffect } from "react";
5
- import { useCloseModal } from "../../../global-files/customHooks";
6
- import { RetailersList } from "../RetailersList";
7
-
8
- export const RetailerCatalog = ({
9
- retailers = [],
10
- limit = 3,
11
- article,
12
- id = "retailers-catalog",
13
- }) => {
14
- const [retLimit, setRetLimit] = useState(0);
15
- const [showRetailers, setShowRetailers] = useCloseModal(id);
16
-
17
- useEffect(() => {
18
- setRetLimit(limit);
19
- }, [retailers]);
20
-
21
- return (
22
- <Container
23
- onClick={(e) => {
24
- setShowRetailers(!showRetailers);
25
- }}
26
- id={id}
27
- >
28
- {retailers.map(
29
- (retailer, i) =>
30
- i < limit && (
31
- <Avatar
32
- key={retailer.id + "-" + i}
33
- image={`https://content-management-images.s3.amazonaws.com/retailers/${retailer.id}.png`}
34
- altText={retailer?.name}
35
- imageType={"medium-image"}
36
- />
37
- )
38
- )}
39
- {retailers.length > retLimit && (
40
- <div className="retailers-limit">
41
- <p>+{retailers.length - retLimit}</p>
42
- </div>
43
- )}
44
- {showRetailers && (
45
- <RetailersList retailers={retailers} article={article} />
46
- )}
47
- </Container>
48
- );
49
- };
@@ -1,30 +0,0 @@
1
- import styled from "styled-components";
2
- import { FontFamily } from "../../../global-files/variables";
3
-
4
- export const Container = styled.div`
5
- display: flex;
6
- align-items: center;
7
- justify-content: center;
8
- cursor: pointer;
9
- position: relative;
10
- width: 100%;
11
-
12
- .retailers-limit {
13
- width: 26px;
14
- height: 26px;
15
- border-radius: 50%;
16
- background-color: #f0f0f0;
17
-
18
- p {
19
- font-family: ${FontFamily.Lato};
20
- font-size: 12px;
21
- line-height: 26px;
22
- color: #262626;
23
- text-align: center;
24
- }
25
- }
26
-
27
- > * + * {
28
- margin-left: -5px;
29
- }
30
- `;
@@ -1,15 +0,0 @@
1
- import { RetailerOption } from ".";
2
-
3
- export default {
4
- title: "Components/atoms/RetailerOptions",
5
- component: RetailerOption,
6
- };
7
-
8
- const Template = (args) => <RetailerOption {...args} />;
9
- export const RetailerOptionDefault = Template.bind({});
10
- RetailerOptionDefault.args = {
11
- retailer: {
12
- id: 58,
13
- name: "The Home Depot Golden",
14
- },
15
- };
@@ -1,53 +0,0 @@
1
- import { useState } from "react";
2
- import { Avatar } from "../Avatar";
3
- import { Container } from "./styles";
4
- import { useEffect } from "react";
5
-
6
- export const RetailerOption = ({ retailer, services = {} }) => {
7
- const [service, setService] = useState([]);
8
-
9
- useEffect(() => {
10
- if (services[retailer.id]) {
11
- setService(Object.keys(services[retailer.id]));
12
- }
13
- }, [services]);
14
-
15
- return (
16
- <Container>
17
- <div className="avatar-and-retailer">
18
- <Avatar
19
- image={`https://content-management-images.s3.amazonaws.com/retailers/${retailer.id}.png`}
20
- altText={retailer?.name}
21
- imageType={"medium-image"}
22
- />
23
- <p className="retailer-name">{retailer?.name}</p>
24
- </div>
25
- <div className="services-icons">
26
- <span
27
- key="datasheet"
28
- className={`material-icons small ${
29
- service.includes("datasheet") && "is-active"
30
- }`}
31
- >
32
- &#xf8ee;
33
- </span>
34
- <span
35
- key="description"
36
- className={`material-icons small ${
37
- service.includes("description") && "is-active"
38
- }`}
39
- >
40
- &#xe873;
41
- </span>
42
- <span
43
- key="images"
44
- className={`material-icons small ${
45
- service.includes("images") && "is-active"
46
- }`}
47
- >
48
- &#xe3f4;
49
- </span>
50
- </div>
51
- </Container>
52
- );
53
- };
@@ -1,41 +0,0 @@
1
- import styled from "styled-components";
2
- import { FontFamily } from "../../../global-files/variables";
3
-
4
- export const Container = styled.div`
5
- display: flex;
6
- padding: 7px;
7
- border: 1px solid #f0f0f0;
8
- align-items: center;
9
- justify-content: space-between;
10
- border-radius: 5px;
11
-
12
- .avatar-and-retailer {
13
- display: flex;
14
- align-items: center;
15
- .retailer-name {
16
- font-family: ${FontFamily.Lato};
17
- font-size: 12px;
18
- color: #262626;
19
- }
20
-
21
- > * + * {
22
- margin-left: 10px;
23
- }
24
- }
25
-
26
- .services-icons {
27
- display: flex;
28
-
29
- span {
30
- color: #f0f0f0;
31
- font-size: 14px;
32
- &.is-active {
33
- color: #8a6caa;
34
- }
35
- }
36
-
37
- > * + * {
38
- margin-left: 9px;
39
- }
40
- }
41
- `;
@@ -1,33 +0,0 @@
1
- import { RetailersList } from ".";
2
-
3
- export default {
4
- title: "Components/atoms/RetailersList",
5
- component: RetailersList,
6
- };
7
-
8
- const Template = (args) => <RetailersList {...args} />;
9
- export const RetailersListDefault = Template.bind({});
10
- RetailersListDefault.args = {
11
- retailers: [
12
- {
13
- id: 58,
14
- name: "The Home Depot Golden",
15
- },
16
- {
17
- id: 59,
18
- name: "The Home Depot Platinum",
19
- },
20
- {
21
- id: 60,
22
- name: "The Home Depot Resizing",
23
- },
24
- {
25
- id: 61,
26
- name: "Home Depot TAB",
27
- },
28
- {
29
- id: 68,
30
- name: "The Home Depot Dropship",
31
- },
32
- ],
33
- };
@@ -1,20 +0,0 @@
1
- import { Container } from "./styles";
2
- import { RetailerOption } from "../RetailerOption";
3
- import { useState, useEffect } from "react";
4
- import axios from "axios";
5
-
6
- export const RetailersList = ({ retailers, article, id }) => {
7
- const [services, setServices] = useState({});
8
-
9
- useEffect(() => {
10
- if (article) setServices(article.statusByRetailer);
11
- }, [article]);
12
-
13
- return (
14
- <Container id={id}>
15
- {retailers.map((retailer, i) => (
16
- <RetailerOption key={i} retailer={retailer} services={services} />
17
- ))}
18
- </Container>
19
- );
20
- };
@@ -1,19 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- export const Container = styled.div`
4
- width: 370px;
5
- max-height: 200px;
6
- overflow: auto;
7
- position: absolute;
8
- z-index: 500;
9
- right: 0%;
10
- top: 100%;
11
- border: 1px solid #f0f0f0;
12
- padding: 10px;
13
- padding-right: 5px;
14
- background-color: white;
15
-
16
- > * + * {
17
- margin-top: 5px;
18
- }
19
- `;