315112459c
* Edit Farsi translations (#788) * Add a Ukrainian translation (#786) * Add a Ukrainian translation * Clarify some strings in the Ukrainian translation * feat: change dock position (#774) * feat: change dock position * fix grid row and column * add top position * fix responsive for the top position * change content side * fix overflowing menu * [improvement] theme on body (#790) * Update Tldraw.tsx * Add theme on body, adjust dark page options dialog * fix test * Preparing for global integration (#775) * Update translations.ts * Create en.json * Make main translation default * Remove unused locale property of translation Co-authored-by: Steve Ruiz <steveruizok@gmail.com> * Fix language menu * Update ar.json (#793) * feature/add Hebrew translations (#792) * hebrew translations * pr fixes Co-authored-by: Steve Ruiz <steveruizok@gmail.com> * fix toolspanel item position (#791) * fix toolspanel item position * add translation Co-authored-by: Steve Ruiz <steveruizok@gmail.com> * Add remote caching * Adds link to translation guide (#794) * Update ar.json (#795) * [feature] readonly link (#796) * Copy readonly link * Update [id].tsx * Add readonly label * update psuedohash * Update utils.ts Co-authored-by: Baahar Ebrahimi <108254874+Baahaarmast@users.noreply.github.com> Co-authored-by: walking-octopus <46994949+walking-octopus@users.noreply.github.com> Co-authored-by: Judicael <46365844+judicaelandria@users.noreply.github.com> Co-authored-by: Ali Alhaidary <75235623+ali-alhaidary@users.noreply.github.com> Co-authored-by: gadi246 <gadi246@gmail.com>
31 lines
870 B
TypeScript
31 lines
870 B
TypeScript
import * as React from 'react'
|
|
import type { GetServerSideProps } from 'next'
|
|
import { getSession } from 'next-auth/react'
|
|
import dynamic from 'next/dynamic'
|
|
import { Utils } from '@tldraw/core'
|
|
const ReadOnlyMultiplayerEditor = dynamic(() => import('components/ReadOnlyMultiplayerEditor'), {
|
|
ssr: false,
|
|
}) as any
|
|
|
|
interface RoomProps {
|
|
id: string
|
|
isSponsor: boolean
|
|
isUser: boolean
|
|
}
|
|
|
|
export default function Room({ id, isUser, isSponsor }: RoomProps) {
|
|
return <ReadOnlyMultiplayerEditor 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: Utils.lns(id),
|
|
isUser: session?.user ? true : false,
|
|
isSponsor: session?.isSponsor ?? false,
|
|
},
|
|
}
|
|
}
|