Remove green circle from resolution prob input

This commit is contained in:
Ian Philips 2022-09-30 08:48:33 -06:00
parent 138f34fc66
commit 55f854115c
2 changed files with 26 additions and 29 deletions

View File

@ -8,12 +8,12 @@ export function ProbabilitySelector(props: {
const { probabilityInt, setProbabilityInt, isSubmitting } = props const { probabilityInt, setProbabilityInt, isSubmitting } = props
return ( return (
<Row className="items-center gap-2"> <Row className="items-center gap-2">
<label className="input-group input-group-lg w-fit text-lg"> <label className="input-group input-group-lg text-lg">
<input <input
type="number" type="number"
value={probabilityInt} value={probabilityInt}
className="input input-bordered input-md text-lg" className="input input-bordered input-md w-28 text-lg"
disabled={isSubmitting} disabled={isSubmitting}
min={1} min={1}
max={99} max={99}
@ -23,14 +23,6 @@ export function ProbabilitySelector(props: {
/> />
<span>%</span> <span>%</span>
</label> </label>
<input
type="range"
className="range range-primary"
min={1}
max={99}
value={probabilityInt}
onChange={(e) => setProbabilityInt(parseInt(e.target.value))}
/>
</Row> </Row>
) )
} }

View File

@ -11,6 +11,8 @@ import { ProbabilitySelector } from './probability-selector'
import { getProbability } from 'common/calculate' import { getProbability } from 'common/calculate'
import { BinaryContract, resolution } from 'common/contract' import { BinaryContract, resolution } from 'common/contract'
import { BETTOR, BETTORS, PAST_BETS } from 'common/user' import { BETTOR, BETTORS, PAST_BETS } from 'common/user'
import { Row } from 'web/components/layout/row'
import { capitalize } from 'lodash'
export function ResolutionPanel(props: { export function ResolutionPanel(props: {
isAdmin: boolean isAdmin: boolean
@ -94,9 +96,10 @@ export function ResolutionPanel(props: {
withdrawn from your account withdrawn from your account
</> </>
) : outcome === 'MKT' ? ( ) : outcome === 'MKT' ? (
<Col className="gap-6"> <Col className="items-center gap-6">
<div> <div>
{PAST_BETS} will be paid out at the probability you specify: {capitalize(PAST_BETS)} will be paid out at the probability you
specify:
</div> </div>
<ProbabilitySelector <ProbabilitySelector
probabilityInt={Math.round(prob)} probabilityInt={Math.round(prob)}
@ -110,22 +113,24 @@ export function ResolutionPanel(props: {
</div> </div>
<Spacer h={4} /> <Spacer h={4} />
{!!error && <div className="text-red-500">{error}</div>} {!!error && <div className="text-red-500">{error}</div>}
<ResolveConfirmationButton <Row className={'justify-center'}>
color={ <ResolveConfirmationButton
outcome === 'YES' color={
? 'green' outcome === 'YES'
: outcome === 'NO' ? 'green'
? 'red' : outcome === 'NO'
: outcome === 'CANCEL' ? 'red'
? 'yellow' : outcome === 'CANCEL'
: outcome === 'MKT' ? 'yellow'
? 'blue' : outcome === 'MKT'
: 'indigo' ? 'blue'
} : 'indigo'
disabled={!outcome} }
onResolve={resolve} disabled={!outcome}
isSubmitting={isSubmitting} onResolve={resolve}
/> isSubmitting={isSubmitting}
/>
</Row>
</Col> </Col>
) )
} }