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

View File

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