From 442add3df21557f983746c9c9b9a290c3952eb72 Mon Sep 17 00:00:00 2001 From: David Scheidt Date: Wed, 17 Dec 2025 11:42:11 +0100 Subject: [PATCH] feat: respect how the username is written in the profile --- app/components/nav-bar.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/components/nav-bar.tsx b/app/components/nav-bar.tsx index bc2db917..0c2add69 100644 --- a/app/components/nav-bar.tsx +++ b/app/components/nav-bar.tsx @@ -14,18 +14,22 @@ import { useOptionalUser } from '~/utils' export function NavBar() { const location = useLocation() + // User is optional + // If no user render Login button + const user = useOptionalUser() const parts = location.pathname .split('/') .slice(1) .map((item) => { const decoded = decodeURIComponent(item) + + // respect the way the username is written, taking + // it from the user model instead of the url + if (item.toLowerCase() === user?.name.toLowerCase()) return user?.name + return decoded.charAt(0).toUpperCase() + decoded.slice(1) }) // prevents empty parts from showing - // User is optional - // If no user render Login button - const user = useOptionalUser() - return (