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(nav): logo instead of home link #209

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
28 changes: 16 additions & 12 deletions src/app/components/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Form, Link, NavLink, useLocation } from '@remix-run/react';
import classNames from 'classnames';
import { CirclePlus, DoorOpen, Home, Info, MenuIcon, MessageCircle, Settings, TriangleAlert, Vote } from 'lucide-react';
import { CirclePlus, DoorOpen, Info, MenuIcon, MessageCircle, Settings, TriangleAlert, Vote } from 'lucide-react';
import { HTMLAttributes, useState } from 'react';
import { SCIcon } from './icon/SC';
import { ThemeToggle } from './ThemeToggle';
import { Button } from './ui/button';
import {
Expand All @@ -15,11 +16,6 @@ import { ScrollArea } from './ui/scroll-area';
import { Sheet, SheetContent, SheetTrigger } from './ui/sheet';

const navItems = [
{
label: 'Home',
href: '/',
icon: Home,
},
{
label: 'Issues',
href: '/issues',
Expand Down Expand Up @@ -84,7 +80,10 @@ function User({ login, role }: { login: string; role: 'ADMIN' | 'USER' } & HTMLA
function MainNav({ login, role }: { login: string; role: 'ADMIN' | 'USER' }) {
return (
<div className='hidden md:flex flex-row justify-between w-full items-center gap-2 px-2'>
<div className='gap-2 flex'>
<div className='gap-2 flex content-center'>
<NavLink to='/' end className='text-primary flex my-auto px-2'>
<SCIcon width={200} height={200} className='size-7' />
</NavLink>
{navItems.map((item) => (
<NavLink
key={item.href}
Expand Down Expand Up @@ -115,11 +114,16 @@ function MobileNav({ login, role }: { login: string; role: 'ADMIN' | 'USER' }) {
<div className='md:hidden w-full'>
<Sheet open={open} onOpenChange={setOpen}>
<div className='flex flex-row items-center justify-between w-full'>
<SheetTrigger asChild>
<Button variant='ghost' size='icon' className='md:hidden'>
<MenuIcon />
</Button>
</SheetTrigger>
<div className='flex gap-2 items-center'>
<NavLink to='/' end className='text-primary flex my-auto'>
<SCIcon width={200} height={200} className='size-7' />
</NavLink>
<SheetTrigger asChild>
<Button variant='ghost' size='icon' className='md:hidden'>
<MenuIcon />
</Button>
</SheetTrigger>
</div>
<div className='flex gap-2 items-center'>
<ThemeToggle />
<User login={login} role={role} />
Expand Down
Loading