Add simple bets page

This commit is contained in:
jahooma 2021-12-17 17:07:08 -06:00
parent 03a3df261c
commit 112a42406e
2 changed files with 27 additions and 1 deletions

View File

@ -44,7 +44,8 @@ export function BetsList(props: { user: User }) {
return <></>
}
if (bets.length === 0) return <div>You have not made any bets yet!</div>
if (bets.length === 0)
return <div className="text-gray-500">You have not made any bets yet!</div>
// Decending creation time.
bets.sort((bet1, bet2) => bet2.createdTime - bet1.createdTime)

25
web/pages/bets.tsx Normal file
View File

@ -0,0 +1,25 @@
import { BetsList } from '../components/bets-list'
import { Header } from '../components/header'
import { SEO } from '../components/SEO'
import { Title } from '../components/title'
import { User } from '../lib/firebase/users'
export default function BetsPage(props: { user: User; currentUser?: User }) {
const { user } = props
return (
<div>
<SEO title="Your bets" description="Your bets" url="/bets" />
<Header />
<div className="max-w-4xl pt-8 pb-0 sm:pb-8 mx-auto">
<div>
<Title text="Your bets" />
<BetsList user={user} />
</div>
</div>
</div>
)
}