Show activity feed on Create page
This commit is contained in:
parent
f500cafa46
commit
f63d420521
|
@ -69,16 +69,14 @@ function findActiveContracts(
|
||||||
return contracts
|
return contracts
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ActivityPage() {
|
export function ActivityFeed() {
|
||||||
const contracts = useContracts() || []
|
const contracts = useContracts() || []
|
||||||
const recentComments = useRecentComments() || []
|
const recentComments = useRecentComments() || []
|
||||||
// TODO: Handle static props correctly?
|
// TODO: Handle static props correctly?
|
||||||
const activeContracts = findActiveContracts(contracts, recentComments)
|
const activeContracts = findActiveContracts(contracts, recentComments)
|
||||||
|
return contracts ? (
|
||||||
return (
|
<>
|
||||||
<Page>
|
|
||||||
<Title text="Recent Activity" />
|
<Title text="Recent Activity" />
|
||||||
{contracts ? (
|
|
||||||
<Row className="gap-4">
|
<Row className="gap-4">
|
||||||
<div>
|
<div>
|
||||||
{activeContracts.map((contract) => (
|
{activeContracts.map((contract) => (
|
||||||
|
@ -86,9 +84,16 @@ export default function ActivityPage() {
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</Row>
|
</Row>
|
||||||
|
</>
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
)}
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function ActivityPage() {
|
||||||
|
return (
|
||||||
|
<Page>
|
||||||
|
<ActivityFeed />
|
||||||
</Page>
|
</Page>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import { AdvancedPanel } from '../components/advanced-panel'
|
||||||
import { createContract } from '../lib/firebase/api-call'
|
import { createContract } from '../lib/firebase/api-call'
|
||||||
import { Row } from '../components/layout/row'
|
import { Row } from '../components/layout/row'
|
||||||
import { AmountInput } from '../components/amount-input'
|
import { AmountInput } from '../components/amount-input'
|
||||||
|
import { ActivityFeed } from './activity'
|
||||||
|
|
||||||
// Allow user to create a new contract
|
// Allow user to create a new contract
|
||||||
export default function NewContract() {
|
export default function NewContract() {
|
||||||
|
@ -210,11 +211,9 @@ export default function NewContract() {
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Spacer h={10} />
|
<Spacer h={6} />
|
||||||
|
|
||||||
<Title text="Your markets" />
|
<ActivityFeed />
|
||||||
|
|
||||||
{creator && <CreatorContractsList creator={creator} />}
|
|
||||||
</Page>
|
</Page>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user