contentoh-components-library 21.4.8 → 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 (107) hide show
  1. package/.env.development +1 -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/molecules/CarouselImagesLogin/index.js +1 -1
  10. package/dist/components/molecules/HeaderTop/index.js +11 -68
  11. package/dist/components/molecules/TagAndInput/index.js +1 -1
  12. package/dist/components/organisms/Chat/Chat.stories.js +8 -27
  13. package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
  14. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  15. package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
  16. package/dist/components/organisms/Chat/Footer/index.js +39 -48
  17. package/dist/components/organisms/Chat/index.js +4 -49
  18. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  19. package/dist/components/organisms/Modal/styles.js +1 -1
  20. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +4 -37
  21. package/dist/components/pages/ProviderProductEdition/index.js +175 -188
  22. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  23. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +3 -7
  24. package/dist/components/pages/RetailerProductEdition/index.js +273 -288
  25. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  26. package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
  27. package/dist/index.js +52 -234
  28. package/package.json +1 -4
  29. package/src/components/atoms/Avatar/index.js +2 -8
  30. package/src/components/atoms/Card/index.js +2 -35
  31. package/src/components/atoms/Card/styles.js +5 -41
  32. package/src/components/atoms/CheckBox/index.js +1 -4
  33. package/src/components/atoms/CheckBox/styles.js +0 -2
  34. package/src/components/atoms/InputFormatter/styles.js +1 -2
  35. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  36. package/src/components/molecules/HeaderTop/index.js +6 -52
  37. package/src/components/molecules/TagAndInput/index.js +8 -10
  38. package/src/components/organisms/Chat/Chat.stories.js +7 -27
  39. package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
  40. package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
  41. package/src/components/organisms/Chat/ContentChat/index.js +12 -88
  42. package/src/components/organisms/Chat/Footer/index.js +0 -11
  43. package/src/components/organisms/Chat/index.js +4 -46
  44. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  45. package/src/components/organisms/Modal/styles.js +1 -4
  46. package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
  47. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +1 -40
  48. package/src/components/pages/ProviderProductEdition/index.js +129 -132
  49. package/src/components/pages/ProviderProductEdition/styles.js +1 -5
  50. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +2 -6
  51. package/src/components/pages/RetailerProductEdition/index.js +135 -121
  52. package/src/components/pages/RetailerProductEdition/styles.js +0 -4
  53. package/src/components/pages/RetailerProductEdition/utils.js +0 -37
  54. package/src/index.js +0 -15
  55. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
  56. package/src/components/atoms/ImageCarousel/index.js +0 -103
  57. package/src/components/atoms/ImageCarousel/styles.js +0 -79
  58. package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
  59. package/src/components/atoms/PercentTag/index.js +0 -9
  60. package/src/components/atoms/PercentTag/styles.js +0 -69
  61. package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
  62. package/src/components/atoms/RatingStars/index.js +0 -31
  63. package/src/components/atoms/RatingStars/styles.js +0 -28
  64. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
  65. package/src/components/atoms/RetailerCatalog/index.js +0 -49
  66. package/src/components/atoms/RetailerCatalog/styles.js +0 -30
  67. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
  68. package/src/components/atoms/RetailerOption/index.js +0 -53
  69. package/src/components/atoms/RetailerOption/styles.js +0 -41
  70. package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
  71. package/src/components/atoms/RetailersList/index.js +0 -20
  72. package/src/components/atoms/RetailersList/styles.js +0 -19
  73. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
  74. package/src/components/atoms/UserCatalog/index.js +0 -96
  75. package/src/components/atoms/UserCatalog/styles.js +0 -24
  76. package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
  77. package/src/components/atoms/UserOption/index.js +0 -95
  78. package/src/components/atoms/UserOption/styles.js +0 -61
  79. package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
  80. package/src/components/atoms/UserSelector/index.js +0 -86
  81. package/src/components/atoms/UserSelector/styles.js +0 -55
  82. package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
  83. package/src/components/molecules/GridItem/index.js +0 -97
  84. package/src/components/molecules/GridItem/styles.js +0 -104
  85. package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
  86. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
  87. package/src/components/molecules/HeaderItem/index.js +0 -26
  88. package/src/components/molecules/HeaderItem/styles.js +0 -27
  89. package/src/components/molecules/RowItem/ColumnItem.js +0 -9
  90. package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
  91. package/src/components/molecules/RowItem/index.js +0 -45
  92. package/src/components/molecules/RowItem/styles.js +0 -40
  93. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
  94. package/src/components/molecules/StripeCardForm/index.js +0 -42
  95. package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
  96. package/src/components/molecules/StripeCardForm/styles.js +0 -73
  97. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
  98. package/src/components/molecules/StripeCardSelector/index.js +0 -44
  99. package/src/components/molecules/StripeCardSelector/styles.js +0 -4
  100. package/src/components/molecules/StripeCardSelector/utils.js +0 -17
  101. package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
  102. package/src/components/organisms/GridProducts/index.js +0 -50
  103. package/src/components/organisms/GridProducts/styles.js +0 -14
  104. package/src/components/organisms/GridProducts/utils.js +0 -111
  105. package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
  106. package/src/components/organisms/SideModal/index.js +0 -50
  107. package/src/components/organisms/SideModal/styles.js +0 -30
