mirror of
https://github.com/smolgrrr/TAO.git
synced 2024-09-20 09:21:25 +00:00
header param
This commit is contained in:
parent
553459afe8
commit
11628443cf
@ -3,8 +3,14 @@ import {
|
|||||||
BellIcon,
|
BellIcon,
|
||||||
HashtagIcon
|
HashtagIcon
|
||||||
} from "@heroicons/react/24/outline";
|
} from "@heroicons/react/24/outline";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
|
||||||
export default function Header() {
|
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 (
|
return (
|
||||||
<header className="mx-auto px-4 sm:px-6 lg:px-8 py-2">
|
<header className="mx-auto px-4 sm:px-6 lg:px-8 py-2">
|
||||||
<div className="flex justify-between items-center">
|
<div className="flex justify-between items-center">
|
||||||
@ -12,7 +18,7 @@ export default function Header() {
|
|||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<img src="/icon.png" className="h-12" alt="logo" />
|
<img src="/icon.png" className="h-12" alt="logo" />
|
||||||
<span className="font-semibold text-white">
|
<span className="font-semibold text-white">
|
||||||
{"~\\WIRED>"}
|
{`~/WIRED${lastPathPart}>`}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user