From b83e5db56370b6992ce0d556a39354a501eda633 Mon Sep 17 00:00:00 2001 From: ingawei <46611122+ingawei@users.noreply.github.com> Date: Fri, 30 Sep 2022 00:41:22 -0500 Subject: [PATCH] getting rid of daisy buttons (#969) * getting rid of daisy buttons so bet button does not turn black on mobile --- web/components/answers/answer-bet-panel.tsx | 6 +-- .../answers/answer-resolve-panel.tsx | 32 +++++++------ web/components/bet-panel.tsx | 14 ++---- web/components/bets-list.tsx | 3 +- web/components/button.tsx | 28 +++++++----- web/components/confirmation-button.tsx | 34 +++++++++----- web/components/groups/create-group-button.tsx | 7 +-- web/components/numeric-resolution-panel.tsx | 4 +- web/components/resolution-panel.tsx | 32 +++++-------- .../warning-confirmation-button.tsx | 45 ++++++++----------- web/components/yes-no-selector.tsx | 4 +- web/pages/profile.tsx | 5 ++- 12 files changed, 107 insertions(+), 107 deletions(-) diff --git a/web/components/answers/answer-bet-panel.tsx b/web/components/answers/answer-bet-panel.tsx index 85f61034..9867abab 100644 --- a/web/components/answers/answer-bet-panel.tsx +++ b/web/components/answers/answer-bet-panel.tsx @@ -184,16 +184,14 @@ export function AnswerBetPanel(props: { {user ? ( ) : ( diff --git a/web/components/answers/answer-resolve-panel.tsx b/web/components/answers/answer-resolve-panel.tsx index ddb7942c..57871cb8 100644 --- a/web/components/answers/answer-resolve-panel.tsx +++ b/web/components/answers/answer-resolve-panel.tsx @@ -85,17 +85,6 @@ export function AnswerResolvePanel(props: { setIsSubmitting(false) } - const resolutionButtonClass = - resolveOption === 'CANCEL' - ? 'bg-yellow-400 hover:bg-yellow-500' - : resolveOption === 'CHOOSE' && answers.length - ? 'btn-primary' - : resolveOption === 'CHOOSE_MULTIPLE' && - answers.length > 1 && - answers.every((answer) => chosenAnswers[answer] > 0) - ? 'bg-blue-400 hover:bg-blue-500' - : 'btn-disabled' - return ( @@ -129,11 +118,28 @@ export function AnswerResolvePanel(props: { Clear )} + 1 && + answers.every((answer) => chosenAnswers[answer] > 0) + ? 'blue' + : 'indigo' + } + disabled={ + !resolveOption || + (resolveOption === 'CHOOSE' && !answers.length) || + (resolveOption === 'CHOOSE_MULTIPLE' && + (!(answers.length > 1) || + !answers.every((answer) => chosenAnswers[answer] > 0))) + } onResolve={onResolve} isSubmitting={isSubmitting} - openModalButtonClass={resolutionButtonClass} - submitButtonClass={resolutionButtonClass} /> diff --git a/web/components/bet-panel.tsx b/web/components/bet-panel.tsx index 5d908937..e93c0e62 100644 --- a/web/components/bet-panel.tsx +++ b/web/components/bet-panel.tsx @@ -395,22 +395,16 @@ export function BuyPanel(props: { )} ) } @@ -84,18 +91,25 @@ export function ResolveConfirmationButton(props: { isSubmitting: boolean openModalButtonClass?: string submitButtonClass?: string + color?: ColorType + disabled?: boolean }) { - const { onResolve, isSubmitting, openModalButtonClass, submitButtonClass } = - props + const { + onResolve, + isSubmitting, + openModalButtonClass, + submitButtonClass, + color, + disabled, + } = props return ( ) diff --git a/web/components/resolution-panel.tsx b/web/components/resolution-panel.tsx index 7ef6e4f3..b3237eb4 100644 --- a/web/components/resolution-panel.tsx +++ b/web/components/resolution-panel.tsx @@ -57,17 +57,6 @@ export function ResolutionPanel(props: { setIsSubmitting(false) } - const submitButtonClass = - outcome === 'YES' - ? 'btn-primary' - : outcome === 'NO' - ? 'bg-red-400 hover:bg-red-500' - : outcome === 'CANCEL' - ? 'bg-yellow-400 hover:bg-yellow-500' - : outcome === 'MKT' - ? 'bg-blue-400 hover:bg-blue-500' - : 'btn-disabled' - return ( {isAdmin && !isCreator && ( @@ -76,18 +65,14 @@ export function ResolutionPanel(props: { )}
Resolve market
-
Outcome
- - -
{outcome === 'YES' ? ( <> @@ -123,16 +108,23 @@ export function ResolutionPanel(props: { <>Resolving this market will immediately pay out {BETTORS}. )}
- - {!!error &&
{error}
} - ) diff --git a/web/components/warning-confirmation-button.tsx b/web/components/warning-confirmation-button.tsx index 7c546c3b..abdf443e 100644 --- a/web/components/warning-confirmation-button.tsx +++ b/web/components/warning-confirmation-button.tsx @@ -5,17 +5,18 @@ import { Row } from './layout/row' import { ConfirmationButton } from './confirmation-button' import { ExclamationIcon } from '@heroicons/react/solid' import { formatMoney } from 'common/util/format' +import { Button, ColorType, SizeType } from './button' export function WarningConfirmationButton(props: { amount: number | undefined - outcome?: 'YES' | 'NO' | undefined marketType: 'freeResponse' | 'binary' warning?: string onSubmit: () => void - disabled?: boolean + disabled: boolean isSubmitting: boolean openModalButtonClass?: string - submitButtonClassName?: string + color: ColorType + size: SizeType }) { const { amount, @@ -24,53 +25,43 @@ export function WarningConfirmationButton(props: { disabled, isSubmitting, openModalButtonClass, - submitButtonClassName, - outcome, - marketType, + size, + color, } = props + if (!warning) { return ( - + ) } return ( diff --git a/web/components/yes-no-selector.tsx b/web/components/yes-no-selector.tsx index f73cdef2..10a58a42 100644 --- a/web/components/yes-no-selector.tsx +++ b/web/components/yes-no-selector.tsx @@ -213,7 +213,7 @@ export function NumberCancelSelector(props: { return (