Remove tags and date from card.

This commit is contained in:
jahooma 2022-01-05 01:06:30 -06:00
parent 1bc323d575
commit e20537bf49
3 changed files with 36 additions and 25 deletions

View File

@ -27,7 +27,7 @@ export function ContractCard(props: { contract: Contract }) {
probPercent={probPercent} probPercent={probPercent}
/> />
</Row> </Row>
<ContractDetails contract={contract} /> <AbbrContractDetails contract={contract} />
</div> </div>
</div> </div>
</li> </li>
@ -85,23 +85,32 @@ export function ResolutionOrChance(props: {
) )
} }
export function ContractDetails(props: { export function AbbrContractDetails(props: { contract: Contract }) {
contract: Contract const { contract } = props
inlineTags?: boolean const { truePool } = compute(contract)
}) {
const { contract, inlineTags } = props return (
<Col className={clsx('text-sm text-gray-500 gap-2')}>
<Row className="gap-2 flex-wrap">
<div className="whitespace-nowrap">
<UserLink username={contract.creatorUsername} />
</div>
<div className=""></div>
<div className="whitespace-nowrap">{formatMoney(truePool)} pool</div>
</Row>
</Col>
)
}
export function ContractDetails(props: { contract: Contract }) {
const { contract } = props
const { question, description } = contract const { question, description } = contract
const { truePool, createdDate, resolvedDate } = compute(contract) const { truePool, createdDate, resolvedDate } = compute(contract)
const tags = parseTags(`${question} ${description}`).map((tag) => `#${tag}`) const tags = parseTags(`${question} ${description}`).map((tag) => `#${tag}`)
return ( return (
<Col <Col className="text-sm text-gray-500 gap-2 sm:flex-row sm:flex-wrap">
className={clsx(
'text-sm text-gray-500 gap-2',
inlineTags && 'sm:flex-row sm:flex-wrap'
)}
>
<Row className="gap-2 flex-wrap"> <Row className="gap-2 flex-wrap">
<div className="whitespace-nowrap"> <div className="whitespace-nowrap">
<UserLink username={contract.creatorUsername} /> <UserLink username={contract.creatorUsername} />
@ -114,9 +123,9 @@ export function ContractDetails(props: {
<div className="whitespace-nowrap">{formatMoney(truePool)} pool</div> <div className="whitespace-nowrap">{formatMoney(truePool)} pool</div>
</Row> </Row>
{inlineTags && tags.length > 0 && ( {tags.length > 0 && (
<>
<div className="hidden sm:block"></div> <div className="hidden sm:block"></div>
)}
<Row className="gap-2 flex-wrap"> <Row className="gap-2 flex-wrap">
{tags.map((tag) => ( {tags.map((tag) => (
@ -125,6 +134,8 @@ export function ContractDetails(props: {
</div> </div>
))} ))}
</Row> </Row>
</>
)}
</Col> </Col>
) )
} }

View File

@ -67,7 +67,7 @@ export const ContractOverview = (props: {
large large
/> />
<ContractDetails contract={contract} inlineTags /> <ContractDetails contract={contract} />
<TweetButton tweetText={tweetText} /> <TweetButton tweetText={tweetText} />
</Col> </Col>

View File

@ -2,8 +2,8 @@ import { getFirestore } from '@firebase/firestore'
import { initializeApp } from 'firebase/app' import { initializeApp } from 'firebase/app'
// TODO: Reenable this when we have a way to set the Firebase db in dev // TODO: Reenable this when we have a way to set the Firebase db in dev
export const isProd = process.env.NODE_ENV === 'production' // export const isProd = process.env.NODE_ENV === 'production'
// export const isProd = true export const isProd = true
const firebaseConfig = isProd const firebaseConfig = isProd
? { ? {