Improve layout of bets card
This commit is contained in:
		
							parent
							
								
									985621982b
								
							
						
					
					
						commit
						ad2f080c6e
					
				| 
						 | 
					@ -100,7 +100,7 @@ function MyContractBets(props: { contract: Contract; bets: Bet[] }) {
 | 
				
			||||||
      )}
 | 
					      )}
 | 
				
			||||||
      onClick={() => setCollapsed((collapsed) => !collapsed)}
 | 
					      onClick={() => setCollapsed((collapsed) => !collapsed)}
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      <Row>
 | 
					      <Row className="flex-wrap gap-4">
 | 
				
			||||||
        <Col className="flex-[2] gap-1">
 | 
					        <Col className="flex-[2] gap-1">
 | 
				
			||||||
          <div>
 | 
					          <div>
 | 
				
			||||||
            <Link href={path(contract)}>
 | 
					            <Link href={path(contract)}>
 | 
				
			||||||
| 
						 | 
					@ -120,7 +120,7 @@ function MyContractBets(props: { contract: Contract; bets: Bet[] }) {
 | 
				
			||||||
            {resolution && (
 | 
					            {resolution && (
 | 
				
			||||||
              <>
 | 
					              <>
 | 
				
			||||||
                <div>•</div>
 | 
					                <div>•</div>
 | 
				
			||||||
                <div>
 | 
					                <div className="whitespace-nowrap">
 | 
				
			||||||
                  Resolved <OutcomeLabel outcome={resolution} />
 | 
					                  Resolved <OutcomeLabel outcome={resolution} />
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
              </>
 | 
					              </>
 | 
				
			||||||
| 
						 | 
					@ -128,6 +128,7 @@ function MyContractBets(props: { contract: Contract; bets: Bet[] }) {
 | 
				
			||||||
          </Row>
 | 
					          </Row>
 | 
				
			||||||
        </Col>
 | 
					        </Col>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <Row className="flex-nowrap">
 | 
				
			||||||
          <MyBetsSummary
 | 
					          <MyBetsSummary
 | 
				
			||||||
            className="flex-1 justify-end"
 | 
					            className="flex-1 justify-end"
 | 
				
			||||||
            contract={contract}
 | 
					            contract={contract}
 | 
				
			||||||
| 
						 | 
					@ -140,8 +141,12 @@ function MyContractBets(props: { contract: Contract; bets: Bet[] }) {
 | 
				
			||||||
            style={{ top: -10, right: -20 }}
 | 
					            style={{ top: -10, right: -20 }}
 | 
				
			||||||
          />
 | 
					          />
 | 
				
			||||||
        </Row>
 | 
					        </Row>
 | 
				
			||||||
 | 
					      </Row>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      <div className="collapse-content" style={{ backgroundColor: 'white' }}>
 | 
					      <div
 | 
				
			||||||
 | 
					        className="collapse-content"
 | 
				
			||||||
 | 
					        style={{ backgroundColor: 'white', paddingBottom: 0 }}
 | 
				
			||||||
 | 
					      >
 | 
				
			||||||
        <Spacer h={8} />
 | 
					        <Spacer h={8} />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <ContractBetsTable contract={contract} bets={bets} />
 | 
					        <ContractBetsTable contract={contract} bets={bets} />
 | 
				
			||||||
| 
						 | 
					@ -172,31 +177,33 @@ export function MyBetsSummary(props: {
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <Row className={clsx('gap-8', className)}>
 | 
					    <Row className={clsx('gap-6', className)}>
 | 
				
			||||||
      <Col>
 | 
					      <Col>
 | 
				
			||||||
        <div className="text-sm text-gray-500">Total bets</div>
 | 
					        <div className="text-sm text-gray-500 whitespace-nowrap">
 | 
				
			||||||
        <div>{formatMoney(betsTotal)}</div>
 | 
					          Total bets
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					        <div className="whitespace-nowrap">{formatMoney(betsTotal)}</div>
 | 
				
			||||||
      </Col>
 | 
					      </Col>
 | 
				
			||||||
      {resolution ? (
 | 
					      {resolution ? (
 | 
				
			||||||
        <>
 | 
					        <>
 | 
				
			||||||
          <Col>
 | 
					          <Col>
 | 
				
			||||||
            <div className="text-sm text-gray-500">Winnings</div>
 | 
					            <div className="text-sm text-gray-500">Winnings</div>
 | 
				
			||||||
            <div>{formatMoney(betsPayout)}</div>
 | 
					            <div className="whitespace-nowrap">{formatMoney(betsPayout)}</div>
 | 
				
			||||||
          </Col>
 | 
					          </Col>
 | 
				
			||||||
        </>
 | 
					        </>
 | 
				
			||||||
      ) : (
 | 
					      ) : (
 | 
				
			||||||
        <>
 | 
					        <>
 | 
				
			||||||
          <Col>
 | 
					          <Col>
 | 
				
			||||||
            <div className="text-sm text-gray-500">
 | 
					            <div className="text-sm text-gray-500 whitespace-nowrap">
 | 
				
			||||||
              Payout if <YesLabel />
 | 
					              Payout if <YesLabel />
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <div>{formatMoney(yesWinnings)}</div>
 | 
					            <div className="whitespace-nowrap">{formatMoney(yesWinnings)}</div>
 | 
				
			||||||
          </Col>
 | 
					          </Col>
 | 
				
			||||||
          <Col>
 | 
					          <Col>
 | 
				
			||||||
            <div className="text-sm text-gray-500">
 | 
					            <div className="text-sm text-gray-500 whitespace-nowrap">
 | 
				
			||||||
              Payout if <NoLabel />
 | 
					              Payout if <NoLabel />
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <div>{formatMoney(noWinnings)}</div>
 | 
					            <div className="whitespace-nowrap">{formatMoney(noWinnings)}</div>
 | 
				
			||||||
          </Col>
 | 
					          </Col>
 | 
				
			||||||
        </>
 | 
					        </>
 | 
				
			||||||
      )}
 | 
					      )}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user