@@ -24,20 +24,15 @@ import descriptionSent from "../../../assets/images/modalsSVGs/descriptionSent.s
24
24
  import imagesSent from "../../../assets/images/modalsSVGs/uploadingImages.svg";
25
25
  import { TagAndInput } from "../../molecules/TagAndInput/index";
26
26
  import { Button } from "../../atoms/GeneralButton";
27
+ import { Commentary } from "../../atoms/Commentary";
27
28
  import { GenericModal } from "../../atoms/GenericModal";
28
29
  import { ScreenHeader } from "../../atoms/ScreenHeader";
29
30
  import { Loading } from "../../atoms/Loading";
30
31
  import succes from "../../../assets/images/genericModal/genericModalCheck.svg";
32
+ import errorModal from "../../../assets/images/genericModal/errorModal.svg";
31
33
  import { VersionSelector } from "../../organisms/VersionSelector";
32
34
  import { useCloseModal } from "../../../global-files/customHooks";
33
- import {
34
- getAuditVersion,
35
- getInputsData,
36
- createMessage,
37
- sendMessage,
38
- } from "./utils";
39
- import { Modal } from "../../organisms/Modal";
40
- import { ButtonV2 } from "../../atoms/ButtonV2";
35
+ import { getAuditVersion, getInputsData } from "./utils";
41
36
 
