Remove some random unnecessary wrapper divs (#163)

* Remove wrapper div in user comment feed item

* Remove wrapper div around feed market card title link

* Remove wrapper div around BetRow
This commit is contained in:
Marshall Polaris 2022-05-09 15:50:20 -07:00 committed by GitHub
parent ef43e46153
commit d34907681a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 82 additions and 87 deletions

View File

@ -1,4 +1,5 @@
import { useState } from 'react' import { useState } from 'react'
import clsx from 'clsx'
import { BetPanelSwitcher } from './bet-panel' import { BetPanelSwitcher } from './bet-panel'
import { Row } from './layout/row' import { Row } from './layout/row'
@ -30,48 +31,46 @@ export default function BetRow(props: {
return ( return (
<> <>
<div className={className}> <Row className={clsx('mt-2 justify-end space-x-3', className)}>
<Row className="mt-2 justify-end space-x-3"> {/* <div className={clsx('mr-2 text-gray-400', labelClassName)}>
{/* <div className={clsx('mr-2 text-gray-400', labelClassName)}> Place a trade
Place a trade </div> */}
</div> */} <YesNoSelector
<YesNoSelector btnClassName="btn-sm w-24"
btnClassName="btn-sm w-24" onSelect={(choice) => {
onSelect={(choice) => { setOpen(true)
setOpen(true) setBetChoice(choice)
setBetChoice(choice) }}
}} replaceNoButton={
replaceNoButton={ yesFloorShares > 0 ? (
yesFloorShares > 0 ? ( <SellButton
<SellButton contract={contract}
contract={contract} user={user}
user={user} sharesOutcome={'YES'}
sharesOutcome={'YES'} shares={yesShares}
shares={yesShares} />
/> ) : undefined
) : undefined }
} replaceYesButton={
replaceYesButton={ noFloorShares > 0 ? (
noFloorShares > 0 ? ( <SellButton
<SellButton contract={contract}
contract={contract} user={user}
user={user} sharesOutcome={'NO'}
sharesOutcome={'NO'} shares={noShares}
shares={noShares} />
/> ) : undefined
) : undefined }
} />
/> </Row>
</Row> <Modal open={open} setOpen={setOpen}>
<Modal open={open} setOpen={setOpen}> <BetPanelSwitcher
<BetPanelSwitcher contract={contract}
contract={contract} title={contract.question}
title={contract.question} selected={betChoice}
selected={betChoice} onBetSuccess={() => setOpen(false)}
onBetSuccess={() => setOpen(false)} />
/> </Modal>
</Modal>
</div>
</> </>
) )
} }

View File

@ -166,43 +166,41 @@ export function FeedComment(props: {
avatarUrl={userAvatarUrl} avatarUrl={userAvatarUrl}
/> />
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<div> <p className="mt-0.5 text-sm text-gray-500">
<p className="mt-0.5 text-sm text-gray-500"> <UserLink
<UserLink className="text-gray-500"
className="text-gray-500" username={userUsername}
username={userUsername} name={userName}
name={userName} />{' '}
/>{' '} {!matchedBet && userPosition > 0 && (
{!matchedBet && userPosition > 0 && ( <>
{'had ' + userPositionMoney + ' '}
<> <>
{'had ' + userPositionMoney + ' '} {' of '}
<> <OutcomeLabel
{' of '} outcome={yesFloorShares > noFloorShares ? 'YES' : 'NO'}
<OutcomeLabel contract={contract}
outcome={yesFloorShares > noFloorShares ? 'YES' : 'NO'} truncate="short"
contract={contract} />
truncate="short" </>
/> </>
</> )}
<>
{bought} {money}
{outcome && !hideOutcome && (
<>
{' '}
of{' '}
<OutcomeLabel
outcome={outcome ? outcome : ''}
contract={contract}
truncate="short"
/>
</> </>
)} )}
<> </>
{bought} {money} <RelativeTimestamp time={createdTime} />
{outcome && !hideOutcome && ( </p>
<>
{' '}
of{' '}
<OutcomeLabel
outcome={outcome ? outcome : ''}
contract={contract}
truncate="short"
/>
</>
)}
</>
<RelativeTimestamp time={createdTime} />
</p>
</div>
<TruncatedComment <TruncatedComment
comment={text} comment={text}
moreHref={contractPath(contract)} moreHref={contractPath(contract)}
@ -555,17 +553,15 @@ export function FeedQuestion(props: {
</div> </div>
</div> </div>
<Col className="items-start justify-between gap-2 sm:flex-row sm:gap-4"> <Col className="items-start justify-between gap-2 sm:flex-row sm:gap-4">
<Col> <SiteLink
<SiteLink href={
href={ props.contractPath ? props.contractPath : contractPath(contract)
props.contractPath ? props.contractPath : contractPath(contract) }
} onClick={() => trackClick(contract.id)}
onClick={() => trackClick(contract.id)} className="text-lg text-indigo-700 sm:text-xl"
className="text-lg text-indigo-700 sm:text-xl" >
> {question}
{question} </SiteLink>
</SiteLink>
</Col>
{isBinary && ( {isBinary && (
<BinaryResolutionOrChance <BinaryResolutionOrChance
className="items-center" className="items-center"