2022-08-16 01:47:58 +00:00
|
|
|
import { Contract, getTrendingContracts } from 'web/lib/firebase/contracts'
|
2022-05-09 13:04:36 +00:00
|
|
|
import { Page } from 'web/components/page'
|
2022-06-13 16:19:46 +00:00
|
|
|
import { LandingPagePanel } from 'web/components/landing-page-panel'
|
2022-05-09 13:04:36 +00:00
|
|
|
import { Col } from 'web/components/layout/col'
|
|
|
|
import { ManifoldLogo } from 'web/components/nav/manifold-logo'
|
2022-07-19 07:50:11 +00:00
|
|
|
import { redirectIfLoggedIn } from 'web/lib/firebase/server-auth'
|
2022-07-21 19:43:10 +00:00
|
|
|
import { useSaveReferral } from 'web/hooks/use-save-referral'
|
2022-07-22 17:01:52 +00:00
|
|
|
import { SEO } from 'web/components/SEO'
|
2021-12-01 04:20:13 +00:00
|
|
|
|
2022-07-19 07:50:11 +00:00
|
|
|
export const getServerSideProps = redirectIfLoggedIn('/home', async (_) => {
|
2022-08-16 01:34:45 +00:00
|
|
|
const hotContracts = await getTrendingContracts()
|
2022-07-19 07:50:11 +00:00
|
|
|
return { props: { hotContracts } }
|
|
|
|
})
|
2022-01-15 00:16:25 +00:00
|
|
|
|
2022-07-19 07:50:11 +00:00
|
|
|
export default function Home(props: { hotContracts: Contract[] }) {
|
2022-01-23 00:16:23 +00:00
|
|
|
const { hotContracts } = props
|
2022-07-20 08:59:14 +00:00
|
|
|
|
2022-07-21 19:43:10 +00:00
|
|
|
useSaveReferral()
|
|
|
|
|
2022-01-12 03:56:11 +00:00
|
|
|
return (
|
2022-06-13 04:42:41 +00:00
|
|
|
<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!"
|
|
|
|
/>
|
2022-04-04 05:45:23 +00:00
|
|
|
<div className="px-4 pt-2 md:mt-0 lg:hidden">
|
|
|
|
<ManifoldLogo />
|
|
|
|
</div>
|
2022-01-21 18:33:58 +00:00
|
|
|
<Col className="items-center">
|
|
|
|
<Col className="max-w-3xl">
|
2022-06-13 16:19:46 +00:00
|
|
|
<LandingPagePanel hotContracts={hotContracts ?? []} />
|
2022-01-21 18:33:58 +00:00
|
|
|
</Col>
|
|
|
|
</Col>
|
2022-01-12 03:56:11 +00:00
|
|
|
</Page>
|
2022-01-05 06:32:52 +00:00
|
|
|
)
|
2021-12-17 04:44:48 +00:00
|
|
|
}
|