Skip to content
Snippets Groups Projects
Commit 53d42cc5 authored by Jose Manuel Serrano Amaut's avatar Jose Manuel Serrano Amaut
Browse files

[WIP]: Refactor footer, header nad children at Dropzone component

parent 0f1e71c2
No related branches found
No related tags found
No related merge requests found
.files-ui-dropzone-children-container {
width: 100%;
flex-grow: 1;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
flex-wrap: wrap;
//padding: 5px 0;
background-color: brown;
}
...@@ -3,7 +3,8 @@ import { ...@@ -3,7 +3,8 @@ import {
DropzoneLocalizerSelector, DropzoneLocalizerSelector,
Localization, Localization,
LocalLabels, LocalLabels,
} from "../../core"; } from "../../../../core";
import "./DropzoneChildren.scss";
declare type DropzoneChildrenProps = { declare type DropzoneChildrenProps = {
children?: React.ReactNode | []; children?: React.ReactNode | [];
...@@ -20,12 +21,14 @@ const DropzoneChildren: React.FC<DropzoneChildrenProps> = ( ...@@ -20,12 +21,14 @@ const DropzoneChildren: React.FC<DropzoneChildrenProps> = (
//children will be always consider as more important //children will be always consider as more important
if (children) { if (children) {
return <React.Fragment>{children}</React.Fragment>; return (
<div className="files-ui-dropzone-children-container">{children}</div>
);
} else } else
return ( return (
<React.Fragment> <div className="files-ui-dropzone-children-container">
<label> {label || (DropzoneLocalizer.defaultLabel as string)}</label> <label> {label || (DropzoneLocalizer.defaultLabel as string)}</label>
</React.Fragment> </div>
); );
}; };
export default DropzoneChildren; export default DropzoneChildren;
@import url(https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,900); @import url(https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,900);
.fui-dropzone-root { .fui-dropzone-root {
min-height: 180px;
width: 100%; width: 100%;
min-width: 150px; min-width: 150px;
min-height: 180px;
position: relative; position: relative;
// DISPLAY // DISPLAY
display: flex; display: flex;
flex-wrap: wrap; //flex-wrap: wrap;
flex-direction: row; flex-direction: column;
gap: 0 8px; gap: 0 8px;
justify-content: center; //justify-content: center;
align-items: center; //align-items: center;
padding: 23px 0px; //padding: 23px 0px;
/// label /// label
color: #646c7f; color: #646c7f;
...@@ -48,10 +48,13 @@ ...@@ -48,10 +48,13 @@
} }
.files-ui-header { .files-ui-header {
height: 22px; //-color: brown;
//box-sizing: border-box;
/* height: 22px;
position: absolute; position: absolute;
cursor: text;
top: 0; top: 0;
*/
cursor: text;
display: flex; display: flex;
//width: calc(100% - 10px); //width: calc(100% - 10px);
width: 100%; width: 100%;
...@@ -60,11 +63,11 @@ ...@@ -60,11 +63,11 @@
justify-content: flex-end; justify-content: flex-end;
//font-family: "Poppins", sans-serif; //font-family: "Poppins", sans-serif;
font-family: inherit; font-family: inherit;
padding-right: 10px; //padding-right: 10px;
font-size: 1rem; font-size: 1rem;
@media (max-width: 960px) { @media (max-width: 960px) {
width: calc(100% - 1px); //width: calc(100% - 1px);
padding-right: 1px; //padding-right: 1px;
font-size: 0.8rem; font-size: 0.8rem;
} }
} }
...@@ -73,11 +76,11 @@ ...@@ -73,11 +76,11 @@
border-bottom-left-radius: 8px; border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px; border-bottom-right-radius: 8px;
box-sizing: border-box; box-sizing: border-box;
height: 23px;
position: absolute;
cursor: text; cursor: text;
/* height: 23px;
position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0; */
// width: calc(100% - 10px); // width: calc(100% - 10px);
width: 100%; width: 100%;
display: flex; display: flex;
...@@ -97,9 +100,10 @@ ...@@ -97,9 +100,10 @@
-webkit-line-clamp: 1; /* number of lines to show */ -webkit-line-clamp: 1; /* number of lines to show */
line-clamp: 1; line-clamp: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
//background-color: brown;
@media (max-width: 960px) { @media (max-width: 960px) {
width: calc(100% - 1px); //width: calc(100% - 1px);
padding-left: 1px; padding-left: 1px;
font-size: 0.9rem; font-size: 0.9rem;
} }
......
...@@ -16,7 +16,7 @@ import { ...@@ -16,7 +16,7 @@ import {
FunctionLabel, FunctionLabel,
ExtFileManager, ExtFileManager,
sleepPreparing, sleepPreparing,
UploadResponse, //UploadResponse,
instantPreparingToUploadOne, instantPreparingToUploadOne,
fakeFuiUpload, fakeFuiUpload,
uploadExtFile, uploadExtFile,
...@@ -35,8 +35,10 @@ import { ...@@ -35,8 +35,10 @@ import {
//DropzoneActionButton, //DropzoneActionButton,
DropzoneActions, DropzoneActions,
DropzoneProps, DropzoneProps,
FooterConfig,
HeaderConfig,
} from "./DropzoneProps"; } from "./DropzoneProps";
import DropzoneChildren from "./../../DropzoneChildren"; import DropzoneChildren from "../DropzoneChildren/DropzoneChildren";
import useDropzoneClassName from "./../../useDropzoneClassName"; import useDropzoneClassName from "./../../useDropzoneClassName";
import DropzoneDisabledLayer from "../DropzoneDisabledLayer/DropzoneDisabledLayer"; import DropzoneDisabledLayer from "../DropzoneDisabledLayer/DropzoneDisabledLayer";
...@@ -85,8 +87,8 @@ const Dropzone: React.FC<DropzoneProps> = (props: DropzoneProps) => { ...@@ -85,8 +87,8 @@ const Dropzone: React.FC<DropzoneProps> = (props: DropzoneProps) => {
onUploadStart, onUploadStart,
onUploadFinish, onUploadFinish,
actionButtons, actionButtons,
headerConfig, headerConfig = {},
footerConfg, footerConfg = {},
//advancedConfig, //advancedConfig,
...rest ...rest
} = mergeProps(props, defaultDrozoneProps); } = mergeProps(props, defaultDrozoneProps);
...@@ -111,6 +113,24 @@ const Dropzone: React.FC<DropzoneProps> = (props: DropzoneProps) => { ...@@ -111,6 +113,24 @@ const Dropzone: React.FC<DropzoneProps> = (props: DropzoneProps) => {
style: containerStyle, style: containerStyle,
className: containerClassName, className: containerClassName,
} = actionButtons as DropzoneActions; } = actionButtons as DropzoneActions;
/* const {
cleanFiles: cleanFilesHeader,
deleteFiles,
maxFileSize: maxFileSizeHeader,
uploadFiles,
uploading,
validFilesCount,
customHeader,
}: HeaderConfig = headerConfig;
const {
allowedTypesLabel,
noMissingFilesLabel,
uploadProgressMessage,
uploadResultMessage,
customFooter,
}: FooterConfig = footerConfg; */
//console.log("Dropzone props", dropOnLayer); //console.log("Dropzone props", dropOnLayer);
//localizers //localizers
const DropzoneLocalizer: LocalLabels = const DropzoneLocalizer: LocalLabels =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment