import { Contract, getContractsBySlugs } from 'web/lib/firebase/contracts' import { Page } from 'web/components/page' 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' import { SEO } from 'web/components/SEO' import { useUser } from 'web/hooks/use-user' import { useEffect } from 'react' import { useRouter } from 'next/router' export const getServerSideProps = redirectIfLoggedIn('/home', async (_) => { // These hardcoded markets will be shown in the frontpage for signed-out users: const hotContracts = await getContractsBySlugs([ 'will-max-go-to-prom-with-a-girl', 'will-ethereum-switch-to-proof-of-st', 'will-russia-control-the-majority-of', 'will-elon-musk-buy-twitter-this-yea', 'will-trump-be-charged-by-the-grand', 'will-spacex-launch-a-starship-into', 'who-will-win-the-nba-finals-champio', 'who-will-be-time-magazine-person-of', 'will-congress-hold-any-hearings-abo-e21f987033b3', 'will-at-least-10-world-cities-have', ]) return { props: { hotContracts } } }) export default function Home(_props: { hotContracts: Contract[] }) { useSaveReferral() const user = useUser() const router = useRouter() useEffect(() => { if (user) { // Redirect to the /home page if the user is logged in. router.push('/home') } }, [user, router]) return (
{/*

View{' '} all markets

*/}
) }