From 5cce21b32d2bf4e53969677b0d33c943f44fb774 Mon Sep 17 00:00:00 2001 From: IZUMI-Zu <274620705z@gmail.com> Date: Tue, 31 Dec 2024 12:22:19 +0800 Subject: [PATCH] fix: error in display notify --- EnterAccountDetails.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/EnterAccountDetails.js b/EnterAccountDetails.js index f7d32d1..d0747a9 100644 --- a/EnterAccountDetails.js +++ b/EnterAccountDetails.js @@ -20,12 +20,6 @@ import PropTypes from "prop-types"; import {useTranslation} from "react-i18next"; const EnterAccountDetails = ({onClose, onAdd, validateSecret}) => { - EnterAccountDetails.propTypes = { - onClose: PropTypes.func.isRequired, - onAdd: PropTypes.func.isRequired, - validateSecret: PropTypes.func.isRequired, - }; - const {notify} = useNotifications(); const {t} = useTranslation(); const [accountName, setAccountName] = useState(""); @@ -55,16 +49,20 @@ const EnterAccountDetails = ({onClose, onAdd, validateSecret}) => { if (accountName.trim() === "" || secretKey.trim() === "") { notify("error", { - title: t("common.error"), - description: t("editAccount.Please fill in all the fields!"), + params: { + title: t("common.error"), + description: t("editAccount.Please fill in all the fields!"), + }, }); return; } if (secretError) { notify("error", { - title: t("common.error"), - description: t("editAccount.Invalid Secret Key"), + params: { + title: t("common.error"), + description: t("editAccount.Invalid Secret Key"), + }, }); return; } @@ -166,6 +164,12 @@ const EnterAccountDetails = ({onClose, onAdd, validateSecret}) => { ); }; +EnterAccountDetails.propTypes = { + onClose: PropTypes.func.isRequired, + onAdd: PropTypes.func.isRequired, + validateSecret: PropTypes.func.isRequired, +}; + const styles = { container: { flex: 1,