Skip to content

Commit 4c8aa46

Browse files
committed
[FEAT]: Add resultOnTooltip prop to show status on a tooltip instead of the clasic fullInfoLayer
1 parent 07d5529 commit 4c8aa46

8 files changed

Lines changed: 62 additions & 36 deletions

File tree

src/components/file-item/components/FileItem/FileItem.scss

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -300,45 +300,49 @@
300300
////////////////// TOOLTIP
301301
.dz-ui-file-item-container{
302302
&.dz-ui-tooltip{
303+
cursor: default;
303304
position: relative;
304305
display: inline-block;
305-
border-bottom: 1px dotted black;
306+
// border-bottom: 1px dotted black;
306307
&:hover {
307-
z-index: 10000;
308+
z-index: 2;
308309
.dropzone-ui-tooltiptext {
309310
visibility: visible;
310311
opacity: 1;
311-
z-index: 10000;
312+
z-index: 2;
312313
}
313314
}
314315
.dropzone-ui-tooltiptext {
316+
font-size: 0.8rem;
315317
visibility: hidden;
316-
width: 120px;
318+
width: 133px;
317319
// background-color: green;
318320
color: #fff;
319321
text-align: center;
320322
border-radius: 6px;
321-
padding: 5px 5px;
323+
padding: 2px 2px;
322324
position: absolute;
323-
z-index: 1;
324-
bottom: 0%;
325-
left: 50%;
325+
//z-index: 2;
326+
//top: 190px;
327+
top: 178px;
328+
left: 66px;
326329
margin-left: -60px;
327330

328331
/* Fade in tooltip - takes 1 second to go from 0% to 100% opac: */
329332
opacity: 0;
330333
transition: opacity 1s;
331334

332335
&.not-valid-error {
333-
background-color: red;
336+
background: linear-gradient(to top,#c62828,#d32f2f,);
334337
&::after {
335-
border-color: transparent transparent red transparent;
338+
border-color: transparent transparent #d32f2f transparent;
336339
}
337340
}
338341
&.success {
339-
background-color: green;
342+
//background-color: green;
343+
background: linear-gradient(to top, #1b5e20, #2e7d32);
340344
&::after {
341-
border-color: transparent transparent green transparent;
345+
border-color: transparent transparent #2e7d32 transparent;
342346
}
343347
}
344348
&::after {

src/components/file-item/components/FileItem/FileItem.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,19 +184,21 @@ const FileItem: FC<FileItemProps> = (props: FileItemProps) => {
184184
resultOnTooltip={resultOnTooltip}
185185
/>
186186
</Paper>
187-
187+
188188
{!onlyImage && (
189189
<div className="file-item-name">{shrinkWord(file.name)}</div>
190190
)}
191-
</div>
192-
<Tooltip
193-
open={resultOnTooltip && hovering}
194-
//open={true}
191+
</div>
192+
{resultOnTooltip && (
193+
<Tooltip
194+
//open={resultOnTooltip && hovering}
195+
open={true}
195196
uploadStatus={uploadStatus}
196197
valid={valid}
197198
errors={errors}
198199
uploadMessage={uploadMessage}
199200
></Tooltip>
201+
)}
200202
</div>
201203
);
202204
} else return <Fragment></Fragment>;

src/components/file-item/components/FileItemContainer/FileItemContainer.scss

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.file-item-list-container {
2+
padding: 5px;
3+
//z-index: 1;
24
&::-webkit-scrollbar {
35
width: 9px;
46
}
@@ -18,17 +20,26 @@
1820
width: 100%;
1921
//margin: 100px 0;
2022
//width: inherit;
21-
overflow: auto;
23+
2224
// padding: 2%;
2325
align-items: center;
2426
scrollbar-width: thin;
2527
&.file-item-list-grid {
28+
overflow: auto;
2629
display: flex;
2730
flex-wrap: wrap;
2831
align-items: center;
2932
justify-content: space-evenly;
3033
}
34+
&.file-item-list-no-scroll{
35+
display: flex;
36+
flex-wrap: wrap;
37+
align-items: center;
38+
justify-content: space-evenly;
39+
overflow: unset;
40+
}
3141
&.file-item-list-list {
42+
overflow: auto;
3243
//flex-wrap: wrap;
3344
align-items: center;
3445
//justify-content: center;

src/components/file-item/components/FileItemContainer/FileItemContainer.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ import { FileItemContainerProps } from "./FileItemContainerProps";
66
const FileItemContainer: FC<FileItemContainerProps> = (
77
props: FileItemContainerProps,
88
) => {
9-
const { children, view, style } = props;
10-
const finalView = view || "list";
11-
9+
const { children, view, style, disableScroll } = props;
10+
const finalView = disableScroll ? "no-scroll" : view || "list";
11+
/* function handleClick<T extends HTMLDivElement>(
12+
e: React.MouseEvent<T, MouseEvent>
13+
): void {
14+
e.preventDefault();
15+
} */
1216
return (
1317
<div
1418
className={`file-item-list-container file-item-list-${finalView}`}
1519
style={style}
20+
//onClick={handleClick}
1621
>
1722
{children}
1823
</div>
Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import { OverridableProps } from "@unlimited-react-components/kernel";
22

33
export interface FileItemContainerProps extends OverridableProps {
4-
/**
5-
* `grid` will display files in a grid layout. `list` will display
6-
* files in a horizontal list.
7-
* Convenient for saving space in page.
8-
*/
9-
view?: "grid" | "list";
4+
/**
5+
* `grid` will display files in a grid layout. `list` will display
6+
* files in a horizontal list.
7+
* Convenient for saving space in page.
8+
*/
9+
view?: "grid" | "list";
10+
/**
11+
* if present or true, removes scrolls
12+
* and sets the Dropzone in a grid view
13+
*/
14+
disableScroll?: boolean;
1015
}

src/components/image-preview/FullScreenPreview.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
&.show {
1414
transform: translate(0);
1515
}
16-
z-index: 2;
16+
z-index: 4;
1717
}
1818
.img-rel-container {
1919
position: relative;

src/components/tooltip/components/Tooltip.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
display: inline-block;
44
border-bottom: 1px dotted black;
55
&:hover {
6-
.dropzone-ui-tooltiptext {
6+
.dropzosne-ui-toolatiptext {
77
visibility: visible;
88
opacity: 1;
99
}
1010
}
11-
.dropzone-ui-tooltiptext {
11+
.dropzaone-ui-tooltiptsext {
1212
visibility: hidden;
1313
width: 120px;
1414
// background-color: green;
@@ -26,13 +26,13 @@
2626
opacity: 0;
2727
transition: opacity 1s;
2828

29-
&.not-valid-error {
29+
&.not-valisd-error {
3030
background-color: red;
3131
&::after {
3232
border-color: transparent transparent red transparent;
3333
}
3434
}
35-
&.success {
35+
&.successs {
3636
background-color: green;
3737
&::after {
3838
border-color: transparent transparent green transparent;

src/components/tooltip/components/Tooltip.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { UPLOADSTATUS } from "../../../components/dropzone/components/utils/vali
55
const Tooltip: FC<TooltipProps> = (props: TooltipProps) => {
66
const {
77
//message,
8-
style,
9-
children,
8+
//style,
9+
//children,
1010
//color,
1111
uploadStatus,
1212
valid,
@@ -15,7 +15,6 @@ const Tooltip: FC<TooltipProps> = (props: TooltipProps) => {
1515
uploadMessage,
1616
open,
1717
} = props;
18-
console.log("Tooltip props", props);
1918
const [statusClassName, setSatusClassName] = useState<string | undefined>(
2019
undefined
2120
);
@@ -71,7 +70,7 @@ const Tooltip: FC<TooltipProps> = (props: TooltipProps) => {
7170
? errors?.map((error, index) => (
7271
<div key={index + 1}>{`- ${error}.\n`}</div>
7372
))
74-
: */ message || ""
73+
: */ message
7574
}
7675
</span>
7776
)}

0 commit comments

Comments
 (0)