Fix post-game analysis state, add profile nav route, and fix mobile profile overflow

This commit is contained in:
tyuXX 2026-11-22 20:10:16 +03:00
parent 02b8bafb1e
commit 3ccab53b41
7 changed files with 158 additions and 23 deletions

View file

@ -75,7 +75,14 @@ export class Navbar {
badge: state.friendBadgeCount > 0 ? state.friendBadgeCount : undefined,
match: (p) => p.indexOf('/friends') === 0
},
{ href: '/leaderboard', label: 'Leaderboard', match: (p) => p.indexOf('/leaderboard') === 0 }
{ href: '/leaderboard', label: 'Leaderboard', match: (p) => p.indexOf('/leaderboard') === 0 },
{
href: state.user ? `/u/${encodeURIComponent(state.user.username)}` : '/profile',
label: 'Profile',
match: (p) =>
p === '/profile' ||
(state.user !== null && p.toLowerCase() === `/u/${encodeURIComponent(state.user.username)}`.toLowerCase())
}
];
for (const item of navItems) {
@ -129,7 +136,7 @@ export class Navbar {
if (state.user) {
const profileLink = el(
'a',
{ href: `/u/${encodeURIComponent(state.user.username)}`, className: 'nav-user-link' },
{ href: `/u/${encodeURIComponent(state.user.username)}`, className: 'btn btn-sm nav-user-link' },
state.user.username
);
profileLink.addEventListener('click', (e) => {