import Link from 'next/link'
import {
HomeIcon,
MenuAlt3Icon,
PresentationChartLineIcon,
SearchIcon,
ChatAltIcon,
XIcon,
} from '@heroicons/react/outline'
import { Transition, Dialog } from '@headlessui/react'
import { useState, Fragment } from 'react'
import Sidebar, { Item } from './sidebar'
import { useUser } from 'web/hooks/use-user'
import { formatMoney } from 'common/util/format'
import { Avatar } from '../avatar'
import clsx from 'clsx'
import { useRouter } from 'next/router'
function getNavigation(username: String) {
return [
{ name: 'Home', href: '/home', icon: HomeIcon },
{ name: 'Activity', href: '/activity', icon: ChatAltIcon },
{
name: 'Portfolio',
href: `/${username}/bets`,
icon: PresentationChartLineIcon,
},
]
}
const signedOutNavigation = [
{ name: 'Home', href: '/', icon: HomeIcon },
{ name: 'Explore', href: '/markets', icon: SearchIcon },
]
// From https://codepen.io/chris__sev/pen/QWGvYbL
export function BottomNavBar() {
const [sidebarOpen, setSidebarOpen] = useState(false)
const router = useRouter()
const currentPage = router.pathname
const user = useUser()
const navigationOptions =
user === null
? signedOutNavigation
: getNavigation(user?.username || 'error')
return (
)
}
function NavBarItem(props: { item: Item; currentPage: string }) {
const { item, currentPage } = props
return (