Skip to content

Commit 690f28b

Browse files
authored
feat: add loading spinner during file upload process (#4491)
* show LoaderIcon while uploading file * fix spacing for eslint
1 parent 7a438be commit 690f28b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web/src/components/MemoEditor/ActionButton/UploadResourceButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Button } from "@usememos/mui";
2-
import { PaperclipIcon } from "lucide-react";
2+
import { LoaderIcon, PaperclipIcon } from "lucide-react";
33
import { useContext, useRef, useState } from "react";
44
import toast from "react-hot-toast";
55
import { useResourceStore } from "@/store/v1";
@@ -67,7 +67,7 @@ const UploadResourceButton = () => {
6767

6868
return (
6969
<Button className="relative" size="sm" variant="plain" disabled={state.uploadingFlag}>
70-
<PaperclipIcon className="w-5 h-5 mx-auto" />
70+
{state.uploadingFlag ? <LoaderIcon className="w-5 h-5 mx-auto animate-spin" /> : <PaperclipIcon className="w-5 h-5 mx-auto" />}
7171
<input
7272
className="absolute inset-0 w-full h-full opacity-0 cursor-pointer"
7373
ref={fileInputRef}

0 commit comments

Comments
 (0)