Skip to content

Commit

Permalink
nav bar
Browse files Browse the repository at this point in the history
  • Loading branch information
codyzu committed Jun 7, 2023
1 parent 8d390ac commit 4d4bd67
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
26 changes: 25 additions & 1 deletion src/layouts/DefaultLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
useEffect,
useState,
} from 'react';
import {Link} from 'react-router-dom';
import {Link, NavLink} from 'react-router-dom';
import clsx from 'clsx';
import {auth} from '../firebase';

export default function DefaultLayout({
Expand All @@ -21,6 +22,29 @@ export default function DefaultLayout({
return (
<div className="flex flex-col">
<div className="header grid grid-cols-[1fr_2fr_1fr] mx-4 px-4 mb-6">
<div className="flex flex-row justify-start items-center relative gap-4">
<div className="overflow-hidden flex flex-col justify-center pb-1">
<NavLink
end
className={({isActive}) =>
clsx('hover:nav-active bg-black', isActive && 'nav-active')
}
to="/"
>
Slidr
</NavLink>
</div>
<div className="overflow-hidden flex flex-col justify-center pb-1">
<NavLink
className={({isActive}) =>
clsx('hover:nav-active bg-black', isActive && 'nav-active')
}
to="/upload"
>
upload
</NavLink>
</div>
</div>
<div className="col-start-2 text-3xl flex flex-row items-center justify-center">
<div>{title}</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const router = createBrowserRouter([
<DefaultLayout
title={
<>
Present!
Browse Presentations
<div className="i-tabler-microphone-2 ml-2" />
</>
}
Expand Down
1 change: 1 addition & 0 deletions uno.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default defineConfig({
'p-2 shadow-primary border-primary bg-gray-200 text-black focus-visible:(border-focus outline-focus shadow-focus)',
header:
'text-2xl border-primary border-t-none rounded-t-none shadow-primary text-center py-2 font-semibold',
'nav-active': 'border-b-2 border-teal shadow-md shadow-teal-800',
},
// https://github.com/unocss/unocss/discussions/2012
theme: {
Expand Down

0 comments on commit 4d4bd67

Please sign in to comment.