diff options
Diffstat (limited to 'components/layout/Header.tsx')
| -rw-r--r-- | components/layout/Header.tsx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/components/layout/Header.tsx b/components/layout/Header.tsx index 0e9e2abe..68db1426 100644 --- a/components/layout/Header.tsx +++ b/components/layout/Header.tsx @@ -23,7 +23,7 @@ import { navigationMenuTriggerStyle, } from "@/components/ui/navigation-menu"; import { SearchIcon, BellIcon, Menu } from "lucide-react"; -import { useParams, usePathname } from "next/navigation"; +import { useParams, usePathname, useSearchParams } from "next/navigation"; import { cn } from "@/lib/utils"; import Image from "next/image"; import { @@ -311,4 +311,13 @@ const ListItem = React.forwardRef< </li> ); }); -ListItem.displayName = "ListItem";
\ No newline at end of file +ListItem.displayName = "ListItem"; + +export function RouteLogger() { + const path = usePathname(); + const qs = useSearchParams().toString(); + React.useEffect(() => { + console.log("[URL]", path + (qs ? "?" + qs : "")); + }, [path, qs]); + return null; + }
\ No newline at end of file |
