fix navbar tracking
This commit is contained in:
parent
579dcd81dc
commit
d78bbcb3df
|
@ -63,6 +63,7 @@ export function BottomNavBar() {
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
item={{
|
item={{
|
||||||
name: formatMoney(user.balance),
|
name: formatMoney(user.balance),
|
||||||
|
trackingEventName: 'profile',
|
||||||
href: `/${user.username}?tab=bets`,
|
href: `/${user.username}?tab=bets`,
|
||||||
icon: () => (
|
icon: () => (
|
||||||
<Avatar
|
<Avatar
|
||||||
|
@ -94,6 +95,7 @@ export function BottomNavBar() {
|
||||||
|
|
||||||
function NavBarItem(props: { item: Item; currentPage: string }) {
|
function NavBarItem(props: { item: Item; currentPage: string }) {
|
||||||
const { item, currentPage } = props
|
const { item, currentPage } = props
|
||||||
|
const track = trackCallback(`navbar: ${item.trackingEventName ?? item.name}`)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link href={item.href}>
|
<Link href={item.href}>
|
||||||
|
@ -102,7 +104,7 @@ function NavBarItem(props: { item: Item; currentPage: string }) {
|
||||||
'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.href && 'bg-gray-200 text-indigo-700'
|
currentPage === item.href && 'bg-gray-200 text-indigo-700'
|
||||||
)}
|
)}
|
||||||
onClick={trackCallback('navbar: ' + item.name)}
|
onClick={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}
|
||||||
|
|
|
@ -120,6 +120,7 @@ function getMoreMobileNav() {
|
||||||
|
|
||||||
export type Item = {
|
export type Item = {
|
||||||
name: string
|
name: string
|
||||||
|
trackingEventName?: string
|
||||||
href: string
|
href: string
|
||||||
icon?: React.ComponentType<{ className?: string }>
|
icon?: React.ComponentType<{ className?: string }>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user