unify single user and multi user behaviour

This commit is contained in:
Davide Scaini
2026-04-09 08:58:35 +02:00
parent 2007f53580
commit 98c42dc443
25 changed files with 678 additions and 232 deletions
@@ -0,0 +1,32 @@
---
/**
* Per-user athlete page: /u/{handle}/athlete/
*/
import Base from '../../../../layouts/Base.astro';
import AthleteView from '../../../../components/AthleteView.svelte';
import { readShardHandles } from '../../../../lib/manifest';
export function getStaticPaths() {
return readShardHandles().map(({ handle }) => ({
params: { handle },
props: { handle },
}));
}
const { handle } = Astro.props as { handle: string };
const base = import.meta.env.BASE_URL;
const mergedBase = `${base}data/${handle}/_merged/`;
const indexUrl = `${mergedBase}index.json`;
const athleteUrl = `${mergedBase}athlete.json`;
---
<Base title={`@${handle} Athlete — BincioActivity`}>
<div class="max-w-5xl mx-auto px-4 pt-6 pb-2">
<h1 class="text-2xl font-bold text-white mb-0.5">@{handle}</h1>
<nav class="flex gap-4 mt-1 mb-6">
<a href={`${base}u/${handle}/`} class="text-sm text-zinc-400 hover:text-white transition-colors">Feed</a>
<a href={`${base}u/${handle}/stats/`} class="text-sm text-zinc-400 hover:text-white transition-colors">Stats</a>
<a href={`${base}u/${handle}/athlete/`} class="text-sm text-[--accent]">Athlete</a>
</nav>
</div>
<AthleteView {base} {indexUrl} {athleteUrl} client:only="svelte" />
</Base>