move settings page to modal instead of route

This commit is contained in:
jeffvli
2025-11-23 00:49:39 -08:00
parent 6d0f80f06a
commit 54a8c8c3a4
6 changed files with 85 additions and 55 deletions
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router';
import { Command, CommandPalettePages } from '/@/renderer/features/search/components/command';
import { openSettingsModal } from '/@/renderer/features/settings/utils/open-settings-modal';
import { AppRoute } from '/@/renderer/router/routes';
interface GoToCommandsProps {
@@ -34,7 +35,14 @@ export const GoToCommands = ({ handleClose, setPages, setQuery }: GoToCommandsPr
<Command.Item onSelect={() => goTo(AppRoute.SEARCH)}>
{t('page.sidebar.search', { postProcess: 'titleCase' })}
</Command.Item>
<Command.Item onSelect={() => goTo(AppRoute.SETTINGS)}>
<Command.Item
onSelect={() => {
openSettingsModal();
handleClose();
setPages([CommandPalettePages.HOME]);
setQuery('');
}}
>
{t('page.sidebar.settings', { postProcess: 'titleCase' })}
</Command.Item>
</Command.Group>