Retro Bulletin Board Systems on atproto. Web app and TUI. lazy mirror of alyraffauf/atbbs atbbs.xyz
forums python tui atproto bbs
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

web/PostMeta: useNavigate to avoid nested links

+15 -6
+15 -6
web/src/components/post/PostMeta.tsx
··· 1 - import { Link } from "react-router-dom"; 1 + import { useNavigate } from "react-router-dom"; 2 2 import { formatFullDate, relativeDate } from "../../lib/util"; 3 3 4 4 interface PostMetaProps { ··· 7 7 } 8 8 9 9 export default function PostMeta({ handle, createdAt }: PostMetaProps) { 10 + const navigate = useNavigate(); 11 + 12 + function handleClick(event: React.MouseEvent) { 13 + event.preventDefault(); 14 + event.stopPropagation(); 15 + navigate(`/profile/${encodeURIComponent(handle)}`); 16 + } 17 + 10 18 return ( 11 19 <div className="flex items-baseline gap-2"> 12 - <Link 13 - to={`/profile/${encodeURIComponent(handle)}`} 14 - className="text-neutral-200 hover:underline" 15 - onClick={(event) => event.stopPropagation()} 20 + <span 21 + role="link" 22 + tabIndex={0} 23 + onClick={handleClick} 24 + className="text-neutral-200 hover:underline cursor-pointer" 16 25 > 17 26 {handle} 18 - </Link> 27 + </span> 19 28 <span className="text-neutral-600">·</span> 20 29 <time 21 30 className="text-xs text-neutral-500"