From f63d420521924a9a9821a9bce6bb436a68cbc511 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Tue, 11 Jan 2022 11:51:05 -0500 Subject: [PATCH] Show activity feed on Create page --- web/pages/activity.tsx | 31 ++++++++++++++++++------------- web/pages/create.tsx | 7 +++---- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/web/pages/activity.tsx b/web/pages/activity.tsx index fa742408..4feb494c 100644 --- a/web/pages/activity.tsx +++ b/web/pages/activity.tsx @@ -69,26 +69,31 @@ function findActiveContracts( return contracts } -export default function ActivityPage() { +export function ActivityFeed() { const contracts = useContracts() || [] const recentComments = useRecentComments() || [] // TODO: Handle static props correctly? const activeContracts = findActiveContracts(contracts, recentComments) + return contracts ? ( + <> + + <Row className="gap-4"> + <div> + {activeContracts.map((contract) => ( + <FeedCard contract={contract} /> + ))} + </div> + </Row> + </> + ) : ( + <></> + ) +} +export default function ActivityPage() { return ( <Page> - <Title text="Recent Activity" /> - {contracts ? ( - <Row className="gap-4"> - <div> - {activeContracts.map((contract) => ( - <FeedCard contract={contract} /> - ))} - </div> - </Row> - ) : ( - <></> - )} + <ActivityFeed /> </Page> ) } diff --git a/web/pages/create.tsx b/web/pages/create.tsx index f431a37e..7e00191b 100644 --- a/web/pages/create.tsx +++ b/web/pages/create.tsx @@ -14,6 +14,7 @@ import { AdvancedPanel } from '../components/advanced-panel' import { createContract } from '../lib/firebase/api-call' import { Row } from '../components/layout/row' import { AmountInput } from '../components/amount-input' +import { ActivityFeed } from './activity' // Allow user to create a new contract export default function NewContract() { @@ -210,11 +211,9 @@ export default function NewContract() { </form> </div> - <Spacer h={10} /> + <Spacer h={6} /> - <Title text="Your markets" /> - - {creator && <CreatorContractsList creator={creator} />} + <ActivityFeed /> </Page> ) }