1
- import React , { useState } from "react" ;
1
+ import React from "react" ;
2
2
import styled from "styled-components" ;
3
- import { useSocketEvent } from "../hooks/useSocketEvent" ;
4
3
import { SessionIdPayload } from "../../backend/interface" ;
5
- import { useSocket } from "../SocketContext" ;
6
4
import { CreateSessionSection } from "./CreateSessionSection" ;
7
5
import { JoinSessionSection } from "./JoinSessionSection" ;
8
6
@@ -12,9 +10,8 @@ interface Props {
12
10
}
13
11
14
12
export const CreateOrJoinPage : React . FC < Props > = ( { setSessionId } ) => {
15
- const [ name , setName ] = useState < string > ( "" ) ;
16
- console . log ( "Create or join page" ) ;
17
- const socket = useSocket ( ) ;
13
+ // const [name, setName] = useState<string>("");
14
+ // const socket = useSocket();
18
15
19
16
const sessionIdReceivedFromBackend = ( { sessionId } : SessionIdPayload ) => {
20
17
document . location . hash = `sessionId=${ sessionId } ` ;
@@ -25,7 +22,7 @@ export const CreateOrJoinPage: React.FC<Props> = ({ setSessionId }) => {
25
22
< Container >
26
23
< h1 > Create a new room or join an existing one</ h1 >
27
24
< h2 > Who are you? So the group can recognize you.</ h2 >
28
- < TextInput type = "text" onChange = { ( e ) => setName ( e . target . value ) } />
25
+ < TextInput type = "text" />
29
26
< Space />
30
27
< CreateSessionSection
31
28
setSessionId = { ( sessionId ) => {
0 commit comments