fix: the user feed shows a page that nests again "feed stats athlete" that should be shown only if you are browsing a user that is not you
This commit is contained in:
@@ -22,7 +22,7 @@ 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">
|
||||
<nav id="profile-subnav" 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>
|
||||
@@ -30,3 +30,13 @@ const athleteUrl = `${mergedBase}athlete.json`;
|
||||
</div>
|
||||
<AthleteView {base} {indexUrl} {athleteUrl} client:only="svelte" />
|
||||
</Base>
|
||||
<script define:vars={{ handle }}>
|
||||
function applyMeCheck(me) {
|
||||
if (me === handle) document.getElementById('profile-subnav')?.remove();
|
||||
}
|
||||
if (window.__bincioMe !== undefined) {
|
||||
applyMeCheck(window.__bincioMe);
|
||||
} else {
|
||||
window.addEventListener('bincio:me', e => applyMeCheck(e.detail), { once: true });
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user