manifold/web/components/nav/nav-bar.tsx

64 lines
1.8 KiB
TypeScript
Raw Normal View History

import clsx from 'clsx'
import Link from 'next/link'
2022-03-17 07:50:45 +00:00
import { useUser } from '../../hooks/use-user'
import { firebaseLogin, User } from '../../lib/firebase/users'
2022-02-01 01:02:17 +00:00
import {
CollectionIcon,
HomeIcon,
SearchIcon,
UserGroupIcon,
} from '@heroicons/react/outline'
2022-02-01 01:02:17 +00:00
// From https://codepen.io/chris__sev/pen/QWGvYbL
export function BottomNavBar() {
const user = useUser()
if (!user) {
return null
}
2022-02-01 01:02:17 +00:00
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">
2022-02-01 01:02:17 +00:00
<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"
2022-02-01 01:02:17 +00:00
>
<HomeIcon className="my-1 mx-auto h-6 w-6" aria-hidden="true" />
2022-02-01 01:02:17 +00:00
{/* 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"
2022-02-01 01:02:17 +00:00
>
<SearchIcon className="my-1 mx-auto h-6 w-6" aria-hidden="true" />
2022-02-01 01:02:17 +00:00
{/* 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"
2022-02-01 01:02:17 +00:00
>
<UserGroupIcon className="my-1 mx-auto h-6 w-6" aria-hidden="true" />
2022-02-01 01:02:17 +00:00
{/* Folds */}
</a>
</Link>
{/* TODO: replace with a link to your own profile */}
<Link href="/trades">
2022-02-01 01:02:17 +00:00
<a
href="#"
className="block w-full py-2 px-3 text-center hover:bg-indigo-200 hover:text-indigo-700"
2022-02-01 01:02:17 +00:00
>
<CollectionIcon className="my-1 mx-auto h-6 w-6" aria-hidden="true" />
{/* Your Trades */}
2022-02-01 01:02:17 +00:00
</a>
</Link>
</nav>
)
}