Change /video/ route to /run/, add embed support
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user