Add ids to title on multiplayer rooms

This commit is contained in:
Steve Ruiz 2022-09-02 07:32:35 +01:00
parent 9dab372b81
commit 5c396b3253
2 changed files with 18 additions and 2 deletions

View file

@ -1,5 +1,6 @@
import type { GetServerSideProps } from 'next' import type { GetServerSideProps } from 'next'
import dynamic from 'next/dynamic' import dynamic from 'next/dynamic'
import Head from 'next/head'
import * as React from 'react' import * as React from 'react'
const IFrameWarning = dynamic(() => import('~components/IFrameWarning'), { const IFrameWarning = dynamic(() => import('~components/IFrameWarning'), {
@ -19,7 +20,14 @@ export default function Room({ id }: RoomProps) {
return <IFrameWarning url={`https://tldraw.com/r/${id}`} /> return <IFrameWarning url={`https://tldraw.com/r/${id}`} />
} }
return <MultiplayerEditor roomId={id} /> return (
<>
<Head>
<title>tldraw - {id}</title>
</Head>
<MultiplayerEditor roomId={id} />
</>
)
} }
export const getServerSideProps: GetServerSideProps = async (context) => { export const getServerSideProps: GetServerSideProps = async (context) => {

View file

@ -1,6 +1,7 @@
import { Utils } from '@tldraw/core' import { Utils } from '@tldraw/core'
import type { GetServerSideProps } from 'next' import type { GetServerSideProps } from 'next'
import dynamic from 'next/dynamic' import dynamic from 'next/dynamic'
import Head from 'next/head'
import * as React from 'react' import * as React from 'react'
const IFrameWarning = dynamic(() => import('~components/IFrameWarning'), { const IFrameWarning = dynamic(() => import('~components/IFrameWarning'), {
@ -20,7 +21,14 @@ export default function Room({ id }: RoomProps) {
return <IFrameWarning url={`https://tldraw.com/v/${id}`} /> return <IFrameWarning url={`https://tldraw.com/v/${id}`} />
} }
return <ReadOnlyMultiplayerEditor roomId={id} /> return (
<>
<Head>
<title>tldraw - {id} (read only)</title>
</Head>
<ReadOnlyMultiplayerEditor roomId={id} />
</>
)
} }
export const getServerSideProps: GetServerSideProps = async (context) => { export const getServerSideProps: GetServerSideProps = async (context) => {