From 13d12bbb2fc1180521de329fbf4bcb478aeeaa47 Mon Sep 17 00:00:00 2001 From: ingawei Date: Wed, 14 Sep 2022 00:29:28 -0700 Subject: [PATCH] cleaned up add button, spacing things --- web/components/contract/contract-card.tsx | 2 +- web/components/contract/contract-details.tsx | 15 +++++--- .../contract/contract-info-dialog.tsx | 14 ++++++- web/components/contract/contract-overview.tsx | 2 +- .../contract/extra-contract-actions-row.tsx | 34 ++--------------- web/components/follow-button.tsx | 38 +++---------------- web/tailwind.config.js | 1 + 7 files changed, 34 insertions(+), 72 deletions(-) diff --git a/web/components/contract/contract-card.tsx b/web/components/contract/contract-card.tsx index 24658342..dab92a7a 100644 --- a/web/components/contract/contract-card.tsx +++ b/web/components/contract/contract-card.tsx @@ -106,7 +106,7 @@ export function ContractCard(props: { <> {outcomeType === 'BINARY' && ( )} diff --git a/web/components/contract/contract-details.tsx b/web/components/contract/contract-details.tsx index bb89c69d..b06522e7 100644 --- a/web/components/contract/contract-details.tsx +++ b/web/components/contract/contract-details.tsx @@ -106,6 +106,11 @@ export function AvatarDetails(props: { ) } +export function getIsMobile() { + const { width } = useWindowSize() + return (width ?? 0) < 600 +} + export function ContractDetails(props: { contract: Contract disabled?: boolean @@ -123,7 +128,7 @@ export function ContractDetails(props: { const user = useUser() const isCreator = user?.id === creatorId const { width } = useWindowSize() - const isMobile = (width ?? 0) < 600 + const isMobile = getIsMobile() return ( @@ -136,7 +141,7 @@ export function ContractDetails(props: { className="mr-1.5" /> {!disabled && ( -
+
)} @@ -234,7 +239,7 @@ export function MarketGroups(props: { isMobile ? 'max-w-[140px]' : 'max-w-[250px]' )} > -
+
{groupToDisplay.name}
@@ -248,7 +253,7 @@ export function MarketGroups(props: { >
No Group @@ -268,7 +273,7 @@ export function MarketGroups(props: { {groupInfo} {user && (