Fix type errors
This commit is contained in:
parent
f2748db21d
commit
5c7a8e52c9
|
@ -27,6 +27,7 @@ export async function createContract(question: string, description: string, init
|
||||||
|
|
||||||
seedAmounts: { YES: seedYes, NO: seedNo },
|
seedAmounts: { YES: seedYes, NO: seedNo },
|
||||||
pot: { YES: seedYes, NO: seedNo },
|
pot: { YES: seedYes, NO: seedNo },
|
||||||
|
isResolved: false,
|
||||||
|
|
||||||
// TODO: Set create time to Firestore timestamp
|
// TODO: Set create time to Firestore timestamp
|
||||||
createdTime: Date.now(),
|
createdTime: Date.now(),
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import { firebaseLogin, firebaseLogout, User } from '../lib/firebase/users'
|
import { firebaseLogin, firebaseLogout, User } from '../lib/firebase/users'
|
||||||
import { Header } from '../components/header'
|
import { Header } from '../components/header'
|
||||||
import { useUser } from '../hooks/use-user'
|
import { useUser } from '../hooks/use-user'
|
||||||
import { useState, useEffect } from 'react'
|
|
||||||
import { Contract, listContracts } from '../lib/firebase/contracts'
|
|
||||||
import { ContractsList } from '../components/contracts-list'
|
import { ContractsList } from '../components/contracts-list'
|
||||||
import { Title } from '../components/title'
|
import { Title } from '../components/title'
|
||||||
import { Row } from '../components/layout/row'
|
import { Row } from '../components/layout/row'
|
||||||
|
@ -60,13 +58,6 @@ function SignInCard() {
|
||||||
|
|
||||||
export default function Account() {
|
export default function Account() {
|
||||||
const user = useUser()
|
const user = useUser()
|
||||||
const [contracts, setContracts] = useState<Contract[]>([])
|
|
||||||
useEffect(() => {
|
|
||||||
console.log('Fetching contracts', user?.id)
|
|
||||||
if (user?.id) {
|
|
||||||
listContracts(user?.id).then(setContracts)
|
|
||||||
}
|
|
||||||
}, [user?.id])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
@ -76,7 +67,7 @@ export default function Account() {
|
||||||
<div>
|
<div>
|
||||||
<UserCard user={user} />
|
<UserCard user={user} />
|
||||||
<Title className="px-2" text="Your markets" />
|
<Title className="px-2" text="Your markets" />
|
||||||
<ContractsList contracts={contracts} />
|
<ContractsList />
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<SignInCard />
|
<SignInCard />
|
||||||
|
|
Loading…
Reference in New Issue
Block a user