diff --git a/web/components/arrange-home.tsx b/web/components/arrange-home.tsx index 01746c1a..25e814b8 100644 --- a/web/components/arrange-home.tsx +++ b/web/components/arrange-home.tsx @@ -108,6 +108,7 @@ const SectionItem = (props: { export const getHomeItems = (groups: Group[], sections: string[]) => { const items = [ + { label: 'Daily movers', id: 'daily-movers' }, { label: 'Trending', id: 'score' }, { label: 'New for you', id: 'newest' }, ...groups.map((g) => ({ diff --git a/web/components/contract/prob-change-table.tsx b/web/components/contract/prob-change-table.tsx index f973d260..f3e00f69 100644 --- a/web/components/contract/prob-change-table.tsx +++ b/web/components/contract/prob-change-table.tsx @@ -3,22 +3,20 @@ import { contractPath } from 'web/lib/firebase/contracts' import { CPMMContract } from 'common/contract' import { formatPercent } from 'common/util/format' import { useProbChanges } from 'web/hooks/use-prob-changes' -import { linkClass, SiteLink } from '../site-link' +import { SiteLink } from '../site-link' import { Col } from '../layout/col' import { Row } from '../layout/row' -import { useState } from 'react' -export function ProbChangeTable(props: { userId: string | undefined }) { +export function ProbChangeTable(props: { userId: string | null | undefined }) { const { userId } = props const changes = useProbChanges(userId ?? '') - const [expanded, setExpanded] = useState(false) if (!changes) { return null } - const count = expanded ? 16 : 4 + const count = 6 const { positiveChanges, negativeChanges } = changes const filteredPositiveChanges = positiveChanges.slice(0, count / 2) @@ -29,47 +27,39 @@ export function ProbChangeTable(props: { userId: string | undefined }) { ] return ( - - - - {filteredChanges.slice(0, count / 2).map((contract) => ( - - - - {contract.question} - - - ))} - - - {filteredChanges.slice(count / 2).map((contract) => ( - - - - {contract.question} - - - ))} - + + + {filteredChanges.slice(0, count / 2).map((contract) => ( + + + + {contract.question} + + + ))} + + + {filteredChanges.slice(count / 2).map((contract) => ( + + + + {contract.question} + + + ))} -
setExpanded(!expanded)} - > - {expanded ? 'Show less' : 'Show more'} -
) } diff --git a/web/pages/experimental/home/index.tsx b/web/pages/experimental/home/index.tsx index 60474ded..2f55a377 100644 --- a/web/pages/experimental/home/index.tsx +++ b/web/pages/experimental/home/index.tsx @@ -52,21 +52,10 @@ const Home = () => { -
Daily movers
- - {sections.map((item) => { const { id } = item - if (id === 'your-bets') { - return ( - - ) + if (id === 'daily-movers') { + return } const sort = SORTS.find((sort) => sort.value === id) if (sort) @@ -161,6 +150,22 @@ function GroupSection(props: { group: Group; user: User | null | undefined }) { ) } +function DailyMoversSection(props: { userId: string | null | undefined }) { + const { userId } = props + return ( + + + Daily movers{' '} + + + + ) +} + function EditButton(props: { className?: string }) { const { className } = props