From 023fe2365e5618bd704a743d5db51ffb8e2d7d81 Mon Sep 17 00:00:00 2001 From: Junhao Liao Date: Wed, 11 Sep 2024 19:35:50 -0400 Subject: [PATCH] Rename ConfigDialog to SettingsDialog; fix settings modal open condition. --- new-log-viewer/src/components/MenuBar/index.tsx | 4 ++-- .../{ConfigDialog.tsx => SettingsDialog.tsx} | 8 ++++---- .../src/components/modals/SettingsModal/index.tsx | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) rename new-log-viewer/src/components/modals/SettingsModal/{ConfigDialog.tsx => SettingsDialog.tsx} (97%) diff --git a/new-log-viewer/src/components/MenuBar/index.tsx b/new-log-viewer/src/components/MenuBar/index.tsx index bacc25b6..60de61e4 100644 --- a/new-log-viewer/src/components/MenuBar/index.tsx +++ b/new-log-viewer/src/components/MenuBar/index.tsx @@ -75,14 +75,14 @@ const MenuBar = () => { + onClose={handleSettingsModalClose}/> ); }; diff --git a/new-log-viewer/src/components/modals/SettingsModal/ConfigDialog.tsx b/new-log-viewer/src/components/modals/SettingsModal/SettingsDialog.tsx similarity index 97% rename from new-log-viewer/src/components/modals/SettingsModal/ConfigDialog.tsx rename to new-log-viewer/src/components/modals/SettingsModal/SettingsDialog.tsx index 991187da..798888c1 100644 --- a/new-log-viewer/src/components/modals/SettingsModal/ConfigDialog.tsx +++ b/new-log-viewer/src/components/modals/SettingsModal/SettingsDialog.tsx @@ -109,11 +109,11 @@ const handleConfigFormSubmit = (ev: React.FormEvent) => { }; /** - * Renders a configuration settings form. + * Renders a settings dialog for configurations. * * @return */ -const ConfigDialog = forwardRef((_, ref) => { +const SettingsDialog = forwardRef((_, ref) => { const {setMode, mode} = useColorScheme(); return ( @@ -199,6 +199,6 @@ const ConfigDialog = forwardRef((_, ref) => { ); }); -ConfigDialog.displayName = "ConfigDialog"; +SettingsDialog.displayName = "SettingsDialog"; -export default ConfigDialog; +export default SettingsDialog; diff --git a/new-log-viewer/src/components/modals/SettingsModal/index.tsx b/new-log-viewer/src/components/modals/SettingsModal/index.tsx index ab97c820..235bfa15 100644 --- a/new-log-viewer/src/components/modals/SettingsModal/index.tsx +++ b/new-log-viewer/src/components/modals/SettingsModal/index.tsx @@ -1,6 +1,6 @@ import Modal from "@mui/joy/Modal"; -import ConfigDialog from "./ConfigDialog"; +import SettingsDialog from "./SettingsDialog"; import "./index.css"; @@ -19,7 +19,7 @@ const ConfigModal = ({isOpen, onClose}: { isOpen: boolean, onClose: () => void } open={isOpen} onClose={onClose} > - + ); };