42
37
  const reducerImages = (state, action) => {
43
38
  let { values, attrForImgs, inputsByRetailer } = state;
@@ -137,7 +132,6 @@ export const RetailerProductEdition = ({
137
132
  const [datasheets, setDatasheets] = useState([]);
138
133
  const [images, setImages] = useReducer(reducerImages, {});
139
134
  const [showModal, setShowModal] = useState(false);
140
- const [showRejectModal, setShowRejectModal] = useState(false);
141
135
  const { getRootProps, getInputProps } = useDropzone({
142
136
  accept: "image/*",
143
137
  noKeyboard: true,
@@ -224,11 +218,6 @@ export const RetailerProductEdition = ({
224
218
  const [auditDescriptions, setAuditDescriptions] = useState([]);
225
219
  const [auditImages, setAuditImages] = useState([]);
226
220
  const [compare, setCompare] = useState(false);
227
- const [valRejAll, setValRejAll] = useState(false);
228
-
229
- const [desc, setDesc] = useState([]);
230
- const [fich, setFich] = useState([]);
231
- const [imag, setImag] = useState([]);
232
221
 
233
222
  useEffect(async () => {
234
223
  const { id_article } = product?.article || {};
@@ -572,7 +561,6 @@ export const RetailerProductEdition = ({
572
561
  active: images?.values?.some((value) => value?.image_id === e?.id),
573
562
  }));
574
563
  setSocketType(imageInputs);
575
- console.log(images);
576
564
  }, [images]);
577
565
 
578
566
  const updateImages = useCallback(async () => {
@@ -869,25 +857,6 @@ export const RetailerProductEdition = ({
869
857
  const { newStatus, newOrderStatus, newArticleStatus } = JSON.parse(
870
858
  res.data.body
871
859
  );
872
- const messageToChat = createMessage(
873
- product.retailers,
874
- activeRetailer.id,
875
- evalStatus,
876
- newStatus,
877
- activeTab
878
- );
879
-
880
- const data = {
881
- paramsBody: {
882
- id: product.article.id_article,
883
- version: version,
884
- items: [{ type: "status", value: messageToChat }],
885
- retailerId: activeRetailer.id,
886
- status: product.status,
887
- },
888
- paramsHeader: { Authorization: token },
889
- };
890
- await sendMessage(data);
891
860
  if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
892
861
  productTemp[`${concept}_status`] = newStatus;
893
862
  await loadData();
@@ -930,19 +899,35 @@ export const RetailerProductEdition = ({
930
899
  return product?.article[`id_auditor`] === user.id_user;
931
900
  };
932
901
 
933
- const createComment = async (messages = [], retailerId) => {
902
+ const createComment = async (e, body, tab) => {
903
+ let concept = "";
904
+ switch (activeTab) {
905
+ case "Ficha técnica":
906
+ concept = "datasheet";
907
+ break;
908
+ case "Imágenes":
909
+ concept = "images";
910
+ break;
911
+
912
+ default:
913
+ concept = "description";
914
+ break;
915
+ }
934
916
  const data = {
935
- paramsBody: {
936
- id: product.article.id_article,
937
- version: version,
938
- items: messages,
939
- retailerId: retailerId,
940
- status: product.status,
941
- },
942
- paramsHeader: { Authorization: token },
917
+ articleId: product?.article?.id_article,
918
+ orderId: product?.orderId,
919
+ message: body?.replace(/<.*?\/?>/gm, ""),
920
+ concept: concept,
921
+ version: version,
943
922
  };
923
+ await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
924
+ headers: {
925
+ Authorization: token,
926
+ },
927
+ });
928
+ await getComments(tab);
944
929
  setMessage("");
945
- return sendMessage(data);
930
+ setComponentsArray([]);
946
931
  };
947
932
 
948
933
  const getRequired = (services) => {
@@ -1194,7 +1179,6 @@ export const RetailerProductEdition = ({
1194
1179
  };
1195
1180
 
1196
1181
  useEffect(() => {
1197
- console.log(servicesData, "servicesData");
1198
1182
  let status = getRetailerStatus(servicesData, activeTab);
1199
1183
  setRetailerStatus(status);
1200
1184
  }, [activeTab, servicesData, activeRetailer]);
@@ -1225,8 +1209,6 @@ export const RetailerProductEdition = ({
1225
1209
  break;
1226
1210
  }
1227
1211
 
1228
- const messages = [];
1229
-
1230
1212
  servicesData?.forEach((ret) => {
1231
1213
  if (conceptArray.includes(ret.service)) {
1232
1214
  let data = {
@@ -1237,21 +1219,6 @@ export const RetailerProductEdition = ({
1237
1219
  evalStatus: ret.status,
1238
1220
  retailerId: ret.id_retailer,
1239
1221
  };
1240
- if (product[`${ret.service}_status`] !== "NS") {
1241
- const message = createMessage(
1242
- product.retailers,
1243
- ret.id_retailer,
1244
- product[`${ret.service}_status`],
1245
- `${result}A`,
1246
- ret.service
1247
- );
1248
- messages.push(
1249
- createComment(
1250
- [{ type: "status", value: message }],
1251
- ret.id_retailer
1252
- )
1253
- );
1254
- }
1255
1222
  evaluationArray.push(
1256
1223
  axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
1257
1224
  headers: {
@@ -1261,19 +1228,19 @@ export const RetailerProductEdition = ({
1261
1228
  );
1262
1229
  }
1263
1230
  });
1231
+
1264
1232
  await Promise.all(evaluationArray);
1265
1233
 
1266
1234
  const productTemp = product;
1267
1235
  productTemp.status = `${result}A`;
1268
1236
  productTemp.datasheet_status =
1269
- productTemp.datasheet_status === "NS" ? "NS" : `${result}A`;
1237
+ productTemp.datasheet_status === "NA" ? "NA" : `${result}A`;
1270
1238
  productTemp.description_status =
1271
- productTemp.description_status === "NS" ? "NS" : `${result}A`;
1239
+ productTemp.description_status === "NA" ? "NA" : `${result}A`;
1272
1240
  productTemp.images_status =
1273
- productTemp.images_status === "NS" ? "NS" : `${result}A`;
1241
+ productTemp.images_status === "NA" ? "NA" : `${result}A`;
1274
1242
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1275
1243
  setProduct(productTemp);
1276
- const messagesResponse = await Promise.all(messages);
1277
1244
 
1278
1245
  await loadData();
1279
1246
  } catch (error) {
@@ -1289,10 +1256,8 @@ export const RetailerProductEdition = ({
1289
1256
  setCompare={setCompare}
1290
1257
  isAuditor={[1, 6].includes(user.id_role)}
1291
1258
  withChat={location?.state?.withChat}
1292
- chatType={location?.state?.chatType}
1293
- productSelected={product}
1259
+ productSelected={productSelected}
1294
1260
  token={token}
1295
- activeRetailer={activeRetailer}
1296
1261
  />
1297
1262
  <div className="data-container">
1298
1263
  <div className="image-data-panel">
@@ -1332,7 +1297,36 @@ export const RetailerProductEdition = ({
1332
1297
  sendToFacilitator("A");
1333
1298
  }}
1334
1299
  reject={() => {
1335
- setShowRejectModal(true);
1300
+ sendToFacilitator("R");
1301
+ setMessage("Rechazado");
1302
+ setComponentsArray([
1303
+ <img src={errorModal} />,
1304
+ <ScreenHeader
1305
+ text={"Agrega tu comentarios para enviar el rechazo"}
1306
+ headerType={"input-name-header"}
1307
+ color={"white"}
1308
+ />,
1309
+ <TagAndInput
1310
+ label={"Caja de Comentario"}
1311
+ inputType={"textarea"}
1312
+ inputId={"modal-commentary-box"}
1313
+ index={0}
1314
+ color={"white"}
1315
+ />,
1316
+ <Button
1317
+ buttonType={"general-default-button"}
1318
+ label={"Enviar comentario"}
1319
+ onClick={(e) =>
1320
+ createComment(
1321
+ e,
1322
+ document.querySelector(
1323
+ "#modal-commentary-box .ql-container .ql-editor > p"
1324
+ ).innerHTML,
1325
+ activeTab
1326
+ )
1327
+ }
1328
+ />,
1329
+ ]);
1336
1330
  }}
1337
1331
  showApproveRejectAll={
1338
1332
  approveRejectAllButtons() && (auditorAssigned() || userAssigned())
@@ -1342,8 +1336,36 @@ export const RetailerProductEdition = ({
1342
1336
  }
1343
1337
  approveAll={() => validateAll("A")}
1344
1338
  rejectAll={() => {
1345
- setShowRejectModal(true);
1346
- setValRejAll(true);
1339
+ validateAll("R");
1340
+ setMessage("Rechazado");
1341
+ setComponentsArray([
1342
+ <img src={errorModal} />,
1343
+ <ScreenHeader
1344
+ text={"Agrega tu comentarios para enviar el rechazo"}
1345
+ headerType={"input-name-header"}
1346
+ color={"white"}
1347
+ />,
1348
+ <TagAndInput
1349
+ label={"Caja de Comentario"}
1350
+ inputType={"textarea"}
1351
+ inputId={"modal-commentary-box"}
1352
+ index={0}
1353
+ color={"white"}
1354
+ />,
1355
+ <Button
1356
+ buttonType={"general-default-button"}
1357
+ label={"Enviar comentario"}
1358
+ onClick={(e) =>
1359
+ createComment(
1360
+ e,
1361
+ document.querySelector(
1362
+ "#modal-commentary-box .ql-container .ql-editor > p"
1363
+ ).innerHTML,
1364
+ activeTab
1365
+ )
1366
+ }
1367
+ />,
1368
+ ]);
1347
1369
  }}
1348
1370
  />
1349
1371
  <FullTabsMenu
@@ -1359,12 +1381,6 @@ export const RetailerProductEdition = ({
1359
1381
  isRetailer={isRetailer}
1360
1382
  showSaveButton={auditorAssigned() || userAssigned()}
1361
1383
  version={version}
1362
- desc={desc}
1363
- setDesc={setDesc}
1364
- fich={fich}
1365
- setFich={setFich}
1366
- imag={imag}
1367
- setImag={setImag}
1368
1384
  updatedDescriptions={updatedDescriptions}
1369
1385
  setUpdatedDescriptions={setUpdatedDescriptions}
1370
1386
  updatedDatasheets={updatedDatasheets}
@@ -1479,6 +1495,47 @@ export const RetailerProductEdition = ({
1479
1495
  {(userAssigned(activeTab) || auditorAssigned()) &&
1480
1496
  product[`${getConcept(activeTab)}_status`] !== "NS" && (
1481
1497
  <div className="commentary-box">
1498
+ {!comment ? (
1499
+ <div className="commentary">
1500
+ <TagAndInput
1501
+ label={"Caja de Comentario"}
1502
+ inputType={"textarea"}
1503
+ inputCols={80}
1504
+ inputRows={4}
1505
+ inputId={"commentary-box"}
1506
+ index={0}
1507
+ />
1508
+ <div className="buttons-box">
1509
+ <Button
1510
+ buttonType={"general-transparent-button"}
1511
+ label={"Enviar comentario"}
1512
+ onClick={(e) =>
1513
+ createComment(
1514
+ e,
1515
+ document.querySelector(
1516
+ "#commentary-box .ql-container .ql-editor > p"
1517
+ ).innerHTML,
1518
+ activeTab
1519
+ )
1520
+ }
1521
+ />
1522
+ </div>
1523
+ </div>
1524
+ ) : (
1525
+ <div className="feedback-box">
1526
+ <Commentary
1527
+ comment={comment?.message?.replace(/<.*?\/?>/gm, "")}
1528
+ reviewed={crossComment}
1529
+ />
1530
+ <Button
1531
+ buttonType={"circular-button accept-button"}
1532
+ onClick={async () => {
1533
+ setCrossComment(true);
1534
+ commentRevised();
1535
+ }}
1536
+ />
1537
+ </div>
1538
+ )}
1482
1539
  {[7, 8].includes(user.id_role) && (
1483
1540
  <Button
1484
1541
  buttonType={
@@ -1536,49 +1593,6 @@ export const RetailerProductEdition = ({
1536
1593
  jwt={token}
1537
1594
  />
1538
1595
  )}
1539
- {showRejectModal && (
1540
- <Modal
1541
- title={`Agregar mensaje de rechazo para ${activeTab?.toLowerCase()}`}
1542
- show={showRejectModal}
1543
- customComponent={
1544
- <TagAndInput
1545
- inputType={"textarea"}
1546
- inputId={"modal-message-box"}
1547
- index={0}
1548
- color={"white"}
1549
- />
1550
- }
1551
- buttons={[
1552
- <ButtonV2
1553
- key={"btn-Cancelar"}
1554
- type={"white"}
1555
- label={"Cancelar"}
1556
- size={12}
1557
- onClick={() => {
1558
- setShowRejectModal(false);
1559
- }}
1560
- />,
1561
- <ButtonV2
1562
- key={"btn-Aceptar"}
1563
- type={"pink"}
1564
- label={"Aceptar"}
1565
- size={12}
1566
- onClick={async () => {
1567
- const body = document.querySelector(
1568
- "#modal-message-box .ql-container .ql-editor > p"
1569
- ).innerHTML;
1570
- const messages = [
1571
- { type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
1572
- ];
1573
- await createComment(messages, activeRetailer.id);
1574
- valRejAll ? validateAll("R") : sendToFacilitator("R");
1575
- setMessage("Rechazado");
1576
- setShowRejectModal(false);
1577
- }}
1578
- />,
1579
- ]}
1580
- />
1581
- )}
1582
1596
  </Container>
1583
1597
  );
1584
1598
  };
@@ -89,10 +89,6 @@ export const Container = styled.div`
89
89
  }
90
90
  }
91
91
  }
92
- #modal-message-box {
93
- width: 400px;
94
- height: 100px;
95
- }
96
92
  .container {
97
93
  width: 100%;
98
94
  height: 100%;
@@ -1,5 +1,4 @@
1
1
  import axios from "axios";
2
- import { fetchPOST } from "../../../global-files/handle_http";
3
2
 
4
3
  export const getAuditVersion = async (articleId, setState, token) => {
5
4
  const auditResponse = await axios.get(
@@ -33,39 +32,3 @@ export const getInputsData = (
33
32
  setDescriptionState(descriptions);
34
33
  }
35
34
  };
36
-
37
- export const translateService = (tab) => {
38
- switch (tab) {
39
- case "description":
40
- case "Descripción":
41
- return "Descripciones";
42
- case "datasheet":
43
- case "Ficha técnica":
44
- return "Fichas técnicas";
45
- case "images":
46
- case "Imágenes":
47
- return "Imágenes";
48
- }
49
- };
50
-
51
- export const createMessage = (
52
- retailers,
53
- idRetailer,
54
- oldStatus,
55
- newStatus,
56
- service
57
- ) => {
58
- const [retailer] = retailers?.filter((ret) => ret.id === idRetailer) || [];
59
- return `${translateService(service)} de ${
60
- retailer.name
61
- } |${oldStatus}| a |${newStatus}`;
62
- };
63
-
64
- export const sendMessage = async (data) => {
65
- const { paramsBody, paramsHeader } = data;
66
- return fetchPOST(
67
- process.env.REACT_APP_CREATE_MESSAGES,
68
- paramsBody,
69
- paramsHeader
70
- );
71
- };
package/src/index.js CHANGED
@@ -33,13 +33,6 @@ export * from "./components/atoms/ImagePreview/index";
33
33
  export * from "./components/atoms/InputText/index";
34
34
  export * from "./components/atoms/NotFound/index";
35
35
  export * from "./components/atoms/Tooltip/index";
36
- export * from "./components/atoms/UserOption/index";
37
- export * from "./components/atoms/UserCatalog/index";
38
- export * from "./components/atoms/UserSelector/index";
39
- export * from "./components/atoms/ImageCarousel/index";
40
- export * from "./components/atoms/RetailersList/index";
41
- export * from "./components/atoms/RetailerOption/index";
42
- export * from "./components/atoms/RetailerCatalog/index";
43
36
 
44
37
  //molecules
45
38
  export * from "./components/molecules/AvatarAndValidation/index";
@@ -70,12 +63,6 @@ export * from "./components/molecules/ButtonDownloadFile/index";
70
63
  export * from "./components/molecules/ImageTooltip/index";
71
64
  export * from "./components/molecules/SelectV2/index";
72
65
  export * from "./components/molecules/Dropdown/index";
73
- export * from "./components/molecules/StripeCardForm/index";
74
- export * from "./components/molecules/StripeCardSelector/index";
75
- export * from "./components/molecules/GridItem/index";
76
- export * from "./components/molecules/HeaderItem/index";
77
- export * from "./components/molecules/RowItem/index";
78
- export * from "./components/molecules/RetailerSelector/index";
79
66
 
80
67
  //organisms
81
68
  export * from "./components/organisms/ChangePassword/index";
@@ -92,8 +79,6 @@ export * from "./components/organisms/Modal/index";
92
79
  export * from "./components/organisms/OrderDetail/index";
93
80
  export * from "./components/organisms/RangeCalendar";
94
81
  export * from "./components/organisms/TableResizable";
95
- export * from "./components/organisms/SideModal/index";
96
- export * from "./components/organisms/GridProducts/index";
97
82
 
98
83
  //pages
99
84
  export * from "./components/pages/ChangePasswordLogin";
@@ -1,76 +0,0 @@
1
- import { ImageCarousel } from ".";
2
-
3
- export default {
4
- title: "Components/atoms/ImageCarousel",
5
- component: ImageCarousel,
6
- };
7
-
8
- const Template = (args) => <ImageCarousel {...args} />;
9
- export const ImageCarouselDefault = Template.bind({});
10
- ImageCarouselDefault.args = {
11
- imageArray: [
12
- {
13
- id: 35596,
14
- status: null,
15
- image_id: 1,
16
- packing_type: "3",
17
- image_type: "1",
18
- article_id: "38443",
19
- src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMS1kNDQ2ZjIwNy0wYTkzLTQyNzgtYWZjNi01MTY2ZjIyY2EzNDMucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
20
- timestamp: "2023-05-30T03:01:12.000Z",
21
- id_version: 15,
22
- width: null,
23
- height: null,
24
- scene_type: null,
25
- image_shot_type: null,
26
- last_modified: "2023-06-05T23:49:49.000Z",
27
- name: "Central (Frente Comercial)",
28
- version: 15,
29
- ext: "png",
30
- uuid: "d446f207-0a93-4278-afc6-5166f22ca343",
31
- srcDB: "id-38443/15/1-d446f207-0a93-4278-afc6-5166f22ca343.png",
32
- },
33
- {
34
- id: 35597,
35
- status: null,
36
- image_id: 3,
37
- packing_type: "3",
38
- image_type: "1",
39
- article_id: "38443",
40
- src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMy0yOTZkMzU3ZC00OTUzLTRiMzktYjFjMy04YWZmZDI2NDgwMWIucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
41
- timestamp: "2023-05-30T03:01:12.000Z",
42
- id_version: 15,
43
- width: null,
44
- height: null,
45
- scene_type: null,
46
- image_shot_type: null,
47
- last_modified: "2023-06-05T23:49:49.000Z",
48
- name: "Trasera (Back)",
49
- version: 15,
50
- ext: "png",
51
- uuid: "296d357d-4953-4b39-b1c3-8affd264801b",
52
- srcDB: "id-38443/15/3-296d357d-4953-4b39-b1c3-8affd264801b.png",
53
- },
54
- {
55
- id: 35598,
56
- status: null,
57
- image_id: 16,
58
- packing_type: "3",
59
- image_type: "1",
60
- article_id: "38443",
61
- src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMTYtOGMzNDIzM2YtZTRiMC00MjU0LWFlYzUtZjEyN2ZiYjhkYmVkLnBuZyIsImVkaXRzIjp7InJlc2l6ZSI6eyJ3aWR0aCI6MTAwMCwiaGVpZ2h0IjoxMDAwLCJmaXQiOiJjb250YWluIiwiYmFja2dyb3VuZCI6eyJyIjoyNTUsImciOjI1NSwiYiI6MjU1LCJhbHBoYSI6MX19fX0=",
62
- timestamp: "2023-05-30T03:01:12.000Z",
63
- id_version: 15,
64
- width: null,
65
- height: null,
66
- scene_type: null,
67
- image_shot_type: null,
68
- last_modified: "2023-06-05T23:49:49.000Z",
69
- name: "Detalle / Características 1",
70
- version: 15,
71
- ext: "png",
72
- uuid: "8c34233f-e4b0-4254-aec5-f127fbb8dbed",
73
- srcDB: "id-38443/15/16-8c34233f-e4b0-4254-aec5-f127fbb8dbed.png",
74
- },
75
- ],
76
- };
@@ -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
- };