Skip to content

Commit cdb6430

Browse files
committed
[REF]: Improve code format
1 parent ac0b5e8 commit cdb6430

7 files changed

Lines changed: 70 additions & 77 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The `best` and most complete, `easy to use`, file upload library for [React](htt
99
:heart: it ?, :star: it on :octocat: [Github](https://github.com/dropzone-ui/dropzone-ui) :D or :bird: [Tweet](https://twitter.com/intent/tweet?text=With%20@dropzone_ui,%20my%20@reactjs%20%20web%20app%20becomes%20more%20powerful.%20Thanks,%20@JinJoseManuel%20%F0%9F%A4%A9) about it.
1010

1111
<p align="center">
12-
<h1 align="center"><img src="https://user-images.githubusercontent.com/43678736/132112022-0ca409ae-cca2-43c8-be89-110376260a3f.png" alt="dropone-ui-logo" width="172" height="172" align="center"> Dropzone UI</h1>
12+
<img src="https://user-images.githubusercontent.com/43678736/147796764-b6a271a0-f29c-47be-a521-22c2f734e874.png" alt="dropone-ui-logo" width="256" height="auto" align="center">
1313
</p>
1414

1515
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/dropzone-ui/react/blob/HEAD/LICENSE)

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "@dropzone-ui/react",
3-
"version": "6.4.2",
3+
"version": "6.5.2",
44
"description": "The best and most complete React library for managing file uploads. Multilanguage support. Server side support. Material design styles. Code generator on webpage.",
55
"main": "./build/index.js",
66
"module": "./build/index.es.js",
77
"types": "./build/index.d.ts",
88
"repository": {
99
"type": "git",
10-
"url": "git+https://github.com/dropzone-ui/react.git"
10+
"url": "git+https://github.com/dropzone-ui/dropzone-ui-react.git"
1111
},
1212
"keywords": [
1313
"dropzone",
@@ -32,9 +32,9 @@
3232
"author": "JinSSJ3",
3333
"license": "MIT",
3434
"bugs": {
35-
"url": "https://github.com/dropzone-ui/react/issues"
35+
"url": "https://github.com/dropzone-ui/dropzone-ui-react/issues"
3636
},
37-
"homepage": "http://dropzone-ui.com",
37+
"homepage": "http://www.dropzone-ui.com",
3838
"dependencies": {
3939
"@dynamicss/dynamicss": "^2.2.0",
4040
"@unlimited-react-components/kernel": "^1.0.2",
@@ -45,9 +45,7 @@
4545
"react": "^17.0.2",
4646
"react-dom": "^17.0.2"
4747
},
48-
"devDependencies": { "axios": "^0.24.0",
49-
"react": "^17.0.2",
50-
"react-dom": "^17.0.2",
48+
"devDependencies": {
5149
"@rollup/plugin-commonjs": "^21.0.1",
5250
"@rollup/plugin-node-resolve": "^13.1.1",
5351
"@storybook/addon-actions": "^6.4.9",

src/components/dropzone/components/utils/dropzone-ui.utils.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ export function createRipple<
3232

3333

3434
export function createRippleFromElement<
35-
T extends HTMLButtonElement | HTMLAnchorElement | HTMLDivElement
36-
>(element: HTMLDivElement | null, event: React.MouseEvent<T, MouseEvent>,color: string) {
35+
T extends HTMLButtonElement | HTMLAnchorElement | HTMLDivElement
36+
>(element: HTMLDivElement | null, event: React.MouseEvent<T, MouseEvent>, color: string) {
3737
if (!element) {
3838
return;
3939
}
4040
const buttonAnchorDiv = element;
41-
buttonAnchorDiv.style.height="100%";
42-
buttonAnchorDiv.style.width="100%";
41+
buttonAnchorDiv.style.height = "100%";
42+
buttonAnchorDiv.style.width = "100%";
4343
const circle: HTMLSpanElement = document.createElement("span");
4444
const diameter = Math.max(
4545
buttonAnchorDiv.clientWidth,
@@ -63,8 +63,8 @@ T extends HTMLButtonElement | HTMLAnchorElement | HTMLDivElement
6363
ripple.remove();
6464
}
6565
buttonAnchorDiv.appendChild(circle);
66-
setTimeout(()=>{
67-
buttonAnchorDiv.style.height="0%";
68-
buttonAnchorDiv.style.width="0%";
69-
},500);
66+
setTimeout(() => {
67+
buttonAnchorDiv.style.height = "0%";
68+
buttonAnchorDiv.style.width = "0%";
69+
}, 500);
7070
}

src/components/dropzone/components/utils/merger.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/components/file-item/utils/utils.files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const createListOfPDF = (amount?: number): File[] => {
3535
return listFile;
3636
}
3737
/**
38-
* Gives a XX.XX format in Bytes KB, MB or GB
38+
* Gives a XX.XX format in Bytes KB, MB, GB or TB
3939
* @param fileSize file size to give format in Bytes
4040
*/
4141
export const fileSizeFormater = (fileSize?: number): string => {
Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
21
import { Cancel } from "../icons";
32
import "./FullScreenPreview.scss";
4-
import React, {FC} from "react";
3+
import React, { FC } from "react";
54
import { FullScreenPreviewProps } from "./FullScreenPreviewProps";
65

7-
const FullScreenPreview:FC<FullScreenPreviewProps> = (props:FullScreenPreviewProps) =>{
6+
const FullScreenPreview: FC<FullScreenPreviewProps> = (
7+
props: FullScreenPreviewProps,
8+
) => {
89
const { imgSource, openImage, onClose } = props;
9-
10+
1011
function handleClose<T extends HTMLDivElement>(
11-
e: React.MouseEvent<T, MouseEvent>
12+
e: React.MouseEvent<T, MouseEvent>,
1213
): void {
1314
//avoid children to trigger onClick ripple from parent
1415
e.stopPropagation();
@@ -20,28 +21,23 @@ const FullScreenPreview:FC<FullScreenPreviewProps> = (props:FullScreenPreviewPro
2021
onClick={handleClose}
2122
>
2223
{imgSource && openImage && (
23-
24-
<div className="img-rel-container">
25-
<img
26-
width="100%"
27-
height="100%"
28-
src={imgSource}
29-
alt="full-screen-preview"
30-
className={
31-
"image-full-screen show-image"
32-
}
33-
/>
34-
<Cancel
35-
color="rgba(255,255,255,0.8)"
36-
onClick={handleClose}
37-
colorFill="black"
38-
className="button-full-screen"
39-
/>
40-
41-
</div>
42-
24+
<div className="img-rel-container">
25+
<img
26+
width="100%"
27+
height="100%"
28+
src={imgSource}
29+
alt="full-screen-preview"
30+
className={"image-full-screen show-image"}
31+
/>
32+
<Cancel
33+
color="rgba(255,255,255,0.8)"
34+
onClick={handleClose}
35+
colorFill="black"
36+
className="button-full-screen"
37+
/>
38+
</div>
4339
)}
4440
</div>
4541
);
46-
}
42+
};
4743
export default FullScreenPreview;

src/components/video-preview/VideoPreview.tsx

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -49,41 +49,43 @@ const VideoPreview: FC<VideoPreviewProps> = (props: VideoPreviewProps) => {
4949
className={openVideo ? "video-container show" : "video-container"}
5050
onClick={handleClose}
5151
>
52-
{//videoSrc &&
53-
openVideo && (
54-
<div
55-
className="vid-rel-container"
56-
onClick={(evt) => {
57-
evt.preventDefault();
58-
}}
59-
>
60-
<video
52+
{
53+
//videoSrc &&
54+
openVideo && (
55+
<div
56+
className="vid-rel-container"
6157
onClick={(evt) => {
6258
evt.preventDefault();
6359
}}
64-
//onLoadedMetadata={handleLoaded}
65-
id="dropzone-ui-video"
66-
controls={controls}
67-
ref={videoRef}
68-
className={"video-full-screen show-video"}
69-
autoPlay={autoplay}
70-
src={source}
71-
width={"100%"}
72-
height={"100%"}
73-
style={style}
7460
>
75-
<source type="video/webm" />
76-
<source type="video/ogg" />
77-
<source type="video/mp4" />
78-
</video>
79-
<Cancel
80-
color="rgba(255,255,255,0.8)"
81-
onClick={handleClose}
82-
colorFill="black"
83-
className="button-full-screen"
84-
/>
85-
</div>
86-
)}
61+
<video
62+
onClick={(evt) => {
63+
evt.preventDefault();
64+
}}
65+
//onLoadedMetadata={handleLoaded}
66+
id="dropzone-ui-video"
67+
controls={controls}
68+
ref={videoRef}
69+
className={"video-full-screen show-video"}
70+
autoPlay={autoplay}
71+
src={source}
72+
width={"100%"}
73+
height={"100%"}
74+
style={style}
75+
>
76+
<source type="video/webm" />
77+
<source type="video/ogg" />
78+
<source type="video/mp4" />
79+
</video>
80+
<Cancel
81+
color="rgba(255,255,255,0.8)"
82+
onClick={handleClose}
83+
colorFill="black"
84+
className="button-full-screen"
85+
/>
86+
</div>
87+
)
88+
}
8789
</div>
8890
);
8991
} else {

0 commit comments

Comments
 (0)