From ad18987e65ae132045ea260b6b29b2c96fd0c69c Mon Sep 17 00:00:00 2001 From: James Grugett Date: Wed, 7 Sep 2022 01:18:11 -0500 Subject: [PATCH] Update Daily movers UI --- web/components/contract/prob-change-table.tsx | 54 ++++++++++--------- web/pages/experimental/home/index.tsx | 1 + 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/web/components/contract/prob-change-table.tsx b/web/components/contract/prob-change-table.tsx index 9f1f171d..f6e5d892 100644 --- a/web/components/contract/prob-change-table.tsx +++ b/web/components/contract/prob-change-table.tsx @@ -4,12 +4,13 @@ import { CPMMContract } from 'common/contract' import { formatPercent } from 'common/util/format' import { useProbChanges } from 'web/hooks/use-prob-changes' import { SiteLink } from '../site-link' +import { Col } from '../layout/col' +import { Row } from '../layout/row' export function ProbChangeTable(props: { userId: string | undefined }) { const { userId } = props const changes = useProbChanges(userId ?? '') - console.log('changes', changes) if (!changes) { return null @@ -20,31 +21,34 @@ export function ProbChangeTable(props: { userId: string | undefined }) { const count = 3 return ( -
-
Daily movers
-
% pts
- {positiveChanges.slice(0, count).map((contract) => ( - <> -
- + + + {positiveChanges.slice(0, count).map((contract) => ( + + + {contract.question} -
- - - ))} -
- {negativeChanges.slice(0, count).map((contract) => ( - <> -
- + + ))} + + + {negativeChanges.slice(0, count).map((contract) => ( + + + {contract.question} -
- - - ))} -
+ + ))} + + ) } @@ -59,10 +63,10 @@ export function ProbChange(props: { const color = change > 0 - ? 'text-green-500' + ? 'text-green-600' : change < 0 - ? 'text-red-500' - : 'text-gray-500' + ? 'text-red-600' + : 'text-gray-600' const str = change === 0 diff --git a/web/pages/experimental/home/index.tsx b/web/pages/experimental/home/index.tsx index 606b66c4..0f02b002 100644 --- a/web/pages/experimental/home/index.tsx +++ b/web/pages/experimental/home/index.tsx @@ -77,6 +77,7 @@ const Home = (props: { auth: { user: User } | null }) => { ) : ( <> +
Daily movers
{visibleItems.map((item) => {