Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강동현
/
nodejs-game
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Overnap
2021-05-31 04:02:59 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c841fd41d1aa4a622d3c708219a6adde88a4f841
c841fd41
1 parent
4222f9f1
폴더 구조 변경
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
web/src/Footer.tsx → web/src/components/common/Footer.tsx
web/src/SocketContext.ts → web/src/contexts/SocketContext.ts
web/src/Login.tsx → web/src/pages/Login.tsx
web/src/Rooms.tsx → web/src/pages/Rooms.tsx
web/src/Footer.tsx
→
web/src/
components/common/
Footer.tsx
View file @
c841fd4
File moved
web/src/SocketContext.ts
→
web/src/
contexts/
SocketContext.ts
View file @
c841fd4
File moved
web/src/Login.tsx
→
web/src/
pages/
Login.tsx
View file @
c841fd4
import React, { useContext, useState } from 'react';
import { RouteComponentProps } from 'react-router';
import { Footer } from './Footer';
import
{ MessageResponse } from './Message
';
import SocketContext from './SocketContext';
import { Footer } from '.
./components/common
/Footer';
import
type { MessageResponse } from '../components/common/types
';
import SocketContext from '.
.
/SocketContext';
export const Login: React.FC<RouteComponentProps> = ({ history }) => {
const socket = useContext(SocketContext);
...
...
web/src/Rooms.tsx
→
web/src/
pages/
Rooms.tsx
View file @
c841fd4
import React, { useContext, useEffect, useState } from 'react';
import { RouteComponentProps } from 'react-router';
import
{ MessageResponse, MessageType } from './Message
';
import SocketContext from './SocketContext';
import
type { MessageResponse, MessageType } from '../components/common/types
';
import SocketContext from '.
./contexts
/SocketContext';
interface Room {
uuid: string;
...
...
@@ -15,7 +15,7 @@ export const Rooms: React.FC<RouteComponentProps> = ({ history }) => {
const [ rooms, setRooms ] = useState<Room[]>([]);
const refreshRooms = () => {
socket.emit(
MessageType.ROOM_LIST_REQUEST
, (response: MessageResponse<Room[]>) => {
socket.emit(
"room_list_request"
, (response: MessageResponse<Room[]>) => {
if (response.ok) {
setRooms(response.result!);
} else {
...
...
Please
register
or
login
to post a comment