an independent Bluesky client using Constellation, PDS Queries, and other services reddwarf.app
frontend spa bluesky reddwarf microcosm client app

profile link in navbar

rimar1337 19802f10 78b79fd1

+23 -13
+23 -13
src/routes/__root.tsx
··· 11 Scripts, 12 createRootRoute, 13 useLocation, 14 } from "@tanstack/react-router"; 15 import { TanStackRouterDevtools } from "@tanstack/react-router-devtools"; 16 import * as React from "react"; ··· 61 { rel: "icon", href: "/favicon.ico" }, 62 ], 63 }), 64 - errorComponent: (props) => { 65 - return ( 66 - <RootDocument> 67 - <DefaultCatchBoundary {...props} /> 68 - </RootDocument> 69 - ); 70 - }, 71 notFoundComponent: () => <NotFound />, 72 component: RootComponent, 73 }); ··· 86 87 function RootDocument({ children }: { children: React.ReactNode }) { 88 const location = useLocation(); 89 const { agent, authed } = useAuth(); 90 const isHome = location.pathname === "/"; 91 const isNotifications = location.pathname.startsWith("/notifications"); 92 - const isProfile = location.pathname.startsWith("/profile/"); 93 94 const [postOpen, setPostOpen] = useState(false); 95 const [postText, setPostText] = useState(""); ··· 242 }`} 243 onClick={() => { 244 if (authed && agent && agent.assertDid) { 245 - window.location.href = `/profile/${agent.assertDid}`; 246 } 247 }} 248 type="button" ··· 347 348 <div className="flex-1"></div> 349 <p className="text-xs text-gray-400 dark:text-gray-500 text-justify mx-4 mb-4"> 350 - Red Dwarf is a bluesky client that uses Constellation and 351 - direct PDS queries. Skylite would be a 352 - self-hosted bluesky "instance". Stay tuned for the release of Skylite. 353 </p> 354 </aside> 355 </div> ··· 409 }`} 410 onClick={() => { 411 if (authed && agent && agent.assertDid) { 412 - window.location.href = `/profile/${agent.assertDid}`; 413 } 414 }} 415 type="button"
··· 11 Scripts, 12 createRootRoute, 13 useLocation, 14 + useNavigate, 15 } from "@tanstack/react-router"; 16 import { TanStackRouterDevtools } from "@tanstack/react-router-devtools"; 17 import * as React from "react"; ··· 62 { rel: "icon", href: "/favicon.ico" }, 63 ], 64 }), 65 + errorComponent: import.meta.env.DEV 66 + ? undefined 67 + : (props) => ( 68 + <RootDocument> 69 + <DefaultCatchBoundary {...props} /> 70 + </RootDocument> 71 + ), 72 notFoundComponent: () => <NotFound />, 73 component: RootComponent, 74 }); ··· 87 88 function RootDocument({ children }: { children: React.ReactNode }) { 89 const location = useLocation(); 90 + const navigate = useNavigate(); 91 const { agent, authed } = useAuth(); 92 const isHome = location.pathname === "/"; 93 const isNotifications = location.pathname.startsWith("/notifications"); 94 + const isProfile = agent && ((location.pathname === (`/profile/${agent.assertDid}`)) || (location.pathname === (`/profile/${encodeURIComponent(agent.assertDid)}`))); 95 96 const [postOpen, setPostOpen] = useState(false); 97 const [postText, setPostText] = useState(""); ··· 244 }`} 245 onClick={() => { 246 if (authed && agent && agent.assertDid) { 247 + //window.location.href = `/profile/${agent.assertDid}`; 248 + navigate({ 249 + to: "/profile/$did", 250 + params: { did: agent.assertDid }, 251 + }) 252 } 253 }} 254 type="button" ··· 353 354 <div className="flex-1"></div> 355 <p className="text-xs text-gray-400 dark:text-gray-500 text-justify mx-4 mb-4"> 356 + Red Dwarf is a bluesky client that uses Constellation and direct PDS 357 + queries. Skylite would be a self-hosted bluesky "instance". Stay 358 + tuned for the release of Skylite. 359 </p> 360 </aside> 361 </div> ··· 415 }`} 416 onClick={() => { 417 if (authed && agent && agent.assertDid) { 418 + //window.location.href = `/profile/${agent.assertDid}`; 419 + navigate({ 420 + to: "/profile/$did", 421 + params: { did: agent.assertDid }, 422 + }) 423 } 424 }} 425 type="button"