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