diff --git a/.dockerignore b/.dockerignore index 7d101e1..562b1ec 100644 --- a/.dockerignore +++ b/.dockerignore @@ -18,3 +18,6 @@ docker-compose* *.md .git .gitignore + +# App specific +database/seeders diff --git a/inertia/components/common/modal/modal.tsx b/inertia/components/common/modal/modal.tsx index cfb372d..2c3b0d7 100644 --- a/inertia/components/common/modal/modal.tsx +++ b/inertia/components/common/modal/modal.tsx @@ -18,6 +18,7 @@ interface ModalProps { children: ReactNode; opened: boolean; hideCloseBtn?: boolean; + className?: string; close: () => void; } @@ -27,13 +28,14 @@ export default function Modal({ children, opened = true, hideCloseBtn = false, + className, close, }: ModalProps) { const modalRef = useRef(null); const { setGlobalHotkeysEnabled } = useGlobalHotkeys(); useClickOutside(modalRef, close); - useShortcut('ESCAPE_KEY', close); + useShortcut('ESCAPE_KEY', close, { disableGlobalCheck: true }); useEffect(() => setGlobalHotkeysEnabled(!opened), [opened]); @@ -45,18 +47,17 @@ export default function Modal({ opened && createPortal( - - {!hideCloseBtn || - (title && ( - - {title && {title}} - {!hideCloseBtn && ( - - - - )} - - ))} + + {(!hideCloseBtn || title) && ( + + {title && {title}} + {!hideCloseBtn && ( + + + + )} + + )} {children} , diff --git a/inertia/components/common/navigation/back_to_dashboard.tsx b/inertia/components/common/navigation/back_to_dashboard.tsx index 81913eb..3874071 100644 --- a/inertia/components/common/navigation/back_to_dashboard.tsx +++ b/inertia/components/common/navigation/back_to_dashboard.tsx @@ -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}; } diff --git a/inertia/pages/collections/delete.tsx b/inertia/pages/collections/delete.tsx index 01573ed..22216ea 100644 --- a/inertia/pages/collections/delete.tsx +++ b/inertia/pages/collections/delete.tsx @@ -21,7 +21,7 @@ export default function DeleteCollectionPage({ const handleSubmit = () => { const { method, url } = route('collection.delete', { - params: { id: collection.id }, + params: { id: collection.id.toString() }, }); submit(method, url); }; diff --git a/inertia/pages/collections/edit.tsx b/inertia/pages/collections/edit.tsx index fd5e249..42f9299 100644 --- a/inertia/pages/collections/edit.tsx +++ b/inertia/pages/collections/edit.tsx @@ -30,7 +30,7 @@ export default function EditCollectionPage({ const handleSubmit = () => { const { method, url } = route('collection.edit', { - params: { id: collection.id }, + params: { id: collection.id.toString() }, }); submit(method, url); }; diff --git a/inertia/pages/links/delete.tsx b/inertia/pages/links/delete.tsx index 5c0f99d..fc0ee27 100644 --- a/inertia/pages/links/delete.tsx +++ b/inertia/pages/links/delete.tsx @@ -15,10 +15,11 @@ export default function DeleteLinkPage({ link }: { link: Link }) { }); const handleSubmit = () => { - const { method, url } = route('link.delete', { params: { id: link.id } }); + const { method, url } = route('link.delete', { + params: { id: link.id.toString() }, + }); submit(method, url); }; - console.log(link); return ( { - const { method, url } = route('link.edit', { params: { id: link.id } }); + const { method, url } = route('link.edit', { + params: { id: link.id.toString() }, + }); submit(method, url); };