e2814943e9
* [feature] grids * Shows relative grids at different zoom levels * Update colors * Restores vec and intersect to monorepo, changes vec.round to vec.toFixed, adds vec.snap * Snapping in translate and transforms, fix shortcut * fix bugs in build * use grid size for nudge too * update scripts * Update grid.tsx * Update grid.tsx * Fixed! * Update grid.tsx * Fix package imports * Update Editor.tsx * Improve tsconfigs, imports * Fix tiny arrow bugs, snap starting points to grid * Update tsconfig.base.json * Update shape-styles.ts * Fix example tsconfig * Fix translate type error * Fix types, paths Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
29 lines
800 B
TypeScript
29 lines
800 B
TypeScript
import * as React from 'react'
|
|
import type { GetServerSideProps } from 'next'
|
|
import { getSession } from 'next-auth/client'
|
|
import dynamic from 'next/dynamic'
|
|
const MultiplayerEditor = dynamic(() => import('components/MultiplayerEditor'), { ssr: false })
|
|
|
|
interface RoomProps {
|
|
id: string
|
|
isSponsor: boolean
|
|
isUser: boolean
|
|
}
|
|
|
|
export default function Room({ id, isUser, isSponsor }: RoomProps): JSX.Element {
|
|
return <MultiplayerEditor isUser={isUser} isSponsor={isSponsor} roomId={id} />
|
|
}
|
|
|
|
export const getServerSideProps: GetServerSideProps = async (context) => {
|
|
const session = await getSession(context)
|
|
|
|
const id = context.query.id?.toString()
|
|
|
|
return {
|
|
props: {
|
|
id,
|
|
isUser: session?.user ? true : false,
|
|
isSponsor: session?.user ? true : false,
|
|
},
|
|
}
|
|
}
|