fix navbar centering

This commit is contained in:
Lee 2024-04-19 15:29:26 +01:00
parent bcf6c4867d
commit 67a8cff0fd
3 changed files with 21 additions and 16 deletions

@ -19,7 +19,7 @@ export function GithubStar(): ReactElement {
return ( return (
<Link <Link
className="bg-github-green px-2 py-1 rounded-lg flex items-center gap-1 hover:opacity-85 transform-gpu transition-all" className="bg-github-green px-2 py-1 rounded-lg items-center gap-1 hover:opacity-85 transform-gpu transition-all hidden md:flex"
href="https://github.com/RealFascinated/minecraft-helper" href="https://github.com/RealFascinated/minecraft-helper"
target="_blank" target="_blank"
> >

@ -37,12 +37,15 @@ export default function NavBar(): ReactElement {
const path = usePathname(); const path = usePathname();
return ( return (
<div className="bg-secondary w-full rounded-lg flex justify-between items-center gap-3 mt-2 px-3 bg-opacity-85 h-12"> <div className="bg-secondary relative w-full rounded-lg flex justify-between items-center gap-3 mt-2 px-3 bg-opacity-85 h-12">
{/* Left */}
<Link href="/" className="flex items-center gap-2"> <Link href="/" className="flex items-center gap-2">
<Logo /> <Logo />
<p className="hidden md:block">Minecraft Utilities</p> <p className="hidden md:block">Minecraft Utilities</p>
</Link> </Link>
{/* Links */}
<div className="absolute inset-x-0 flex justify-center">
<div className="flex gap-4"> <div className="flex gap-4">
{pages.map((page, index) => { {pages.map((page, index) => {
const isActive = path.includes(page.url); const isActive = path.includes(page.url);
@ -58,7 +61,9 @@ export default function NavBar(): ReactElement {
); );
})} })}
</div> </div>
</div>
{/* Right */}
<div className="flex gap-4 items-center"> <div className="flex gap-4 items-center">
<ToggleThemeButton /> <ToggleThemeButton />
<GithubStar /> <GithubStar />

@ -10,7 +10,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(({ className, type,
type={type} type={type}
className={cn( className={cn(
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className className,
)} )}
ref={ref} ref={ref}
{...props} {...props}