From 70be5235ba90a15b7798a7922382835fd680b1fc Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 3 Sep 2020 18:10:02 +0800 Subject: Migrate to react-bootstrap. --- .../src/app/views/user/ChangeAvatarDialog.tsx | 93 ++++++++++------------ 1 file changed, 44 insertions(+), 49 deletions(-) (limited to 'Timeline/ClientApp/src/app/views/user/ChangeAvatarDialog.tsx') diff --git a/Timeline/ClientApp/src/app/views/user/ChangeAvatarDialog.tsx b/Timeline/ClientApp/src/app/views/user/ChangeAvatarDialog.tsx index 1dd2ee8b..ffa2218b 100644 --- a/Timeline/ClientApp/src/app/views/user/ChangeAvatarDialog.tsx +++ b/Timeline/ClientApp/src/app/views/user/ChangeAvatarDialog.tsx @@ -1,14 +1,7 @@ import React, { useState, useEffect } from "react"; import { useTranslation } from "react-i18next"; -import { - Modal, - ModalHeader, - Row, - Button, - ModalBody, - ModalFooter, -} from "reactstrap"; import { AxiosError } from "axios"; +import { Modal, Row, Button } from "react-bootstrap"; import { UiLogicError } from "@/common"; @@ -56,7 +49,7 @@ const ChangeAvatarDialog: React.FC = (props) => { const closeDialog = props.close; - const toggle = React.useCallback((): void => { + const close = React.useCallback((): void => { if (!(state === "uploading")) { closeDialog(); } @@ -163,23 +156,25 @@ const ChangeAvatarDialog: React.FC = (props) => { }; return ( - - {t("userPage.dialogChangeAvatar.title")} + + + {t("userPage.dialogChangeAvatar.title")} + {(() => { if (state === "select") { return ( <> - + {t("userPage.dialogChangeAvatar.prompt.select")} - - - - + ); } else if (state === "crop") { @@ -188,7 +183,7 @@ const ChangeAvatarDialog: React.FC = (props) => { } return ( <> - + = (props) => { /> {t("userPage.dialogChangeAvatar.prompt.crop")} - - - - - + ); } else if (state === "processcrop") { return ( <> - + {t("userPage.dialogChangeAvatar.prompt.processingCrop")} - - - - - + ); } else if (state === "preview") { return ( <> - + {createPreviewRow()} {t("userPage.dialogChangeAvatar.prompt.preview")} - - - - - - + ); } else if (state === "uploading") { return ( <> - + {createPreviewRow()} {t("userPage.dialogChangeAvatar.prompt.uploading")} - - + + ); } else if (state === "success") { return ( <> - + {t("operationDialog.success")} - - - - + ); } else { return ( <> - + {createPreviewRow()} {trueMessage} - - - - - + ); } -- cgit v1.2.3