Change /video/ route to /run/, add embed support

This commit is contained in:
CallMeVerity
2026-06-04 22:42:39 +01:00
parent f0f50a6f12
commit 32e13fcc85
5 changed files with 165 additions and 24 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ export default function App() {
<Routes>
<Route element={<Layout />}>
<Route index element={<Home />} />
<Route path="video/:id" element={<VideoDetail />} />
<Route path="run/:id" element={<VideoDetail />} />
<Route path="upload" element={<Upload />} />
</Route>
</Routes>
+1 -1
View File
@@ -52,7 +52,7 @@ export default function VideoCard({ video }: { video: VideoListItem }) {
return (
<Link
to={`/video/${video.id}`}
to={`/run/${video.id}`}
className="group flex h-full flex-col shadow no-underline"
>
<div className="relative aspect-video overflow-hidden rounded-t">
+7 -1
View File
@@ -66,8 +66,14 @@ export default function VideoDetail() {
useEffect(() => {
if (!id) return;
fetchVideo(id)
.then(setVideo)
.then((v) => {
setVideo(v);
document.title = `${getMapDisplayName(v.mapName)} - ${v.playerName} · surf.nathan.rip`;
})
.catch((err) => setError(err.message));
return () => {
document.title = "surf.nathan.rip";
};
}, [id]);
if (error) {