diff --git a/web/components/contract-feed.tsx b/web/components/contract-feed.tsx index c6f31d1a..584b8e45 100644 --- a/web/components/contract-feed.tsx +++ b/web/components/contract-feed.tsx @@ -29,8 +29,8 @@ import { createComment } from '../lib/firebase/comments' import { useComments } from '../hooks/use-comments' import { formatMoney } from '../lib/util/format' import { ResolutionOrChance } from './contract-card' -import Link from 'next/link' import { SiteLink } from './site-link' +import { Col } from './layout/col' dayjs.extend(relativeTime) function FeedComment(props: { activityItem: any }) { @@ -149,6 +149,8 @@ export function ContractDescription(props: { setDescription(editStatement()) } + if (!isCreator && !contract.description.trim()) return null + return (
@@ -213,12 +215,15 @@ function FeedQuestion(props: { contract: Contract }) {
-
+
{contract.creatorName} asked{' '}
- - + + {contract.question} - +
diff --git a/web/pages/activity.tsx b/web/pages/activity.tsx index 4feb494c..24340ef0 100644 --- a/web/pages/activity.tsx +++ b/web/pages/activity.tsx @@ -1,17 +1,17 @@ import _ from 'lodash' import { ContractFeed } from '../components/contract-feed' -import { Row } from '../components/layout/row' import { Page } from '../components/page' import { Title } from '../components/title' import { useRecentComments } from '../hooks/use-comments' import { useContracts } from '../hooks/use-contracts' import { Contract } from '../lib/firebase/contracts' import { Comment } from '../lib/firebase/comments' +import { Col } from '../components/layout/col' function FeedCard(props: { contract: Contract }) { const { contract } = props return ( -
+
) @@ -74,16 +74,14 @@ export function ActivityFeed() { const recentComments = useRecentComments() || [] // TODO: Handle static props correctly? const activeContracts = findActiveContracts(contracts, recentComments) - return contracts ? ( + return contracts.length > 0 ? ( <> - <Row className="gap-4"> - <div> - {activeContracts.map((contract) => ( - <FeedCard contract={contract} /> - ))} - </div> - </Row> + <Col className="gap-4"> + {activeContracts.map((contract) => ( + <FeedCard contract={contract} /> + ))} + </Col> </> ) : ( <></> diff --git a/web/pages/create.tsx b/web/pages/create.tsx index 7e00191b..13c1a98d 100644 --- a/web/pages/create.tsx +++ b/web/pages/create.tsx @@ -4,7 +4,6 @@ import clsx from 'clsx' import dayjs from 'dayjs' import Textarea from 'react-expanding-textarea' -import { CreatorContractsList } from '../components/contracts-list' import { Spacer } from '../components/layout/spacer' import { Title } from '../components/title' import { useUser } from '../hooks/use-user' @@ -84,7 +83,7 @@ export default function NewContract() { <Page> <Title text="Create a new prediction market" /> - <div className="w-full bg-gray-100 rounded-lg shadow-md px-6 py-4"> + <div className="w-full max-w-3xl bg-gray-100 rounded-lg shadow-md px-6 py-4"> {/* Create a Tailwind form that takes in all the fields needed for a new contract */} {/* When the form is submitted, create a new contract in the database */} <form>