challenge button (WIP)
This commit is contained in:
parent
5252d63ef7
commit
776e0cd86d
|
@ -13,6 +13,7 @@ import { Contract } from 'common/contract'
|
||||||
import { CopyLinkButton } from 'web/components/copy-link-button'
|
import { CopyLinkButton } from 'web/components/copy-link-button'
|
||||||
import { SiteLink } from 'web/components/site-link'
|
import { SiteLink } from 'web/components/site-link'
|
||||||
import { getOutcomeProbability } from 'common/calculate'
|
import { getOutcomeProbability } from 'common/calculate'
|
||||||
|
import { createButtonStyle } from '../create-question-button'
|
||||||
|
|
||||||
type challengeInfo = {
|
type challengeInfo = {
|
||||||
amount: number
|
amount: number
|
||||||
|
@ -29,6 +30,9 @@ export function CreateChallengeButton(props: {
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
const [highlightedSlug, setHighlightedSlug] = useState('')
|
const [highlightedSlug, setHighlightedSlug] = useState('')
|
||||||
|
|
||||||
|
const gradient =
|
||||||
|
'from-indigo-500 to-red-500 hover:from-indigo-700 hover:to-red-700'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Modal open={open} setOpen={(newOpen) => setOpen(newOpen)}>
|
<Modal open={open} setOpen={(newOpen) => setOpen(newOpen)}>
|
||||||
|
@ -56,14 +60,16 @@ export function CreateChallengeButton(props: {
|
||||||
</Col>
|
</Col>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Button
|
<button
|
||||||
color={'indigo'}
|
|
||||||
size={'lg'}
|
|
||||||
onClick={() => setOpen(true)}
|
onClick={() => setOpen(true)}
|
||||||
className={clsx('whitespace-nowrap')}
|
className={clsx(
|
||||||
|
'border-w-0 h-11 rounded-md bg-gradient-to-r text-base font-semibold text-white shadow-sm',
|
||||||
|
gradient,
|
||||||
|
'max-w-xs justify-center px-2 mb-4'
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
Challenge
|
⚔️ Challenge a friend ⚔️
|
||||||
</Button>
|
</button>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,15 +119,10 @@ export const ContractOverview = (props: {
|
||||||
)}
|
)}
|
||||||
{outcomeType === 'NUMERIC' && <NumericGraph contract={contract} />}
|
{outcomeType === 'NUMERIC' && <NumericGraph contract={contract} />}
|
||||||
{(contract.description || isCreator) && <Spacer h={6} />}
|
{(contract.description || isCreator) && <Spacer h={6} />}
|
||||||
{isCreator && <ShareMarket className="px-2" contract={contract} />}
|
|
||||||
{showChallenge && (
|
{showChallenge && (
|
||||||
<Row className={'ml-1 items-center'}>
|
<CreateChallengeButton user={user} contract={contract} />
|
||||||
<div>Challenge a friend</div>
|
|
||||||
<Row className={'mt-2 ml-1'}>
|
|
||||||
<CreateChallengeButton user={user} contract={contract} />
|
|
||||||
</Row>
|
|
||||||
</Row>
|
|
||||||
)}
|
)}
|
||||||
|
{isCreator && <ShareMarket className="px-2" contract={contract} />}
|
||||||
<ContractDescription
|
<ContractDescription
|
||||||
className="px-2"
|
className="px-2"
|
||||||
contract={contract}
|
contract={contract}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user