-
-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add progress indicator for uploading files
- Loading branch information
1 parent
5a9eb58
commit 8c84d50
Showing
7 changed files
with
77 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
frontend/src/components/upload/UploadProgressIndicator.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { RingProgress } from "@mantine/core"; | ||
import { CircleCheck, CircleX } from "tabler-icons-react"; | ||
|
||
const UploadProgressIndicator = ({ progress }: { progress: number }) => { | ||
if (progress > 0 && progress < 100) { | ||
return ( | ||
<RingProgress | ||
sections={[{ value: progress, color: "victoria" }]} | ||
thickness={3} | ||
size={25} | ||
/> | ||
); | ||
} else if (progress == 100) { | ||
return <CircleCheck color="green" size={22} />; | ||
} else { | ||
return <CircleX color="red" size={22} />; | ||
} | ||
}; | ||
|
||
export default UploadProgressIndicator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export type FileUpload = File & { uploadingState?: UploadState }; | ||
export type UploadState = "finished" | "inProgress" | undefined; | ||
export type FileUpload = File & { uploadingProgress: number }; |