add source code link

This commit is contained in:
john 2025-06-17 11:18:23 +02:00
parent f7771c7df3
commit 7fab3d0d9f
2 changed files with 60 additions and 3 deletions

View file

@ -8,9 +8,26 @@ export default function NavBar({ children }: PropsWithChildren<NavBarProps>) {
const user = useUser()
const isSuperUser = user?.roles.includes(Role.SuperUser)
return (
<nav className={`w-full flex flex-row justify-end gap-4 px-4 md:px-8 py-3`}>
{children}
{isSuperUser && <NavButton to={'/admin/codes'}>admin</NavButton>}
<nav className={`w-full flex flex-row justify-between px-4 md:px-8 py-3`}>
<div className={`flex flex-row justify-start gap-4`}></div>
<div className={`flex flex-row justify-end gap-4`}>
{children}
{isSuperUser && <NavButton to={'/admin/codes'}>admin</NavButton>}
<SourceCodeLink />
</div>
</nav>
)
}
function SourceCodeLink() {
return (
<a
className={`size-6`}
href="https://git.botris.dev/botris.social"
target="_blank"
title={'source code'}
>
<img style={{ color: 'red' }} src="/forgejo-logo-primary.svg" alt="Forgejo Logo" />
</a>
)
}