Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 66fb941

Browse files
committed
add TS types
1 parent 84df00b commit 66fb941

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/components/pages/filesytem/FileList.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
import { connect, ConnectedProps } from "react-redux";
2020
import { FFLoading } from "../../basicElements/Loading";
2121
import { AxiosResponse } from "axios";
22+
import { ClearSelected } from "../../../background/redux/actions/filesystemTypes";
2223

2324
const mapState = (state: SystemState) => ({
2425
filesystem: {
@@ -66,7 +67,7 @@ function FileList(props: Props): ReactElement {
6667
const setCurrentPath = props.setCurrentPath;
6768
const setCurrentFsItemId = props.setCurrentFsItemId;
6869

69-
useEffect(() => {
70+
useEffect(():void => {
7071
function updateStates(): void {
7172
getFolderContents(path)
7273
.then((response: AxiosResponse<FsEntity[]>) => {
@@ -101,7 +102,7 @@ function FileList(props: Props): ReactElement {
101102
location
102103
]);
103104

104-
const handleSelectAllChanged = () => {
105+
const handleSelectAllChanged = ():void|ClearSelected => {
105106
if (allAreSelected) {
106107
return props.clearSelected();
107108
}
@@ -110,15 +111,15 @@ function FileList(props: Props): ReactElement {
110111
}
111112
};
112113

113-
function setSortingOrder(property: keyof FsEntity) {
114+
function setSortingOrder(property: keyof FsEntity):void {
114115
if (sortedBy === property) {
115116
return setSortIncreasing(!sortIncreasing);
116117
}
117118
setSortedBy(property);
118119
setSortIncreasing(true);
119120
}
120121

121-
function getSortingFunction(property: keyof FsEntity) {
122+
function getSortingFunction(property: keyof FsEntity):(a:any,b:any)=>number {
122123
switch (property) {
123124
case "lastUpdatedBy":
124125
case "size":
@@ -145,7 +146,7 @@ function FileList(props: Props): ReactElement {
145146
}
146147
}
147148

148-
function handleSortClick(property: keyof FsEntity) {
149+
function handleSortClick(property: keyof FsEntity):void {
149150
if (!filesAndFolders || filesAndFolders.length < 2) {
150151
return;
151152
}

src/components/pages/filesytem/Filesystem.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export const filesBaseUrl = "/file";
1111
type Props = {};
1212

1313
function FileSystem(props: Props): ReactElement {
14-
1514
return (
1615
<div className="d-flex flex-column align-content-between justify-content-between h-100">
1716
<Container
@@ -24,10 +23,10 @@ function FileSystem(props: Props): ReactElement {
2423
</Container>
2524
<div className="flex-grow-1 overflow-auto d-flex h-100 flex-column" id="fileView">
2625
<div id="fileList" className="flex-grow-1 overflow-auto">
27-
<FileList />
26+
<FileList />
2827
</div>
2928
<div id="uploadInformation" className="flex-shrink-0">
30-
<ApiActionsInfo />
29+
<ApiActionsInfo />
3130
</div>
3231
</div>
3332
<div className="flex-shrink-0" id="uploadZone">

0 commit comments

Comments
 (0)