Skip to content

Commit a6f553c

Browse files
Merge pull request #150 from Saifullah-dev/149-upgrade-upgrade-to-react-v19
149 upgrade upgrade to react v19
2 parents 06188d5 + 72ac795 commit a6f553c

File tree

10 files changed

+165
-139
lines changed

10 files changed

+165
-139
lines changed

frontend/package-lock.json

Lines changed: 51 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@
2020
"semantic-release": "semantic-release"
2121
},
2222
"dependencies": {
23-
"react-collapsible": "^2.10.0",
24-
"react-icons": "^5.2.1",
25-
"react-loading": "^2.0.3"
23+
"react-collapsed": "^4.2.0",
24+
"react-icons": "^5.4.0"
2625
},
2726
"devDependencies": {
2827
"@types/react": "^18.3.3",
@@ -33,18 +32,16 @@
3332
"eslint-plugin-react": "^7.34.2",
3433
"eslint-plugin-react-hooks": "^4.6.2",
3534
"eslint-plugin-react-refresh": "^0.4.7",
36-
"react": "^18.3.1",
37-
"react-dom": "^18.3.1",
35+
"react": "19.0.0",
36+
"react-dom": "19.0.0",
3837
"sass": "^1.77.6",
3938
"semantic-release": "^24.1.0",
4039
"vite": "^5.4.14"
4140
},
4241
"peerDependencies": {
43-
"react": ">=18",
44-
"react-dom": ">=18",
45-
"react-collapsible": "^2.10.0",
46-
"react-icons": "^5.2.1",
47-
"react-loading": "^2.0.3"
42+
"react": "^19.0.0",
43+
"react-dom": "^19.0.0",
44+
"react-collapsed": "^4.2.0"
4845
},
4946
"peerDependenciesMeta": {
5047
"react": {

frontend/src/FileManager/Actions/UploadFile/UploadFile.action.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useRef, useState } from "react";
22
import Button from "../../../components/Button/Button";
33
import { AiOutlineCloudUpload } from "react-icons/ai";
44
import UploadItem from "./UploadItem";
5-
import ReactLoading from "react-loading";
5+
import Loader from "../../../components/Loader/Loader";
66
import { useFileNavigation } from "../../../contexts/FileNavigationContext";
77
import { getFileExtension } from "../../../utils/getFileExtension";
88
import { getDataSize } from "../../../utils/getDataSize";
@@ -32,8 +32,8 @@ const UploadFileAction = ({
3232

3333
const checkFileError = (file) => {
3434
if (acceptedFileTypes) {
35-
const extError = !acceptedFileTypes.includes(getFileExtension(file.name));
36-
if (extError) return "File type is not allowed.";
35+
const extError = !acceptedFileTypes.includes(getFileExtension(file.name));
36+
if (extError) return "File type is not allowed.";
3737
}
3838

3939
const fileExists = currentPathFiles.some(
@@ -134,7 +134,7 @@ const UploadFileAction = ({
134134
{Object.values(isUploading).some((fileUploading) => fileUploading) ? (
135135
<>
136136
<h2>Uploading</h2>
137-
<ReactLoading type="cylon" color="black" height={18} width={20} />
137+
<Loader loading={true} className="upload-loading" />
138138
</>
139139
) : (
140140
<h2>Completed</h2>

frontend/src/FileManager/FileManager.jsx

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,40 @@ import { useTriggerAction } from "../hooks/useTriggerAction";
1313
import { useColumnResize } from "../hooks/useColumnResize";
1414
import PropTypes from "prop-types";
1515
import { dateStringValidator, urlValidator } from "../validators/propValidators";
16+
import checkPropTypes from "prop-types/checkPropTypes";
1617
import "./FileManager.scss";
1718

18-
const FileManager = ({
19-
files,
20-
fileUploadConfig,
21-
isLoading,
22-
onCreateFolder,
23-
onFileUploading = () => {},
24-
onFileUploaded = () => {},
25-
onPaste,
26-
onRename,
27-
onDownload,
28-
onDelete = () => null,
29-
onLayoutChange = () => {},
30-
onRefresh,
31-
onFileOpen = () => {},
32-
onError = () => {},
33-
layout = "grid",
34-
enableFilePreview = true,
35-
maxFileSize,
36-
filePreviewPath,
37-
acceptedFileTypes,
38-
height = "600px",
39-
width = "100%",
40-
initialPath = "",
41-
filePreviewComponent,
42-
primaryColor = "#6155b4",
43-
fontFamily = "Nunito Sans, sans-serif",
44-
}) => {
19+
const FileManager = (props) => {
20+
checkPropTypes(FileManager.propTypes, props, "prop", FileManager.name);
21+
22+
const {
23+
files,
24+
fileUploadConfig,
25+
isLoading,
26+
onCreateFolder,
27+
onFileUploading = () => {},
28+
onFileUploaded = () => {},
29+
onPaste,
30+
onRename,
31+
onDownload,
32+
onDelete = () => null,
33+
onLayoutChange = () => {},
34+
onRefresh,
35+
onFileOpen = () => {},
36+
onError = () => {},
37+
layout = "grid",
38+
enableFilePreview = true,
39+
maxFileSize,
40+
filePreviewPath,
41+
acceptedFileTypes,
42+
height = "600px",
43+
width = "100%",
44+
initialPath = "",
45+
filePreviewComponent,
46+
primaryColor = "#6155b4",
47+
fontFamily = "Nunito Sans, sans-serif",
48+
} = props;
49+
4550
const triggerAction = useTriggerAction();
4651
const { containerRef, colSizes, isDragging, handleMouseMove, handleMouseUp, handleMouseDown } =
4752
useColumnResize(20, 80);
@@ -54,7 +59,7 @@ const FileManager = ({
5459

5560
return (
5661
<main className="file-explorer" onContextMenu={(e) => e.preventDefault()} style={customStyles}>
57-
<Loader isLoading={isLoading} />
62+
<Loader loading={isLoading} />
5863
<FilesProvider filesData={files} onError={onError}>
5964
<FileNavigationProvider initialPath={initialPath}>
6065
<SelectionProvider onDownload={onDownload}>

frontend/src/FileManager/FileManager.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ svg {
3939
font-family: var(--file-manager-font-family);
4040
}
4141

42-
border: 1px solid #dddddd;
4342
border-radius: 8px;
4443
position: relative;
4544
background-color: white;

0 commit comments

Comments
 (0)