diff --git a/web/components/nav/menu.tsx b/web/components/nav/menu.tsx index f61ebad9..492488d8 100644 --- a/web/components/nav/menu.tsx +++ b/web/components/nav/menu.tsx @@ -4,7 +4,7 @@ import clsx from 'clsx' export type MenuItem = { name: string - href: string + href?: string onClick?: () => void } @@ -38,11 +38,11 @@ export function MenuButton(props: { {({ active }) => ( {item.name} diff --git a/web/pages/experimental/home/index.tsx b/web/pages/experimental/home/index.tsx index 5217e0cc..5f7c91e9 100644 --- a/web/pages/experimental/home/index.tsx +++ b/web/pages/experimental/home/index.tsx @@ -1,10 +1,11 @@ -import React from 'react' +import React, { ReactNode } from 'react' import Router from 'next/router' import { AdjustmentsIcon, PlusSmIcon, ArrowSmRightIcon, SearchIcon, + DotsHorizontalIcon, } from '@heroicons/react/solid' import clsx from 'clsx' import Masonry from 'react-masonry-css' @@ -30,7 +31,7 @@ import { getHomeItems } from '../../../components/arrange-home' import { Title } from 'web/components/title' import { Row } from 'web/components/layout/row' import { ProbChangeTable } from 'web/components/contract/prob-change-table' -import { groupPath } from 'web/lib/firebase/groups' +import { groupPath, leaveGroup } from 'web/lib/firebase/groups' import { usePortfolioHistory } from 'web/hooks/use-portfolio-history' import { formatMoney } from 'common/util/format' import { useProbChanges } from 'web/hooks/use-prob-changes' @@ -38,6 +39,7 @@ import { ProfitBadge } from 'web/components/bets-list' import { calculatePortfolioProfit } from 'common/calculate-metrics' import { GroupCard } from 'web/pages/groups' import { chooseRandomSubset } from 'common/util/random' +import { MenuButton } from 'web/components/nav/menu' export default function Home() { const user = useUser() @@ -101,8 +103,12 @@ export default function Home() { ) } -function SectionHeader(props: { label: string; href: string }) { - const { label, href } = props +function SectionHeader(props: { + label: string + href: string + children?: ReactNode +}) { + const { label, href, children } = props return ( @@ -113,6 +119,7 @@ function SectionHeader(props: { label: string; href: string }) { aria-hidden="true" /> + {children} ) } @@ -151,7 +158,26 @@ function GroupSection(props: { return ( - + + +