Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: truncate text in navbar #384

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions frontend/components/layout/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,41 +48,41 @@ export const NavBar = (props: { team: string }) => {

return (
<header className="pr-8 pl-4 w-full h-16 border-b border-neutral-500/20 fixed top-0 z-10 grid grid-cols-3 gap-4 items-center justify-between text-neutral-500 font-medium bg-neutral-100/70 dark:bg-neutral-800/20 backdrop-blur-md">
<div className="flex items-center gap-2">
<Link href="/">
<div className="flex items-center gap-2 min-w-0 overflow-hidden">
<Link href="/" className="shrink-0">
<LogoMark className="w-10 fill-black dark:fill-white" />
</Link>
<span>/</span>
<span className="shrink-0">/</span>

{!activeApp && <span className="text-black dark:text-white">{props.team}</span>}
{!activeApp && (<span className="text-black dark:text-white overflow-hidden text-ellipsis whitespace-nowrap">{props.team}</span>)}

{activeApp && <Link href={`/${props.team}`}>{props.team}</Link>}
{activeApp && (<Link href={`/${props.team}`} className="overflow-hidden text-ellipsis whitespace-nowrap">{props.team}</Link>)}

{activeApp && <span>/</span>}
{activeApp && <span className="shrink-0">/</span>}

{activeApp &&
(appPage ? (
<Link href={`/${props.team}/apps/${activeApp.id}`}>{activeApp.name}</Link>
<Link href={`/${props.team}/apps/${activeApp.id}`} className="overflow-hidden text-ellipsis whitespace-nowrap">{activeApp.name}</Link>
) : (
<span className="text-black dark:text-white">{activeApp.name}</span>
<span className="text-black dark:text-white overflow-hidden text-ellipsis whitespace-nowrap">{activeApp.name}</span>
))}

{appPage && <span>/</span>}
{appPage && <span className="shrink-0">/</span>}

{appPage && (
<span
className={clsx(
'capitalize',
'capitalize overflow-hidden text-ellipsis whitespace-nowrap',
activeEnv ? 'text-neutral-500' : 'text-black dark:text-white'
)}
>
{appPage}
</span>
)}

{activeEnv && <span>/</span>}
{activeEnv && <span className="shrink-0">/</span>}

{activeEnv && <span className="text-black dark:text-white">{activeEnv.name}</span>}
{activeEnv && (<span className="text-black dark:text-white overflow-hidden text-ellipsis whitespace-nowrap">{activeEnv.name}</span>)}
</div>

<div className="flex justify-center w-full">
Expand Down
Loading