Skip to content

Commit

Permalink
Rename ConfigDialog to SettingsDialog; fix settings modal open condit…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
junhaoliao committed Sep 11, 2024
1 parent 4696112 commit 023fe23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions new-log-viewer/src/components/MenuBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ const MenuBar = () => {
</SmallIconButton>
<Divider orientation={"vertical"}/>
<SmallIconButton
onClick={handleSettingsModalClose}
onClick={handleSettingsModalOpen}
>
<Settings/>
</SmallIconButton>
</Sheet>
<ConfigModal
isOpen={isSettingsModalOpen}
onClose={handleSettingsModalOpen}/>
onClose={handleSettingsModalClose}/>
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ const handleConfigFormSubmit = (ev: React.FormEvent) => {
};

/**
* Renders a configuration settings form.
* Renders a settings dialog for configurations.
*
* @return
*/
const ConfigDialog = forwardRef<HTMLFormElement>((_, ref) => {
const SettingsDialog = forwardRef<HTMLFormElement>((_, ref) => {
const {setMode, mode} = useColorScheme();

return (
Expand Down Expand Up @@ -199,6 +199,6 @@ const ConfigDialog = forwardRef<HTMLFormElement>((_, ref) => {
);
});

ConfigDialog.displayName = "ConfigDialog";
SettingsDialog.displayName = "SettingsDialog";

export default ConfigDialog;
export default SettingsDialog;
4 changes: 2 additions & 2 deletions new-log-viewer/src/components/modals/SettingsModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Modal from "@mui/joy/Modal";

import ConfigDialog from "./ConfigDialog";
import SettingsDialog from "./SettingsDialog";

import "./index.css";

Expand All @@ -19,7 +19,7 @@ const ConfigModal = ({isOpen, onClose}: { isOpen: boolean, onClose: () => void }
open={isOpen}
onClose={onClose}
>
<ConfigDialog/>
<SettingsDialog/>
</Modal>
);
};
Expand Down

0 comments on commit 023fe23

Please sign in to comment.