refactor: fix some lintter erros

This commit is contained in:
Sonny
2024-05-25 17:19:26 +02:00
committed by Sonny
parent 09700a1916
commit 8b161dcf49
7 changed files with 31 additions and 21 deletions

View File

@@ -6,9 +6,12 @@ import useShortcut from '~/hooks/use_shortcut';
import { appendCollectionId } from '~/lib/navigation';
export default function BackToDashboard({ children }: { children: ReactNode }) {
const collectionId = useSearchParam('collectionId');
useShortcut('ESCAPE_KEY', () =>
router.visit(appendCollectionId(route('dashboard').url, collectionId))
const collectionId = Number(useSearchParam('collectionId'));
useShortcut(
'ESCAPE_KEY',
() =>
router.visit(appendCollectionId(route('dashboard').url, collectionId)),
{ disableGlobalCheck: true }
);
return <>{children}</>;
}