Allow preload of users contracts in profile
This commit is contained in:
parent
f07107ad49
commit
9b6ed518c9
|
@ -341,19 +341,8 @@ export function SearchableGrid(props: {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function CreatorContractsList(props: { creator: User }) {
|
export function CreatorContractsList(props: { contracts: Contract[] }) {
|
||||||
const { creator } = props
|
const { contracts } = props
|
||||||
const [contracts, setContracts] = useState<Contract[] | 'loading'>('loading')
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (creator?.id) {
|
|
||||||
// TODO: stream changes from firestore
|
|
||||||
listContracts(creator.id).then(setContracts)
|
|
||||||
}
|
|
||||||
}, [creator])
|
|
||||||
|
|
||||||
if (contracts === 'loading') return <></>
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SearchableGrid
|
<SearchableGrid
|
||||||
contracts={contracts}
|
contracts={contracts}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user