diff --git a/client/src/components/Header/Header.tsx b/client/src/components/Header/Header.tsx index 7888aba..11f469c 100644 --- a/client/src/components/Header/Header.tsx +++ b/client/src/components/Header/Header.tsx @@ -3,17 +3,23 @@ import { BellIcon, HashtagIcon } from "@heroicons/react/24/outline"; +import { useLocation } from "react-router-dom"; export default function Header() { + const location = useLocation(); + const pathParts = location.pathname.split('/'); + const secondLastPart = pathParts[pathParts.length - 2]; + const lastPathPart = secondLastPart === "thread" ? "/thread" : "/" + pathParts[pathParts.length - 1]; + return (
logo - - {"~\\WIRED>"} - + + {`~/WIRED${lastPathPart}>`} +