0c5f8dda48
* remove sponsorwall for main route * Adds sponsorship link * Remove all sponsorwall * Fix sponsorship link appearance on dark mode * Add heart icon * Fix text bug * Fix toolbar, hide resize handles on sticky * Add eraser * Update Kbd.tsx * cleanup * base zoom delta on event deltaMode * Fix image in example * Fix eraser icon * eraser tool resets to previous tool * Update EraseTool.spec.ts * Improves support for locked shapes * Update _document.tsx * Update CHANGELOG.md * Adds multiplayer menu, fix develop route in example * Tighten up top panel padding * Update top bar, bump packages * refactor TLDrawState -> TLDrawApp, mutables, new tests * Fix scaling bug, delete groups bug * fix snapping * add pressure to points * Remove mutables, rename to tldraw (or Tldraw) * Clean up types, add darkmode prop * more renaming * rename getShapeUtils to getShapeUtil * Fix file names * Fix last bugs related to renaming * Update state to app in tests * rename types to TD * remove unused styles / rename styles * slight update to panel * Fix rogue radix perf issue * Update ZoomMenu.tsx * Consolidate style panel * Fix text wrapping in text shape, improve action menu * Fix props * add indicators for tool lock * fix calloits * Add click to erase shapes * Slightly improve loading screen * Update PrimaryTools.tsx * remove force consistent filenames from tsconfig * Update useTldrawApp.tsx * fix capitalization * Update main.yml
34 lines
700 B
TypeScript
34 lines
700 B
TypeScript
import * as React from 'react'
|
|
import type { GetServerSideProps } from 'next'
|
|
import Head from 'next/head'
|
|
|
|
interface RoomProps {
|
|
id?: string
|
|
}
|
|
|
|
export default function RandomRoomPage({ id }: RoomProps): JSX.Element {
|
|
return (
|
|
<>
|
|
<Head>
|
|
<title>Tldraw</title>
|
|
</Head>
|
|
<div>Should have routed to room: {id}</div>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export const getServerSideProps: GetServerSideProps = async (context) => {
|
|
// Generate random id
|
|
const id = Date.now().toString()
|
|
|
|
// Route to a room with that id
|
|
context.res.setHeader('Location', `/r/${id}`)
|
|
context.res.statusCode = 307
|
|
|
|
// Return id (though it shouldn't matter)
|
|
return {
|
|
props: {
|
|
id,
|
|
},
|
|
}
|
|
}
|