manifold/web/pages/index.tsx

38 lines
1.2 KiB
TypeScript
Raw Normal View History

2022-08-16 01:47:58 +00:00
import { Contract, getTrendingContracts } from 'web/lib/firebase/contracts'
import { Page } from 'web/components/page'
2022-06-13 16:19:46 +00:00
import { LandingPagePanel } from 'web/components/landing-page-panel'
import { Col } from 'web/components/layout/col'
import { ManifoldLogo } from 'web/components/nav/manifold-logo'
import { redirectIfLoggedIn } from 'web/lib/firebase/server-auth'
import { useSaveReferral } from 'web/hooks/use-save-referral'
2022-07-22 17:01:52 +00:00
import { SEO } from 'web/components/SEO'
export const getServerSideProps = redirectIfLoggedIn('/home', async (_) => {
const hotContracts = await getTrendingContracts()
return { props: { hotContracts } }
})
export default function Home(props: { hotContracts: Contract[] }) {
2022-01-23 00:16:23 +00:00
const { hotContracts } = props
useSaveReferral()
return (
<Page>
2022-07-22 17:01:52 +00:00
<SEO
title="Manifold Markets"
description="Create a play-money prediction market on any topic you care about
and bet with your friends on what will happen!"
/>
<div className="px-4 pt-2 md:mt-0 lg:hidden">
<ManifoldLogo />
</div>
<Col className="items-center">
<Col className="max-w-3xl">
2022-06-13 16:19:46 +00:00
<LandingPagePanel hotContracts={hotContracts ?? []} />
</Col>
</Col>
</Page>
2022-01-05 06:32:52 +00:00
)
}