Skip to content

Commit fcfed4d

Browse files
committed
Routing and Lobby
1 parent a588ce5 commit fcfed4d

File tree

5 files changed

+33
-7
lines changed

5 files changed

+33
-7
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"typescript.preferences.quoteStyle": "single",
33
"editor.formatOnSave": true,
4-
"files.eol": "\n"
4+
"files.eol": "\n",
5+
"nuxt.isNuxtApp": false
56
}

src/components/Ring.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ export default function Ring() {
88
if (isHovered) {
99
return (
1010
<div
11-
className="my-10 border-4 rounded-full w-80 h-80 shadow-yellow-200 shadow-2xl bg-yellow-200 border-yellow-200 transition-all"
11+
className="mt-2 mb-5 border-4 rounded-full w-80 h-80 shadow-yellow-200 shadow-2xl bg-yellow-200 border-yellow-200 transition-all"
1212
onMouseEnter={onMouseEnter}
1313
onMouseLeave={onMouseLeave}
1414
></div>
1515
);
1616
} else
1717
return (
1818
<div
19-
className="my-10 border-4 border-yellow-300 rounded-full w-80 h-80 transition-all"
19+
className="mt-2 mb-5 border-4 border-yellow-300 rounded-full w-80 h-80 transition-all"
2020
onMouseEnter={onMouseEnter}
2121
onMouseLeave={onMouseLeave}
2222
></div>

src/components/Room.tsx renamed to src/components/RoomForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function createRoom(){
99
}
1010

1111

12-
function Room() {
12+
function RoomForm() {
1313

1414
return (
1515
<>
@@ -22,4 +22,4 @@ function Room() {
2222
)
2323
}
2424

25-
export default Room
25+
export default RoomForm

src/pages/[keycode].tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from 'react'
2+
3+
import { useRouter } from 'next/router';
4+
import Link from 'next/link';
5+
6+
import Ring from '../components/Ring'
7+
8+
function Lobby() {
9+
const router = useRouter();
10+
const { keycode } = router.query;
11+
12+
return (
13+
<>
14+
<div className="flex flex-col w-full h-screen items-center justify-center bg-slate-800">
15+
<h1 className="text-5xl text-yellow-300">Light Touch</h1>
16+
<div className="text-2xl text-yellow-300">{ keycode }</div>
17+
18+
<Ring />
19+
<Link href="/"><a className="button">Leave</a></Link>
20+
</div>
21+
</>
22+
)
23+
}
24+
25+
export default Lobby

src/pages/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import Ring from "../components/Ring";
2-
import Room from '../components/Room'
2+
import RoomForm from '../components/RoomForm'
33

44
export default function Home() {
55
return (
66
<div className="flex flex-col w-full h-screen items-center justify-center bg-slate-800">
77
<h1 className="text-5xl text-yellow-300">Light Touch</h1>
88
<Ring />
9-
<Room />
9+
<RoomForm />
1010
</div>
1111
);
1212
}

0 commit comments

Comments
 (0)