24e9be73cc
This reverts commitda0f8df4d7
. Revert "Update package.json" This reverts commit522f87c833
. Revert "removes custom document" This reverts commit00d9146895
. Revert "Remove a dep that may have been causing issues" This reverts commit69462632a5
. Revert "Update index.tsx" This reverts commitd05807bbfb
. Revert "Adds manifest" This reverts commit1c30552643
.
35 lines
867 B
TypeScript
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,
|
|
},
|
|
}
|
|
}
|