tldraw/apps/www/pages/index.tsx
Steve Ruiz e6a3e5c3ea
[big chore] restore core to monorepo (#287)
* move core into repo, apps into apps folder, update tests

* Update scripts for build:core

* improve scripts

* remove noise from www

* Update .gitignore

* Fix focus bug

* add ci test script

* Update main.yml
2021-11-18 13:09:18 +00:00

33 lines
751 B
TypeScript

import dynamic from 'next/dynamic'
import { GetServerSideProps } from 'next'
import { getSession } from 'next-auth/client'
import Head from 'next/head'
const Editor = dynamic(() => import('-components/Editor'), { ssr: false })
interface PageProps {
isUser: boolean
isSponsor: boolean
}
export default function Home({ isUser, isSponsor }: PageProps): JSX.Element {
return (
<>
<Head>
<title>tldraw</title>
</Head>
<Editor id="home" isUser={isUser} isSponsor={isSponsor} />
</>
)
}
export const getServerSideProps: GetServerSideProps = async (context) => {
const session = await getSession(context)
return {
props: {
isUser: false,
isSponsor: session?.user ? true : false,
},
}
}