tldraw/packages/www/pages/index.tsx
Steve Ruiz 24e9be73cc Let's try that again
This reverts commit da0f8df4d7.

Revert "Update package.json"

This reverts commit 522f87c833.

Revert "removes custom document"

This reverts commit 00d9146895.

Revert "Remove a dep that may have been causing issues"

This reverts commit 69462632a5.

Revert "Update index.tsx"

This reverts commit d05807bbfb.

Revert "Adds manifest"

This reverts commit 1c30552643.
2021-09-04 10:17:10 +01:00

35 lines
867 B
TypeScript

import Head from 'next/head'
import dynamic from 'next/dynamic'
import type { GetServerSideProps } from 'next'
import { getSession } from 'next-auth/client'
const Editor = dynamic(() => import('components/editor'), { ssr: false })
export default function Home(): JSX.Element {
return (
<>
<Head>
<title>tldraw</title>
</Head>
<div style={{ display: 'absolute', zIndex: 1 }}>
<Editor />
</div>
<button style={{ display: 'absolute', zIndex: 9999999 }}>Sign Out</button>
</>
)
}
export const getServerSideProps: GetServerSideProps = async (context) => {
const session = await getSession(context)
if (!session?.user && process.env.NODE_ENV !== 'development') {
context.res.setHeader('Location', `/sponsorware`)
context.res.statusCode = 307
}
return {
props: {
session,
},
}
}