unify single user and multi user behaviour
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
---
|
||||
/**
|
||||
* Per-user profile / feed page: /u/{handle}/
|
||||
*
|
||||
* Shows only this user's activities. In multi-user mode, getStaticPaths
|
||||
* reads the root shard manifest to discover all handles.
|
||||
*/
|
||||
import Base from '../../../layouts/Base.astro';
|
||||
import ActivityFeed from '../../../components/ActivityFeed.svelte';
|
||||
import { readShardHandles } from '../../../lib/manifest';
|
||||
|
||||
export function getStaticPaths() {
|
||||
return readShardHandles().map(({ handle, url }) => ({
|
||||
params: { handle },
|
||||
props: { handle, shardUrl: url },
|
||||
}));
|
||||
}
|
||||
|
||||
const { handle, shardUrl } = Astro.props as { handle: string; shardUrl: string };
|
||||
const base = import.meta.env.BASE_URL;
|
||||
---
|
||||
<Base title={`@${handle} — BincioActivity`}>
|
||||
<div class="max-w-5xl mx-auto px-4 pt-6 pb-2 flex items-center gap-4">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold text-white mb-0.5">@{handle}</h1>
|
||||
<nav class="flex gap-4 mt-1">
|
||||
<a href={`${base}u/${handle}/`} class="text-sm text-[--accent]">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-zinc-400 hover:text-white transition-colors">Athlete</a>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<ActivityFeed {base} filterHandle={handle} profileIndexUrl={shardUrl} client:only="svelte" />
|
||||
</Base>
|
||||
Reference in New Issue
Block a user