aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/pages/setting/ChangeAvatarDialog.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-07-29 22:00:59 +0800
committercrupest <crupest@outlook.com>2023-07-29 22:00:59 +0800
commit22e8f24e7f7574915e4c75d3c6a5498f6e621ee8 (patch)
treea164dbcb6bf2e87e275cc736b65a22f34f788b14 /FrontEnd/src/pages/setting/ChangeAvatarDialog.tsx
parent13f6f2a451feede8037d18cfbac64843e108ccbd (diff)
downloadtimeline-22e8f24e7f7574915e4c75d3c6a5498f6e621ee8.tar.gz
timeline-22e8f24e7f7574915e4c75d3c6a5498f6e621ee8.tar.bz2
timeline-22e8f24e7f7574915e4c75d3c6a5498f6e621ee8.zip
...
Diffstat (limited to 'FrontEnd/src/pages/setting/ChangeAvatarDialog.tsx')
-rw-r--r--FrontEnd/src/pages/setting/ChangeAvatarDialog.tsx15
1 files changed, 9 insertions, 6 deletions
diff --git a/FrontEnd/src/pages/setting/ChangeAvatarDialog.tsx b/FrontEnd/src/pages/setting/ChangeAvatarDialog.tsx
index b2a4e2a8..8c8e04fe 100644
--- a/FrontEnd/src/pages/setting/ChangeAvatarDialog.tsx
+++ b/FrontEnd/src/pages/setting/ChangeAvatarDialog.tsx
@@ -9,13 +9,16 @@ import { useUser } from "@/services/user";
import { getHttpUserClient } from "@/http/user";
-import ImageCropper, { Clip, applyClipToImage } from "@/views/common/ImageCropper";
+import ImageCropper, {
+ Clip,
+ applyClipToImage,
+} from "@/views/common/ImageCropper";
import Button from "@/views/common/button/Button";
import Dialog from "@/views/common/dialog/Dialog";
export interface ChangeAvatarDialogProps {
open: boolean;
- close: () => void;
+ onClose: () => void;
}
const ChangeAvatarDialog: React.FC<ChangeAvatarDialogProps> = (props) => {
@@ -42,12 +45,12 @@ const ChangeAvatarDialog: React.FC<ChangeAvatarDialogProps> = (props) => {
>("select");
const [message, setMessage] = useState<I18nText>(
- "settings.dialogChangeAvatar.prompt.select"
+ "settings.dialogChangeAvatar.prompt.select",
);
const trueMessage = convertI18nText(message, t);
- const closeDialog = props.close;
+ const closeDialog = props.onClose;
const close = React.useCallback((): void => {
if (!(state === "uploading")) {
@@ -92,7 +95,7 @@ const ChangeAvatarDialog: React.FC<ChangeAvatarDialogProps> = (props) => {
setFile(files[0]);
}
},
- []
+ [],
);
const onCropNext = React.useCallback(() => {
@@ -140,7 +143,7 @@ const ChangeAvatarDialog: React.FC<ChangeAvatarDialogProps> = (props) => {
(e: unknown) => {
setState("error");
setMessage({ type: "custom", value: (e as AxiosError).message });
- }
+ },
);
}, [user, resultBlob]);