tldraw/apps/www/pages/index.tsx
Steve Ruiz 7c2777966f
[improvement] Multiplayer + cursors (#457)
* bump versions, improve cursors

* Spline cursors
2021-12-22 00:14:38 +00:00

33 lines
767 B
TypeScript

import dynamic from 'next/dynamic'
import type { GetServerSideProps } from 'next'
import { getSession } from 'next-auth/react'
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: session?.user ? true : false,
isSponsor: session?.isSponsor,
},
}
}