@@ -15,25 +15,30 @@ const useDropzoneStyles = (
1515 color : string | undefined ,
1616 backgroundColor : string | undefined ,
1717 maxHeight : string | undefined ,
18- minHeight : string | undefined
18+ minHeight : string | undefined ,
19+ offset : number
1920) : string => {
2021 const [ idStyles , setIdStyles ] = useState < string > ( "" ) ;
2122 const [ styleInjected , setStyleInjected ] = useState < boolean > ( false ) ;
2223 const [ classNameCreated , setClassNameCreated ] = useState < string > ( "" ) ;
2324
2425 useEffect ( ( ) => {
25- /* const removeStyle = () => {
26- if (styleInjected) {
27- DynamiCSS.removeStyleSheet(idStyles);
28- setStyleInjected(false);
29- setIdStyles("");
30- }
31- }; */
26+ /* const removeStyle = () => {
27+ if (styleInjected) {
28+ DynamiCSS.removeStyleSheet(idStyles);
29+ setStyleInjected(false);
30+ setIdStyles("");
31+ }
32+ }; */
3233 const handleInserStyle = (
33- color : DropzoneProps [ "color" ] , backgroundColor : string | undefined ,
34+ color : DropzoneProps [ "color" ] , backgroundColor : string | undefined ,
3435 maxHeight : string | undefined ,
35- minHeight : string | undefined
36+ minHeight : string | undefined ,
37+ offset : number
3638 ) => {
39+ console . log ( "offset: " , offset ) ;
40+ console . log ( "result" , ( offset === 0 || offset === 50 ) ? "center" : "flex-start" ) ;
41+ console . log ( "minHeight" , `calc(${ minHeight } + ${ offset } px)` ) ;
3742 let styleSheet : DynamicSheet = {
3843 id : "dropzone-ui-styles" ,
3944 sheetRules : [
@@ -46,7 +51,9 @@ const useDropzoneStyles = (
4651 ) } `,
4752 backgroundColor : backgroundColor ,
4853 maxHeight : maxHeight ,
49- minHeight : `calc(${ minHeight } + 50px)`
54+ //minHeight: `calc(${minHeight} + 50px)`
55+ minHeight : `calc(${ minHeight } + ${ offset } px)` ,
56+ //justifyContent: (offset === 0 || offset === 50) ? "center" : "flex-start",
5057 } ,
5158 } ,
5259 {
@@ -83,12 +90,12 @@ const useDropzoneStyles = (
8390 } ;
8491
8592
86- handleInserStyle ( color , backgroundColor , maxHeight , minHeight ) ;
87- /* return () => {
88- removeStyle();
89- } */
93+ handleInserStyle ( color , backgroundColor , maxHeight , minHeight , offset ) ;
94+ /* return () => {
95+ removeStyle();
96+ } */
9097 // eslint-disable-next-line
91- } , [ color , backgroundColor , maxHeight , minHeight ] ) ;
98+ } , [ color , backgroundColor , maxHeight , minHeight , offset ] ) ;
9299
93100 return classNameCreated ;
94101}
0 commit comments