mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-30 06:02:00 +02:00
Global layout component
This commit is contained in:
@@ -12,9 +12,10 @@ import { keyValueQueryKey } from '../hooks/useKeyValue';
|
||||
import { requestsQueryKey } from '../hooks/useRequests';
|
||||
import { responsesQueryKey } from '../hooks/useResponses';
|
||||
import { routePaths } from '../hooks/useRoutes';
|
||||
import { SidebarDisplayKeys } from '../hooks/useSidebarDisplay';
|
||||
import { workspacesQueryKey } from '../hooks/useWorkspaces';
|
||||
import { DEFAULT_FONT_SIZE } from '../lib/constants';
|
||||
import { extractKeyValue } from '../lib/keyValueStore';
|
||||
import { extractKeyValue, getKeyValue, setKeyValue } from '../lib/keyValueStore';
|
||||
import type { HttpRequest, HttpResponse, KeyValue, Workspace } from '../lib/models';
|
||||
import { AppRouter } from './AppRouter';
|
||||
|
||||
@@ -137,6 +138,11 @@ await listen('refresh', () => {
|
||||
location.reload();
|
||||
});
|
||||
|
||||
await listen('toggle_sidebar', async () => {
|
||||
const hidden = await getKeyValue<boolean>({ key: SidebarDisplayKeys.hidden, fallback: false });
|
||||
await setKeyValue({ key: SidebarDisplayKeys.hidden, value: !hidden });
|
||||
});
|
||||
|
||||
await listen('zoom', ({ payload: zoomDelta }: { payload: number }) => {
|
||||
const fontSize = parseFloat(window.getComputedStyle(document.documentElement).fontSize);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user