Skip to content

Commit

Permalink
Added keyboard shortcut for toolbar collapse
Browse files Browse the repository at this point in the history
  • Loading branch information
praveen5959 committed Dec 5, 2024
1 parent bbef68a commit 5339cc2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pages/Stream/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box, Stack } from '@mantine/core';
import { useDocumentTitle } from '@mantine/hooks';
import { useDocumentTitle, useHotkeys } from '@mantine/hooks';
import { FC, useCallback, useEffect } from 'react';
import LiveLogTable from './Views/LiveTail/LiveLogTable';
import ViewLog from './components/ViewLog';
Expand All @@ -20,7 +20,7 @@ import { useGetStreamSchema } from '@/hooks/useGetLogStreamSchema';
import { useGetStreamInfo } from '@/hooks/useGetStreamInfo';
import useParamsController from './hooks/useParamsController';

const { streamChangeCleanup } = streamStoreReducers;
const { streamChangeCleanup, toggleSideBar } = streamStoreReducers;

const ErrorView = (props: { error: string | null; onRetry: () => void }) => {
return (
Expand All @@ -45,12 +45,14 @@ const Stream: FC = () => {
const [maximized] = useAppStore((store) => store.maximized);
const [instanceConfig] = useAppStore((store) => store.instanceConfig);
const queryEngine = instanceConfig?.queryEngine;
const [sideBarOpen, setStreamStore] = useStreamStore((store) => store.sideBarOpen);
const [, setStreamStore] = useStreamStore((store) => store.sideBarOpen);
const { getStreamInfoRefetch, getStreamInfoLoading, getStreamInfoRefetching } = useGetStreamInfo(
currentStream || '',
currentStream !== null,
);

useHotkeys([['mod+/', () => setStreamStore((store) => toggleSideBar(store))]]);

const {
refetch: refetchSchema,
isLoading: isSchemaLoading,
Expand Down

0 comments on commit 5339cc2

Please sign in to comment.