From 0b711be4802c73652892011c990aa8297f3c97bf Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Sun, 14 Aug 2022 01:05:17 -0700 Subject: [PATCH] Clean up a bunch of markup and CSS on contract cards (#753) * Remove random unnecessary top-level divs * Remove wrapper in MiscDetails * Remove another wrapper in ContractCard * Fix a bunch of weird CSS stuff --- web/components/contract/contract-card.tsx | 197 ++++++++++------------ web/components/contract/quick-bet.tsx | 2 +- 2 files changed, 94 insertions(+), 105 deletions(-) diff --git a/web/components/contract/contract-card.tsx b/web/components/contract/contract-card.tsx index ac1a2fa2..b4f20a40 100644 --- a/web/components/contract/contract-card.tsx +++ b/web/components/contract/contract-card.tsx @@ -66,115 +66,104 @@ export function ContractCard(props: { !hideQuickBet return ( -
- - - -
- {onClick ? ( - { - // Let the browser handle the link click (opens in new tab). - if (e.ctrlKey || e.metaKey) return + + + {onClick ? ( + { + // Let the browser handle the link click (opens in new tab). + if (e.ctrlKey || e.metaKey) return - e.preventDefault() - track('click market card', { - slug: contract.slug, - contractId: contract.id, - }) - onClick() - }} - /> - ) : ( - - - - )} -
- -

- {question} -

- - {(outcomeType === 'FREE_RESPONSE' || - outcomeType === 'MULTIPLE_CHOICE') && - (resolution ? ( - - ) : ( - - ))} - - + ) : ( + +
+ + )} + +

+ {question} +

+ + {(outcomeType === 'FREE_RESPONSE' || + outcomeType === 'MULTIPLE_CHOICE') && + (resolution ? ( + - - {showQuickBet ? ( - ) : ( - - {outcomeType === 'BINARY' && ( - - )} + + ))} - {outcomeType === 'PSEUDO_NUMERIC' && ( - - )} - - {outcomeType === 'NUMERIC' && ( - - )} - - {(outcomeType === 'FREE_RESPONSE' || - outcomeType === 'MULTIPLE_CHOICE') && ( - - )} - - - )} -
+ -
+ {showQuickBet ? ( + + ) : ( + <> + {outcomeType === 'BINARY' && ( + + )} + + {outcomeType === 'PSEUDO_NUMERIC' && ( + + )} + + {outcomeType === 'NUMERIC' && ( + + )} + + {(outcomeType === 'FREE_RESPONSE' || + outcomeType === 'MULTIPLE_CHOICE') && ( + + )} + + + )} + ) } diff --git a/web/components/contract/quick-bet.tsx b/web/components/contract/quick-bet.tsx index 482aea47..92cee018 100644 --- a/web/components/contract/quick-bet.tsx +++ b/web/components/contract/quick-bet.tsx @@ -138,7 +138,7 @@ export function QuickBet(props: { return (