contentoh-components-library 21.5.3 → 21.5.4
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.
- package/dist/components/organisms/InputGroup/index.js +1 -1
- package/dist/components/organisms/Table/styles.js +1 -1
- package/dist/components/pages/MultipleEdition/saveData.js +9 -19
- package/dist/components/pages/MultipleEdition/styles.js +1 -1
- package/dist/components/pages/MultipleEdition/utils.js +86 -153
- package/package.json +4 -1
- package/src/assets/images/Icons/addv2.svg +8 -0
- package/src/assets/images/Icons/beenhere.svg +9 -0
- package/src/assets/images/Icons/checkv2.svg +8 -0
- package/src/assets/images/Icons/close-magenta.svg +9 -0
- package/src/assets/images/Icons/close.svg +8 -0
- package/src/assets/images/Icons/closeCircle.svg +8 -0
- package/src/assets/images/Icons/delete-forever-red.svg +9 -0
- package/src/assets/images/Icons/delete-forever-white.svg +10 -0
- package/src/assets/images/Icons/edit.svg +8 -0
- package/src/assets/images/Icons/fullscreen.svg +3 -0
- package/src/assets/images/Icons/infoNR.svg +8 -0
- package/src/assets/images/Icons/options.svg +3 -0
- package/src/assets/images/Icons/save-white-gray.svg +9 -0
- package/src/assets/images/Icons/save-white.svg +9 -0
- package/src/assets/images/Icons/save.svg +8 -0
- package/src/assets/images/Icons/search.svg +3 -0
- package/src/assets/images/Icons/settings.svg +8 -0
- package/src/assets/images/Icons/trash.svg +8 -0
- package/src/assets/images/Icons/undo.svg +8 -0
- package/src/assets/images/Icons/upload-file-white.svg +4 -0
- package/src/assets/images/Icons/upload-file.svg +10 -0
- package/src/assets/images/Icons/upload_file.svg +10 -0
- package/src/assets/images/Icons/warningv2.svg +3 -0
- package/src/assets/images/checkBox/checkrosa.svg +3 -0
- package/src/assets/images/checkBox/checkverde.svg +3 -0
- package/src/assets/images/flagsv2/highPriority.svg +3 -0
- package/src/assets/images/flagsv2/lowPriority.svg +3 -0
- package/src/assets/images/flagsv2/mediumPriority.svg +3 -0
- package/src/assets/images/flagsv2/noPriority.svg +3 -0
- package/src/assets/images/generalButton/closeIconWhite.svg +4 -0
- package/src/assets/images/generalButton/closeIconv2.svg +4 -0
- package/src/assets/images/generalButton/saveIconpink.svg +3 -0
- package/src/components/atoms/Avatar/index.js +8 -2
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +1 -0
- package/src/components/atoms/ButtonV2/index.js +1 -0
- package/src/components/atoms/ButtonV2/styles.js +16 -0
- package/src/components/atoms/CharsMissing/Wysiwyg.stories.js +12 -0
- package/src/components/atoms/CharsMissing/index.js +60 -0
- package/src/components/atoms/CharsMissing/styles.js +44 -0
- package/src/components/atoms/CheckBox/CheckBox.stories.js +5 -0
- package/src/components/atoms/CheckBox/index.js +5 -1
- package/src/components/atoms/CheckBox/styles.js +9 -3
- package/src/components/atoms/CustomChip/CustomChip.stories.js +16 -0
- package/src/components/atoms/CustomChip/index.js +34 -0
- package/src/components/atoms/CustomChip/styles.js +6 -0
- package/src/components/atoms/FeatureTagv2/FeatureTagv2.stories.js +16 -0
- package/src/components/atoms/FeatureTagv2/index.js +10 -0
- package/src/components/atoms/FeatureTagv2/styles.js +56 -0
- package/src/components/atoms/GeneralButton/styles.js +46 -0
- package/src/components/atoms/GeneralInput/index.js +3 -0
- package/src/components/atoms/GeneralInput/styles.js +19 -1
- package/src/components/atoms/GeneralInputv2/GeneralInputv2.stories.js +33 -0
- package/src/components/atoms/GeneralInputv2/index.js +155 -0
- package/src/components/atoms/GeneralInputv2/styles.js +67 -0
- package/src/components/atoms/InputFormatter/index.js +2 -1
- package/src/components/atoms/InputFormatter/styles.js +9 -4
- package/src/components/atoms/InputFormatterv2/Wysiwyg.stories.js +12 -0
- package/src/components/atoms/InputFormatterv2/index.js +148 -0
- package/src/components/atoms/InputFormatterv2/styles.js +39 -0
- package/src/components/atoms/InputImages/InputImages.stories.js +19 -0
- package/src/components/atoms/InputImages/index.js +25 -0
- package/src/components/atoms/InputImages/styles.js +17 -0
- package/src/components/atoms/Multiselect/Multiselect.stories.js +364 -0
- package/src/components/atoms/Multiselect/index.js +351 -0
- package/src/components/atoms/Multiselect/styles.js +33 -0
- package/src/components/atoms/NumberMandatory/NumberMandatory.stories.js +19 -0
- package/src/components/atoms/NumberMandatory/index.js +16 -0
- package/src/components/atoms/NumberMandatory/styles.js +11 -0
- package/src/components/atoms/ObservationFlag/ObservationFlag.stories.js +20 -0
- package/src/components/atoms/ObservationFlag/index.js +167 -0
- package/src/components/atoms/ObservationFlag/styles.js +104 -0
- package/src/components/atoms/PriorityFlagv2/PriorityFlagv2.stories.js +20 -0
- package/src/components/atoms/PriorityFlagv2/index.js +20 -0
- package/src/components/atoms/PriorityFlagv2/styles.js +6 -0
- package/src/components/atoms/ProductImage/index.js +24 -11
- package/src/components/atoms/ProductImage/styles.js +7 -0
- package/src/components/atoms/ProductImagev2/ProductImagev2.stories.js +28 -0
- package/src/components/atoms/ProductImagev2/index.js +16 -0
- package/src/components/atoms/ProductImagev2/styles.js +62 -0
- package/src/components/atoms/Progress/Progress.stories.js +25 -0
- package/src/components/atoms/Progress/index.js +74 -0
- package/src/components/atoms/Progress/styles.js +98 -0
- package/src/components/atoms/ScreenHeaderv2/ScreenHeaderv2.stories.js +53 -0
- package/src/components/atoms/ScreenHeaderv2/index.js +134 -0
- package/src/components/atoms/ScreenHeaderv2/styles.js +103 -0
- package/src/components/atoms/Selectv2/VersionSelect.js +27 -0
- package/src/components/atoms/Selectv2/index.js +35 -0
- package/src/components/atoms/Selectv2/style.js +93 -0
- package/src/components/atoms/SliderToolTip/styles.js +1 -1
- package/src/components/atoms/TabSection/index.js +1 -1
- package/src/components/atoms/TabSection/styles.js +0 -3
- package/src/components/atoms/TabSectionv2/TabSection.stories.js +25 -0
- package/src/components/atoms/TabSectionv2/index.js +9 -0
- package/src/components/atoms/TabSectionv2/styles.js +20 -0
- package/src/components/atoms/TooltipLight/Tooltip.stories.js +20 -0
- package/src/components/atoms/TooltipLight/index.js +46 -0
- package/src/components/atoms/TooltipLight/styles.js +65 -0
- package/src/components/atoms/WordsMissing/Wysiwyg.stories.js +12 -0
- package/src/components/atoms/WordsMissing/index.js +60 -0
- package/src/components/atoms/WordsMissing/styles.js +10 -0
- package/src/components/molecules/AddGroup/AddGroup.stories.js +15 -0
- package/src/components/molecules/AddGroup/index.js +84 -0
- package/src/components/molecules/AddGroup/styles.js +141 -0
- package/src/components/molecules/AsignationInfo/AsignationInfo.stories.js +17 -0
- package/src/components/molecules/AsignationInfo/index.js +108 -0
- package/src/components/molecules/AsignationInfo/styles.js +86 -0
- package/src/components/molecules/BoxAttribute/index.js +32 -25
- package/src/components/molecules/BoxAttribute/styles.js +1 -1
- package/src/components/molecules/BoxButtons/index.js +23 -22
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/EditionActiveImagev2/EditionActiveImagev2.stories.js +12 -0
- package/src/components/molecules/EditionActiveImagev2/index.js +15 -0
- package/src/components/molecules/EditionActiveImagev2/styles.js +7 -0
- package/src/components/molecules/EditionTabs/EditionTabs.stories.js +12 -0
- package/src/components/molecules/EditionTabs/index.js +33 -0
- package/src/components/molecules/EditionTabs/styles.js +24 -0
- package/src/components/molecules/FeaturesBarv2/FeaturesBarv2.stories.js +20 -0
- package/src/components/molecules/FeaturesBarv2/index.js +32 -0
- package/src/components/molecules/FeaturesBarv2/styles.js +17 -0
- package/src/components/molecules/GalleryElement/index.js +76 -1
- package/src/components/molecules/GalleryElementv2/GalleryElementv2.stories.js +30 -0
- package/src/components/molecules/GalleryElementv2/index.js +142 -0
- package/src/components/molecules/GalleryElementv2/styles.js +119 -0
- package/src/components/molecules/GalleryHeader/index.js +1 -0
- package/src/components/molecules/GalleryHeaderv2/GalleryHeaderv2.stories.js +10 -0
- package/src/components/molecules/GalleryHeaderv2/index.js +25 -0
- package/src/components/molecules/GalleryHeaderv2/styles.js +47 -0
- package/src/components/molecules/GroupSelect/GroupSelect.stories.js +35 -0
- package/src/components/molecules/GroupSelect/SelectItem.js +105 -0
- package/src/components/molecules/GroupSelect/index.js +190 -0
- package/src/components/molecules/GroupSelect/styles.js +124 -0
- package/src/components/molecules/HeaderTop/index.js +52 -6
- package/src/components/molecules/HeaderTopv2/HeaderTopv2.stories.js +10 -0
- package/src/components/molecules/HeaderTopv2/index.js +100 -0
- package/src/components/molecules/HeaderTopv2/styles.js +33 -0
- package/src/components/molecules/ImageSelectorv2/ImageSelectorv2.stories.js +46 -0
- package/src/components/molecules/ImageSelectorv2/index.js +22 -0
- package/src/components/molecules/ImageSelectorv2/styles.js +15 -0
- package/src/components/molecules/Phase/Phase.stories.js +107 -0
- package/src/components/molecules/Phase/index.js +391 -0
- package/src/components/molecules/Phase/styles.js +97 -0
- package/src/components/molecules/ProductNameHeader/index.js +19 -1
- package/src/components/molecules/ProductNameHeaderv2/ProductNameHeaderv2.stories.js +37 -0
- package/src/components/molecules/ProductNameHeaderv2/index.js +12 -0
- package/src/components/molecules/ProductNameHeaderv2/styles.js +10 -0
- package/src/components/molecules/ProductSkuStatus/ProductSkuStatus.stories.js +37 -0
- package/src/components/molecules/ProductSkuStatus/index.js +26 -0
- package/src/components/molecules/ProductSkuStatus/styles.js +7 -0
- package/src/components/molecules/RetailerSelectorv2/RetailerSelectorv2.stories.js +35 -0
- package/src/components/molecules/RetailerSelectorv2/index.js +80 -0
- package/src/components/molecules/RetailerSelectorv2/styles.js +21 -0
- package/src/components/molecules/ServiceDataValidator/ServiceDataValidator.stories.js +90 -0
- package/src/components/molecules/ServiceDataValidator/index.js +49 -0
- package/src/components/molecules/ServiceDataValidator/styles.js +36 -0
- package/src/components/molecules/SignInLogin/index.js +11 -11
- package/src/components/molecules/StatusAsignationInfo/FinancedCompanies.js +501 -63
- package/src/components/molecules/StatusAsignationInfo/index.js +1 -1
- package/src/components/molecules/StatusRetailer/StatusAsignationInfo.stories.js +17 -0
- package/src/components/molecules/StatusRetailer/index.js +55 -0
- package/src/components/molecules/StatusRetailer/styles.js +85 -0
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +1 -2
- package/src/components/molecules/TabsMenuv2/TabsMenuv2.stories.js +19 -0
- package/src/components/molecules/TabsMenuv2/index.js +112 -0
- package/src/components/molecules/TabsMenuv2/styles.js +19 -0
- package/src/components/molecules/TagAndInput/index.js +8 -6
- package/src/components/molecules/TagAndInputv2/TagAndInputv2.stories.js +24 -0
- package/src/components/molecules/TagAndInputv2/index.js +86 -0
- package/src/components/molecules/TagAndInputv2/styles.js +35 -0
- package/src/components/molecules/Validation/Validation.stories.js +12 -0
- package/src/components/molecules/Validation/index.js +77 -0
- package/src/components/molecules/Validation/styles.js +19 -0
- package/src/components/molecules/VersionItemv2/VersionItemv2.stories.js +14 -0
- package/src/components/molecules/VersionItemv2/index.js +59 -0
- package/src/components/molecules/VersionItemv2/styles.js +47 -0
- package/src/components/organisms/BarButtons/BarButtons.stories.js +13 -0
- package/src/components/organisms/BarButtons/index.js +150 -0
- package/src/components/organisms/BarButtons/styles.js +54 -0
- package/src/components/organisms/Chat/Chat.stories.js +27 -7
- package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
- package/src/components/organisms/Chat/ContainerItems/styles.js +14 -2
- package/src/components/organisms/Chat/ContentChat/index.js +88 -12
- package/src/components/organisms/Chat/Footer/index.js +11 -0
- package/src/components/organisms/Chat/index.js +46 -4
- package/src/components/organisms/Chat/styles.js +4 -0
- package/src/components/organisms/Chatv2/ChatLists/ChatLists.stories.js +65 -0
- package/src/components/organisms/Chatv2/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chatv2/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chatv2/ChatLists/index.js +141 -0
- package/src/components/organisms/Chatv2/ChatLists/styles.js +162 -0
- package/src/components/organisms/Chatv2/Chatv2.stories.js +184 -0
- package/src/components/organisms/Chatv2/ContainerItems/ContainerItems.stories.js +142 -0
- package/src/components/organisms/Chatv2/ContainerItems/index.js +538 -0
- package/src/components/organisms/Chatv2/ContainerItems/styles.js +360 -0
- package/src/components/organisms/Chatv2/ContentChat/ContentChat.stories.js +102 -0
- package/src/components/organisms/Chatv2/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chatv2/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chatv2/ContentChat/index.js +1016 -0
- package/src/components/organisms/Chatv2/ContentChat/styles.js +44 -0
- package/src/components/organisms/Chatv2/Footer/Footer.stories.js +22 -0
- package/src/components/organisms/Chatv2/Footer/index.js +668 -0
- package/src/components/organisms/Chatv2/Footer/styles.js +290 -0
- package/src/components/organisms/Chatv2/Header/Header.stories.js +66 -0
- package/src/components/organisms/Chatv2/Header/index.js +93 -0
- package/src/components/organisms/Chatv2/Header/styles.js +49 -0
- package/src/components/organisms/Chatv2/index.js +281 -0
- package/src/components/organisms/Chatv2/styles.js +85 -0
- package/src/components/organisms/CompleteServices/CompleteServices.stories.js +91 -0
- package/src/components/organisms/CompleteServices/index.js +82 -0
- package/src/components/organisms/CompleteServices/styles.js +35 -0
- package/src/components/organisms/DashboardMetric/index.js +6 -3
- package/src/components/organisms/DragAndDropPhases/DragAndDropPhases.stories.js +13 -0
- package/src/components/organisms/DragAndDropPhases/index.js +336 -0
- package/src/components/organisms/DragAndDropPhases/styles.js +107 -0
- package/src/components/organisms/DragPrueba/DragPrueba.stories.js +12 -0
- package/src/components/organisms/DragPrueba/index.js +57 -0
- package/src/components/organisms/DragPrueba/styles.js +8 -0
- package/src/components/organisms/EditGroup/EditGroup.stories.js +20 -0
- package/src/components/organisms/EditGroup/index.js +321 -0
- package/src/components/organisms/EditGroup/styles.js +207 -0
- package/src/components/organisms/FullProductNameHeader/index.js +13 -1
- package/src/components/organisms/FullProductNamev2/FullProductNamev2.stories.js +28 -0
- package/src/components/organisms/FullProductNamev2/index.js +101 -0
- package/src/components/organisms/FullProductNamev2/styles.js +49 -0
- package/src/components/organisms/FullTabsMenuv2/FullTabsMenuv2.stories.js +22 -0
- package/src/components/organisms/FullTabsMenuv2/index.js +142 -0
- package/src/components/organisms/FullTabsMenuv2/styles.js +47 -0
- package/src/components/organisms/GridProducts/GridProducts.stories.js +682 -107
- package/src/components/organisms/ImageDataTablev2/ImageDataTablev2.stories.js +24 -0
- package/src/components/organisms/ImageDataTablev2/index.js +124 -0
- package/src/components/organisms/ImageDataTablev2/styles.js +18 -0
- package/src/components/organisms/ImagePreviewerv2/ImagePreviewerv2.stories.js +38 -0
- package/src/components/organisms/ImagePreviewerv2/index.js +22 -0
- package/src/components/organisms/ImagePreviewerv2/styles.js +7 -0
- package/src/components/organisms/ImageUploader/ImageUploader.stories.js +15 -0
- package/src/components/organisms/ImageUploader/index.js +62 -0
- package/src/components/organisms/ImageUploader/styles.js +29 -0
- package/src/components/organisms/ImageVisor/ImageVisor.stories.js +15 -0
- package/src/components/organisms/ImageVisor/index.js +143 -0
- package/src/components/organisms/ImageVisor/styles.js +106 -0
- package/src/components/organisms/InputGroup/index.js +292 -144
- package/src/components/organisms/InputGroup/styles.js +31 -0
- package/src/components/organisms/InputGroupv2/InputGroupv2.stories.js +31 -0
- package/src/components/organisms/InputGroupv2/index.js +296 -0
- package/src/components/organisms/InputGroupv2/styles.js +90 -0
- package/src/components/organisms/MandatoryBar/MandatoryBar.stories.js +18 -0
- package/src/components/organisms/MandatoryBar/index.js +31 -0
- package/src/components/organisms/MandatoryBar/styles.js +12 -0
- package/src/components/organisms/Modal/Modal.stories.js +2 -1
- package/src/components/organisms/Modal/index.js +9 -2
- package/src/components/organisms/Modal/styles.js +8 -1
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +6 -16
- package/src/components/organisms/ProductImageModalv2/ProductImageModalv2.stories.js +90 -0
- package/src/components/organisms/ProductImageModalv2/index.js +105 -0
- package/src/components/organisms/ProductImageModalv2/styles.js +71 -0
- package/src/components/organisms/RenameImagesBar/RenameImagesBar.stories.js +18 -0
- package/src/components/organisms/RenameImagesBar/index.js +30 -0
- package/src/components/organisms/RenameImagesBar/styles.js +12 -0
- package/src/components/organisms/Table/Table.stories.js +609 -0
- package/src/components/organisms/Table/index.js +84 -0
- package/src/components/organisms/Table/styles.js +114 -0
- package/src/components/organisms/VersionSelectorv2/VersionSelectorv2.stories.js +15 -0
- package/src/components/organisms/VersionSelectorv2/index.js +105 -0
- package/src/components/organisms/VersionSelectorv2/styles.js +45 -0
- package/src/components/pages/Dashboard/Dashboard.stories.js +33 -38
- package/src/components/pages/Dashboard/index.js +36 -7
- package/src/components/pages/MultipleEdition/MultipleEdition.stories.js +17 -0
- package/src/components/pages/MultipleEdition/components/ImageUploader.js +62 -0
- package/src/components/pages/MultipleEdition/components/ImageUploaderStyles.js +29 -0
- package/src/components/pages/MultipleEdition/components/ImageVisor.js +143 -0
- package/src/components/pages/MultipleEdition/components/styles.js +106 -0
- package/src/components/pages/MultipleEdition/index.js +248 -0
- package/src/components/pages/MultipleEdition/saveData.js +92 -0
- package/src/components/pages/MultipleEdition/styles.js +201 -0
- package/src/components/pages/MultipleEdition/utils.js +1073 -0
- package/src/components/pages/ProductEditionv2/ProductEditionv2.stories.js +213 -0
- package/src/components/pages/ProductEditionv2/index.js +1758 -0
- package/src/components/pages/ProductEditionv2/styles.js +154 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +56 -60
- package/src/components/pages/ProviderProductEdition/index.js +148 -133
- package/src/components/pages/ProviderProductEdition/styles.js +5 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +4 -0
- package/src/components/pages/RetailerProductEdition/generateThumnail.js +21 -0
- package/src/components/pages/RetailerProductEdition/index.js +293 -300
- package/src/components/pages/RetailerProductEdition/styles.js +4 -0
- package/src/components/pages/RetailerProductEdition/utils.js +37 -0
- package/src/global-files/data.js +6 -10
- package/src/global-files/variables.js +6 -0
- package/src/index.js +12 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const Container = styled.div`
|
|
4
|
+
background: #fff;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
height: 100%;
|
|
7
|
+
overflow-x: auto;
|
|
8
|
+
width: 100%;
|
|
9
|
+
margin-right: 30px;
|
|
10
|
+
.checkbox_fixed {
|
|
11
|
+
left: 0px;
|
|
12
|
+
position: sticky;
|
|
13
|
+
z-index: 5;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.custom-table {
|
|
17
|
+
border-collapse: collapse;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
width: 100%;
|
|
20
|
+
& > thead {
|
|
21
|
+
top: 0;
|
|
22
|
+
height: 45px;
|
|
23
|
+
position: sticky;
|
|
24
|
+
z-index: 2;
|
|
25
|
+
& > tr {
|
|
26
|
+
background-color: #f7f7fc;
|
|
27
|
+
border-radius: 5px 5px 0px 0px;
|
|
28
|
+
height: 45px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
& > tbody > tr {
|
|
32
|
+
height: 70px;
|
|
33
|
+
&:last-child {
|
|
34
|
+
border-radius: 0px 0px 5px 5px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.custom-table th,
|
|
40
|
+
.custom-table td {
|
|
41
|
+
padding: 8px;
|
|
42
|
+
border: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.custom-table th {
|
|
46
|
+
border-radius: 5px 0 0 5px;
|
|
47
|
+
border: 0;
|
|
48
|
+
color: var(--black-main, #262626);
|
|
49
|
+
font-family: Roboto;
|
|
50
|
+
font-size: 12px;
|
|
51
|
+
font-style: normal;
|
|
52
|
+
font-weight: 500;
|
|
53
|
+
line-height: normal;
|
|
54
|
+
text-align: left;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.custom-table tr {
|
|
58
|
+
background: var(--white-main, #fff);
|
|
59
|
+
border-bottom: 1px solid var(--grey-light, #f0f0f0);
|
|
60
|
+
border-left: 1px solid var(--grey-light, #f0f0f0);
|
|
61
|
+
border-right: 1px solid var(--grey-light, #f0f0f0);
|
|
62
|
+
& > td {
|
|
63
|
+
color: var(--grey-main, #707070);
|
|
64
|
+
font-family: Roboto;
|
|
65
|
+
font-size: 12px;
|
|
66
|
+
font-style: normal;
|
|
67
|
+
font-weight: 400;
|
|
68
|
+
line-height: normal;
|
|
69
|
+
gap:5px;
|
|
70
|
+
}
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
${({ withCheckbox }) => withCheckbox && `padding-left: 10px;`}
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
|
|
77
|
+
export const TH = styled.th`
|
|
78
|
+
background: inherit;
|
|
79
|
+
min-height: ${({ height }) => height ?? "auto"};
|
|
80
|
+
min-width: ${({ width }) => width ?? "auto"};
|
|
81
|
+
position: sticky;
|
|
82
|
+
left: ${({ fixedToLeft }) => (fixedToLeft >= 0 ? `${fixedToLeft}px` : "20px")};
|
|
83
|
+
${({ fixedToLeft, withCheckbox }) =>
|
|
84
|
+
fixedToLeft >= 0 &&
|
|
85
|
+
css`
|
|
86
|
+
left: ${withCheckbox ? 20 + fixedToLeft : fixedToLeft}px;
|
|
87
|
+
z-index: 10;
|
|
88
|
+
`}
|
|
89
|
+
`;
|
|
90
|
+
|
|
91
|
+
export const TD = styled.td`
|
|
92
|
+
align-items: center;
|
|
93
|
+
background: inherit;
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
display: flex;
|
|
96
|
+
height: 100%;
|
|
97
|
+
min-width: ${({ width }) => width ?? "auto"};
|
|
98
|
+
text-align: center;
|
|
99
|
+
vertical-align: middle;
|
|
100
|
+
z-index: 5;
|
|
101
|
+
position: sticky;
|
|
102
|
+
left: ${({ fixedToLeft }) => (fixedToLeft >= 0 ? `${fixedToLeft}px` : "20px")};
|
|
103
|
+
.content {
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
/* text-overflow: ellipsis; */
|
|
107
|
+
}
|
|
108
|
+
${({ fixedToLeft, withCheckbox }) =>
|
|
109
|
+
fixedToLeft >= 0 &&
|
|
110
|
+
css`
|
|
111
|
+
left: ${withCheckbox ? 20 + fixedToLeft : fixedToLeft}px;
|
|
112
|
+
z-index: 10;
|
|
113
|
+
`}
|
|
114
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VersionSelectorv2 } from "./index";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/organisms/VersionSelectorv2",
|
|
5
|
+
component: VersionSelectorv2,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args) => <VersionSelectorv2 {...args} />;
|
|
9
|
+
|
|
10
|
+
export const VersionSelectorv2Default = Template.bind({});
|
|
11
|
+
VersionSelectorv2Default.args = {
|
|
12
|
+
articleId: 35707,
|
|
13
|
+
companyName: "COMPANY DEV",
|
|
14
|
+
currentVersion: 7,
|
|
15
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { ScreenHeader } from "../../atoms/ScreenHeader";
|
|
5
|
+
import { Button } from "../../atoms/GeneralButton";
|
|
6
|
+
import addVersion from "../../../assets/images/versionSelector/addVersion.svg";
|
|
7
|
+
import closeIcon from "../../../assets/images/versionSelector/closeVersionSelector.svg";
|
|
8
|
+
import { GlobalColors } from "../../../global-files/variables";
|
|
9
|
+
import { FontFamily } from "../../../global-files/variables";
|
|
10
|
+
import { VersionItemv2 } from "../../molecules/VersionItemv2";
|
|
11
|
+
import { CreateVersion } from "../../organisms/CreateVersion";
|
|
12
|
+
import { useCloseModal } from "../../../global-files/customHooks";
|
|
13
|
+
|
|
14
|
+
export const VersionSelectorv2 = ({
|
|
15
|
+
modalId,
|
|
16
|
+
articleId,
|
|
17
|
+
setVersion,
|
|
18
|
+
companyName,
|
|
19
|
+
currentVersion,
|
|
20
|
+
setShowVersionSelector,
|
|
21
|
+
jwt,
|
|
22
|
+
}) => {
|
|
23
|
+
const [versions, setVersions] = useState([]);
|
|
24
|
+
const [showCreateVersion, setShowCreateVersion] =
|
|
25
|
+
useCloseModal("create-version");
|
|
26
|
+
const [reload, setReload] = useState(false);
|
|
27
|
+
|
|
28
|
+
const loadProductVersions = async (articleId) => {
|
|
29
|
+
try {
|
|
30
|
+
const response = await axios.get(
|
|
31
|
+
`${process.env.REACT_APP_VERSIONS_ENDPOINT}?articleId=${articleId}&provider=true`,
|
|
32
|
+
{
|
|
33
|
+
headers: {
|
|
34
|
+
Authorization: jwt,
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const versionList = JSON.parse(response.data.body).data;
|
|
40
|
+
setVersions(versionList);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.log(error);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
const ac = new AbortController();
|
|
48
|
+
loadProductVersions(articleId);
|
|
49
|
+
|
|
50
|
+
return () => {
|
|
51
|
+
setVersions([]);
|
|
52
|
+
setShowCreateVersion(false);
|
|
53
|
+
return () => ac.abort(); // Abort both fetches on unmount
|
|
54
|
+
};
|
|
55
|
+
}, [reload]);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Container id={modalId}>
|
|
59
|
+
<div className="versions-header">
|
|
60
|
+
<ScreenHeader
|
|
61
|
+
text={"Versiones"}
|
|
62
|
+
headerType={"input-name-header"}
|
|
63
|
+
color={GlobalColors.gray}
|
|
64
|
+
fontFamily={FontFamily.Lato}
|
|
65
|
+
/>
|
|
66
|
+
<div className="buttons-container">
|
|
67
|
+
<Button
|
|
68
|
+
image={addVersion}
|
|
69
|
+
buttonType={"circular-button"}
|
|
70
|
+
onClick={() => setShowCreateVersion(true)}
|
|
71
|
+
id="add-version"
|
|
72
|
+
/>
|
|
73
|
+
<Button
|
|
74
|
+
buttonType="general-white-button close-button"
|
|
75
|
+
onClick={() => setShowVersionSelector(false)}
|
|
76
|
+
id="close-button"
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
<div className="versions-container">
|
|
81
|
+
{versions?.map((item) => (
|
|
82
|
+
<VersionItemv2
|
|
83
|
+
key={item.version}
|
|
84
|
+
version={item.version}
|
|
85
|
+
articleStatus={item.article_status}
|
|
86
|
+
currentVersion={item.version === currentVersion}
|
|
87
|
+
productOwner={companyName}
|
|
88
|
+
setVersion={setVersion}
|
|
89
|
+
timestamp={item.timestamp}
|
|
90
|
+
/>
|
|
91
|
+
))}
|
|
92
|
+
</div>
|
|
93
|
+
{showCreateVersion && (
|
|
94
|
+
<CreateVersion
|
|
95
|
+
articleId={articleId}
|
|
96
|
+
version={currentVersion}
|
|
97
|
+
versionsList={versions}
|
|
98
|
+
setShowCreateVersion={setShowCreateVersion}
|
|
99
|
+
realoadVersion={() => setReload(!reload)}
|
|
100
|
+
jwt={jwt}
|
|
101
|
+
/>
|
|
102
|
+
)}
|
|
103
|
+
</Container>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { GlobalColors } from "../../../global-files/variables";
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
width: 300px;
|
|
6
|
+
height: 100%;
|
|
7
|
+
background-color: ${GlobalColors.white};
|
|
8
|
+
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.4);
|
|
9
|
+
overflow: auto;
|
|
10
|
+
position: absolute;
|
|
11
|
+
right: 20px;
|
|
12
|
+
top: 0;
|
|
13
|
+
z-index: 500;
|
|
14
|
+
|
|
15
|
+
.versions-header {
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
align-items: center;
|
|
19
|
+
height: 44px;
|
|
20
|
+
border-radius: 10px 10px 0 0;
|
|
21
|
+
background: #F9F9F9;
|
|
22
|
+
padding:5px 10px;
|
|
23
|
+
|
|
24
|
+
.buttons-container {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
|
|
28
|
+
button + * {
|
|
29
|
+
margin-left: 10px;
|
|
30
|
+
width: 24px;
|
|
31
|
+
height: 24px;
|
|
32
|
+
border: 1px solid ${GlobalColors.magenta_s2};
|
|
33
|
+
background-size: 12px;
|
|
34
|
+
padding: 0;
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
align-items: center;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.versions-container{
|
|
42
|
+
padding:5px 10px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
`;
|
|
@@ -9,59 +9,54 @@ const Template = (args) => <Dashboard {...args} />;
|
|
|
9
9
|
export const DashboardDeafult = Template.bind({});
|
|
10
10
|
DashboardDeafult.args = {
|
|
11
11
|
user: {
|
|
12
|
-
id_user:
|
|
13
|
-
name: "
|
|
14
|
-
last_name: "
|
|
15
|
-
email: "
|
|
16
|
-
position: "
|
|
17
|
-
telephone: "",
|
|
12
|
+
id_user: 343,
|
|
13
|
+
name: "Jair",
|
|
14
|
+
last_name: "León",
|
|
15
|
+
email: "hleon@contentoh.com",
|
|
16
|
+
position: "Test States",
|
|
17
|
+
telephone: "+525555555555",
|
|
18
18
|
country: "México",
|
|
19
|
-
id_company:
|
|
20
|
-
id_cognito: "
|
|
19
|
+
id_company: 234,
|
|
20
|
+
id_cognito: "4512b5a5-366a-4bb5-916e-aafe05402992",
|
|
21
21
|
birth_Date: null,
|
|
22
22
|
about_me: "",
|
|
23
23
|
zip_code: "",
|
|
24
24
|
address: "",
|
|
25
25
|
job: "",
|
|
26
|
-
id_stripe: "",
|
|
27
|
-
id_role:
|
|
26
|
+
id_stripe: "cus_KuEt6R6vwmN09f",
|
|
27
|
+
id_role: 0,
|
|
28
28
|
active: 1,
|
|
29
29
|
is_retailer: 0,
|
|
30
|
-
email_notify:
|
|
31
|
-
is_user_tech:
|
|
30
|
+
email_notify: 0,
|
|
31
|
+
is_user_tech: "ADMIN-AS",
|
|
32
32
|
membership: {
|
|
33
|
-
id:
|
|
34
|
-
start_date: "
|
|
35
|
-
end_date: "
|
|
36
|
-
planID:
|
|
37
|
-
plan: "
|
|
38
|
-
name: "Plan
|
|
39
|
-
user_limit: "
|
|
40
|
-
products_limit: "
|
|
41
|
-
type: "
|
|
33
|
+
id: 139,
|
|
34
|
+
start_date: "2023-10-04T15:46:14.000Z",
|
|
35
|
+
end_date: "2024-10-04T08:46:09.000Z",
|
|
36
|
+
planID: 9,
|
|
37
|
+
plan: "prod_KtlkzZVGq6bRTO",
|
|
38
|
+
name: "Plan Enterprise Full",
|
|
39
|
+
user_limit: "30",
|
|
40
|
+
products_limit: "10000",
|
|
41
|
+
type: "Enterprise",
|
|
42
42
|
},
|
|
43
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
43
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-343/343.png?1699640943284",
|
|
44
44
|
},
|
|
45
45
|
company: {
|
|
46
|
-
id_company:
|
|
47
|
-
trade_name: "
|
|
48
|
-
company_name: "
|
|
46
|
+
id_company: 234,
|
|
47
|
+
trade_name: "L'ORÉAL",
|
|
48
|
+
company_name: "L'ORÉAL",
|
|
49
49
|
rfc: "XAXX010101000",
|
|
50
50
|
adress: "AA",
|
|
51
|
-
about_company: "",
|
|
52
|
-
telephone: "",
|
|
53
|
-
web_site: "",
|
|
54
|
-
zip_code: "",
|
|
51
|
+
about_company: " ",
|
|
52
|
+
telephone: " ",
|
|
53
|
+
web_site: " ",
|
|
54
|
+
zip_code: " ",
|
|
55
55
|
email: null,
|
|
56
|
-
social_link: "",
|
|
56
|
+
social_link: " ",
|
|
57
57
|
is_retailer: 0,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
id: null,
|
|
61
|
-
name: null,
|
|
62
|
-
country: null,
|
|
63
|
-
},
|
|
64
|
-
],
|
|
58
|
+
financedRetailers: [],
|
|
59
|
+
retailers: [],
|
|
65
60
|
},
|
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WoCpAabGRy9HtGSZ9KUuZlXICz13TTvgOfxFIv5duwS2vxYIlE1ZuLPHXSm2L4FuwJHcppedxssPNgfmxmVu-4B0SaMNWynjIWwbt_wumb2spwe3ONTcuRI-UgmJo_Rfa_cKUOiL-oNCQwkX6KhuWRGcfcpoUkfhi6tfOAgkA8VT5D8h-Dgawg5ibRnbjRMQejfNg1vVh_d2MpYhX9ve5SM9r1JdRCowgxMjb3ii6eXnng_UqjRdrB4008wkG8iZbz2C_NVJjJGrt1B454MZZmRvHbRogs-uu6U1JUsDW09qhcCg",
|
|
67
62
|
};
|
|
@@ -40,6 +40,8 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
40
40
|
const [applicantsFilter, setApplicantsFilter] = useState([]);
|
|
41
41
|
const [totalCount, setTotalCount] = useState(0);
|
|
42
42
|
const [isProviderFinanced] = useState(company?.financedRetailers?.length > 0);
|
|
43
|
+
const [trades, setTrades] = useState([]);
|
|
44
|
+
const [tradesSelected, setTradesSelected] = useState([]);
|
|
43
45
|
|
|
44
46
|
const loadProductVersions = async (queryObject) => {
|
|
45
47
|
const keys = Object.keys(queryObject);
|
|
@@ -84,9 +86,10 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
84
86
|
const isRetailer = user.is_retailer && company.retailers;
|
|
85
87
|
const isProvider = !user.is_retailer && user.id_role === 0;
|
|
86
88
|
const isCollaborator = user.id_role > 0;
|
|
87
|
-
const { ordersBydate, ordersByStatus } =
|
|
89
|
+
const { ordersBydate, ordersByStatus, ordersByActive, companyTrades } =
|
|
88
90
|
(await loadProductVersions(orderByStatus)) || {};
|
|
89
91
|
|
|
92
|
+
if (trades.length === 0) setTrades(companyTrades);
|
|
90
93
|
const { total = 0, R = 0, PA = 0, Ex = 0, ACA = 0 } = ordersByStatus;
|
|
91
94
|
let productsFinished = 0;
|
|
92
95
|
if (isRetailer) productsFinished = Ex;
|
|
@@ -100,6 +103,8 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
100
103
|
: prev,
|
|
101
104
|
0
|
|
102
105
|
);
|
|
106
|
+
|
|
107
|
+
const registeredProducts = ordersByActive.registered;
|
|
103
108
|
let metricsArray = [
|
|
104
109
|
metricsData[0]
|
|
105
110
|
? metricsData[0]
|
|
@@ -107,6 +112,7 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
107
112
|
];
|
|
108
113
|
|
|
109
114
|
metricsArray.push(
|
|
115
|
+
{ label: "Productos activos", value: registeredProducts },
|
|
110
116
|
{ label: "Productos filtrados", value: total },
|
|
111
117
|
{ label: "Productos sin asignar", value: PA + R },
|
|
112
118
|
{ label: "Productos en proceso", value: inProcess },
|
|
@@ -217,10 +223,13 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
217
223
|
}, []);
|
|
218
224
|
|
|
219
225
|
useEffect(() => {
|
|
220
|
-
|
|
226
|
+
if (
|
|
227
|
+
orderByRequired?.startDate &&
|
|
221
228
|
orderByStatus?.endDate &&
|
|
222
|
-
metricsData.length > 0
|
|
229
|
+
metricsData.length > 0
|
|
230
|
+
) {
|
|
223
231
|
setLoading(false);
|
|
232
|
+
}
|
|
224
233
|
}, [orderByRequired, orderByStatus, metricsData]);
|
|
225
234
|
|
|
226
235
|
useEffect(async () => {
|
|
@@ -229,14 +238,23 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
229
238
|
startDate: startDate,
|
|
230
239
|
endDate: endDate,
|
|
231
240
|
};
|
|
232
|
-
companyId.length > 0
|
|
233
|
-
retailerId.length > 0
|
|
234
|
-
categoryId.length > 0
|
|
241
|
+
if (companyId.length > 0) queryObject["companyId"] = companyId.join(",");
|
|
242
|
+
if (retailerId.length > 0) queryObject["retailerId"] = retailerId.join(",");
|
|
243
|
+
if (categoryId.length > 0) queryObject["categoryId"] = categoryId.join(",");
|
|
244
|
+
if (tradesSelected.length > 0)
|
|
245
|
+
queryObject["trades"] = encodeURIComponent(tradesSelected.join(","));
|
|
235
246
|
applicantsFilter.length > 0 &&
|
|
236
247
|
(queryObject["requestedBy"] = applicantsFilter.join(","));
|
|
237
248
|
|
|
238
249
|
await loadProductsByStatus(queryObject, true);
|
|
239
|
-
}, [
|
|
250
|
+
}, [
|
|
251
|
+
companyId,
|
|
252
|
+
retailerId,
|
|
253
|
+
categoryId,
|
|
254
|
+
datesRange,
|
|
255
|
+
applicantsFilter,
|
|
256
|
+
tradesSelected,
|
|
257
|
+
]);
|
|
240
258
|
|
|
241
259
|
return loading ? (
|
|
242
260
|
<Loading />
|
|
@@ -301,6 +319,17 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
301
319
|
defaultOption="Todos los solicitantes"
|
|
302
320
|
/>
|
|
303
321
|
)}
|
|
322
|
+
{user.id_role === 0 && trades?.length > 0 && (
|
|
323
|
+
<CustomSelect
|
|
324
|
+
showSearchBar={true}
|
|
325
|
+
options={trades}
|
|
326
|
+
selectLabel="Todas las marcas"
|
|
327
|
+
placeHolder="Buscar marca"
|
|
328
|
+
customSelectId="trade-select"
|
|
329
|
+
parameterArray={tradesSelected}
|
|
330
|
+
setParameterArray={setTradesSelected}
|
|
331
|
+
/>
|
|
332
|
+
)}
|
|
304
333
|
</div>
|
|
305
334
|
<div className="metric-cards">
|
|
306
335
|
{metricsData.map((metric, index) => (
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {MultipleEdition} from "./index";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/pages/MultipleEdition",
|
|
5
|
+
component: MultipleEdition,
|
|
6
|
+
};
|
|
7
|
+
const Template = (args) => <MultipleEdition {...args} />;
|
|
8
|
+
|
|
9
|
+
export const MultipleEditionDefault = Template.bind({});
|
|
10
|
+
|
|
11
|
+
MultipleEditionDefault.args = {
|
|
12
|
+
articles: [121219],//[216, 238, 239],
|
|
13
|
+
versions: [1],
|
|
14
|
+
//token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIj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6MTcwMjQxMTc0MSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTcwMjQxNTM0MSwiaWF0IjoxNzAyNDExNzQxLCJlbWFpbCI6ImlzbWFlbDk3bG9wZXpAZ21haWwuY29tIn0.O4Lr5HZLuueNNY1FxqrRBaQZKMgnTXY9IG7KAMkhWO20Dxnfj253sqOme36AbqIAsCQBy77GmnZtTAFs0uF9QBfEDzZXRQ1xcctboGZ9U235LlLdz-BNGoH5QCRXeZsZdXJ1M7yL8IvIdEnXkFC0WYcUMWMRUc6K6vgOvmCCQhzOr-uW-2nsLBGjBb7Tj_okViYvT0Lupo5Z0Z9Xc20oOWnVmrSuaYa1-b4AjOjEOnETA9usnRa6blOVOkHqi5fX8u11ejczINxNBtoizMPOQROuzuuPTvHrl17ae8JkNoxVCJe5ZdfRrUN1lwUXnOZim7QhNg8YR_uvPs_EJRIwfw",
|
|
17
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { useDropzone } from "react-dropzone";
|
|
3
|
+
import { ImageUploaderContainer } from "./ImageUploaderStyles";
|
|
4
|
+
import uploadFile from "../../../../assets/images/Icons/upload_file.svg";
|
|
5
|
+
|
|
6
|
+
const ImageUploader = ({ handleNewImage }) => {
|
|
7
|
+
const [image, setImage] = useState(null);
|
|
8
|
+
|
|
9
|
+
const onDrop = (acceptedFiles) => {
|
|
10
|
+
if (acceptedFiles.length === 1) {
|
|
11
|
+
showImage(acceptedFiles[0]);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const showImage = (file) => {
|
|
16
|
+
const reader = new FileReader();
|
|
17
|
+
reader.onload = () => {
|
|
18
|
+
setImage(reader.result);
|
|
19
|
+
getImageDimensions(reader.result);
|
|
20
|
+
};
|
|
21
|
+
reader.readAsDataURL(file);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const getImageDimensions = (dataURL) => {
|
|
25
|
+
const img = new Image();
|
|
26
|
+
img.onload = () => {
|
|
27
|
+
const image = {
|
|
28
|
+
src: dataURL,
|
|
29
|
+
ext: img.src.includes("image/jpeg") ? "jpg" : "png",
|
|
30
|
+
width: img.width,
|
|
31
|
+
height: img.height,
|
|
32
|
+
};
|
|
33
|
+
handleNewImage(image);
|
|
34
|
+
};
|
|
35
|
+
img.src = dataURL;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop });
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<ImageUploaderContainer {...getRootProps()}>
|
|
42
|
+
<input {...getInputProps()} />
|
|
43
|
+
{image ? (
|
|
44
|
+
<img className="imageLoaded" src={image} alt="Imagen Cargada" />
|
|
45
|
+
) : (
|
|
46
|
+
<>
|
|
47
|
+
<img src={uploadFile} alt="Subir imágen" />
|
|
48
|
+
{isDragActive ? (
|
|
49
|
+
<p>Suelta la imagen aquí</p>
|
|
50
|
+
) : (
|
|
51
|
+
<div>
|
|
52
|
+
<p>Da clic aquí o arrastra la foto para subirla a Content-oh!</p>
|
|
53
|
+
<span>Tamaño de imagen recomendando 3000x3000 pixeles</span>
|
|
54
|
+
</div>
|
|
55
|
+
)}
|
|
56
|
+
</>
|
|
57
|
+
)}
|
|
58
|
+
</ImageUploaderContainer>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default ImageUploader;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const ImageUploaderContainer = styled.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
color: var(--magenta-main, #e33aa9);
|
|
12
|
+
text-align: center;
|
|
13
|
+
font-family: Roboto;
|
|
14
|
+
font-size: 12px;
|
|
15
|
+
font-style: normal;
|
|
16
|
+
font-weight: 400;
|
|
17
|
+
line-height: normal;
|
|
18
|
+
padding: 49px 32px;
|
|
19
|
+
& > div {
|
|
20
|
+
& > p {
|
|
21
|
+
margin-bottom: 10px;
|
|
22
|
+
}
|
|
23
|
+
& > span {
|
|
24
|
+
color: var(--grey-medium, #cbcbcb);
|
|
25
|
+
font-size: 10px;
|
|
26
|
+
font-weight: 400;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|