Fix top nav style on tablet
This commit is contained in:
parent
294cc9b614
commit
574bdd539a
|
@ -11,6 +11,7 @@ import { useUser } from 'web/hooks/use-user'
|
||||||
import NotificationsIcon from '../notifications-icon'
|
import NotificationsIcon from '../notifications-icon'
|
||||||
import router from 'next/router'
|
import router from 'next/router'
|
||||||
import { userProfileItem } from './bottom-nav-bar'
|
import { userProfileItem } from './bottom-nav-bar'
|
||||||
|
import Link from 'next/link'
|
||||||
|
|
||||||
const mobileGroupNavigation = [
|
const mobileGroupNavigation = [
|
||||||
{ name: 'Markets', key: 'markets', icon: PresentationChartLineIcon },
|
{ name: 'Markets', key: 'markets', icon: PresentationChartLineIcon },
|
||||||
|
@ -35,7 +36,7 @@ export function GroupNavBar(props: {
|
||||||
const user = useUser()
|
const user = useUser()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<nav className="z-20 flex justify-between border-t-2 bg-white text-xs text-gray-700 lg:hidden">
|
<nav className="z-20 flex border-t-2 bg-white text-xs text-gray-700">
|
||||||
{mobileGroupNavigation.map((item) => (
|
{mobileGroupNavigation.map((item) => (
|
||||||
<NavBarItem
|
<NavBarItem
|
||||||
key={item.name}
|
key={item.name}
|
||||||
|
@ -75,23 +76,23 @@ function NavBarItem(props: {
|
||||||
currentPage: string
|
currentPage: string
|
||||||
onClick: (key: string) => void
|
onClick: (key: string) => void
|
||||||
}) {
|
}) {
|
||||||
const { item, currentPage } = props
|
const { item, currentPage, onClick } = props
|
||||||
const track = trackCallback(
|
const track = trackCallback(
|
||||||
`group navbar: ${item.trackingEventName ?? item.name}`
|
`group navbar: ${item.trackingEventName ?? item.name}`
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button onClick={() => props.onClick(item.key ?? '#')}>
|
<Link href={item.href ?? '#'}>
|
||||||
<a
|
<a
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'block w-full py-1 px-3 text-center hover:bg-indigo-200 hover:text-indigo-700',
|
'block w-full py-1 px-3 text-center hover:bg-indigo-200 hover:text-indigo-700',
|
||||||
currentPage === item.key && 'bg-gray-200 text-indigo-700'
|
currentPage === item.key && 'bg-gray-200 text-indigo-700'
|
||||||
)}
|
)}
|
||||||
onClick={track}
|
onClick={() => (onClick?.(item.key ?? '#'), track())}
|
||||||
>
|
>
|
||||||
{item.icon && <item.icon className="my-1 mx-auto h-6 w-6" />}
|
{item.icon && <item.icon className="my-1 mx-auto h-6 w-6" />}
|
||||||
{item.name}
|
{item.name}
|
||||||
</a>
|
</a>
|
||||||
</button>
|
</Link>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -302,12 +302,13 @@ export function TopGroupNavBar(props: {
|
||||||
onClick: (key: string) => void
|
onClick: (key: string) => void
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<header className="sticky top-0 z-50 w-full border-b border-gray-200 md:hidden lg:col-span-12">
|
<header className="sticky top-0 z-50 w-full border-b border-gray-200 lg:hidden lg:col-span-12">
|
||||||
<div className="flex items-center bg-white px-4">
|
<div className="flex items-center bg-white px-4">
|
||||||
<div className="flex-shrink-0">
|
<div className="flex-shrink-0">
|
||||||
<Link href="/">
|
<Link href="/">
|
||||||
<a className="text-indigo-700 hover:text-gray-500 ">
|
<a className="text-indigo-700 hover:text-gray-500 ">
|
||||||
<ArrowLeftIcon className="h-5 w-5" aria-hidden="true" />
|
<ArrowLeftIcon className="h-5 w-5" aria-hidden />
|
||||||
|
<span className='sr-only'>Home</span>
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user