Show activity feed on Create page
This commit is contained in:
parent
f500cafa46
commit
f63d420521
|
@ -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 ? (
|
||||
<>
|
||||
<Title text="Recent Activity" />
|
||||
<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>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user