manifold/web/components/nav/nav-bar.tsx
Austin Chen 5c12da140d
Add a left sidebar on desktop (#70)
* Copy in nav from TailwindUI

* Split up nav files

* Hook up sidebar options to the current page

* Tweak padding

* Insert a right sidebar on folds & contracts

* Keep column always centered

* Remove markets and folds from top navbar

* Extract out sidebaricon; link to /about

* Rename to "useFollowedFoldIds"

* Cache followed folds in localstorage

* Remove unused mobile sidebar (for now)

* Remove unused code

* Remove sidebar from landing page

* Tweak resolution panel styling

* Remove the top navbar entirely

* Completely remove the old navbar

* Add "more" and profile link

* Rearrange sidebar ordering

* Remove unused component

* Add Sign In button for logged-out users

* Remove extra options for signed-out users
2022-03-30 16:56:51 -07:00

64 lines
1.8 KiB
TypeScript

import clsx from 'clsx'
import Link from 'next/link'
import { useUser } from '../../hooks/use-user'
import { firebaseLogin, User } from '../../lib/firebase/users'
import {
CollectionIcon,
HomeIcon,
SearchIcon,
UserGroupIcon,
} from '@heroicons/react/outline'
// From https://codepen.io/chris__sev/pen/QWGvYbL
export function BottomNavBar() {
const user = useUser()
if (!user) {
return null
}
return (
<nav className="fixed inset-x-0 bottom-0 z-20 flex justify-between border-t-2 bg-white text-xs text-gray-700 md:hidden">
<Link href="/home">
<a
href="#"
className="block w-full py-2 px-3 text-center transition duration-300 hover:bg-indigo-200 hover:text-indigo-700"
>
<HomeIcon className="my-1 mx-auto h-6 w-6" aria-hidden="true" />
{/* Home */}
</a>
</Link>
<Link href="/markets">
<a
href="#"
className="block w-full py-2 px-3 text-center hover:bg-indigo-200 hover:text-indigo-700"
>
<SearchIcon className="my-1 mx-auto h-6 w-6" aria-hidden="true" />
{/* Explore */}
</a>
</Link>
<Link href="/folds">
<a
href="#"
className="block w-full py-2 px-3 text-center hover:bg-indigo-200 hover:text-indigo-700"
>
<UserGroupIcon className="my-1 mx-auto h-6 w-6" aria-hidden="true" />
{/* Folds */}
</a>
</Link>
{/* TODO: replace with a link to your own profile */}
<Link href="/trades">
<a
href="#"
className="block w-full py-2 px-3 text-center hover:bg-indigo-200 hover:text-indigo-700"
>
<CollectionIcon className="my-1 mx-auto h-6 w-6" aria-hidden="true" />
{/* Your Trades */}
</a>
</Link>
</nav>
)
}