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-06-09 21:29:32 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ef87b297deb096c41d7bff01128e5cd67fffa71a
ef87b297
1 parent
383a197f
Refresh 컴포넌트 추가 및 Rooms에 적용
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
web/src/components/rooms/Refrsh.tsx
web/src/pages/Rooms.tsx
web/src/components/rooms/Refrsh.tsx
0 → 100644
View file @
ef87b29
import React from 'react';
interface RefreshProps {
refreshRooms: () => void
}
export const Refresh: React.FC<RefreshProps> = ({ refreshRooms }) => {
return (
<button className="bg-green-500 active:bg-green-600
text-white uppercase text-xl
w-10 h-8 pb-0.5 ml-3 rounded shadow round
outline-none focus:outline-none hover:shadow-md
ease-linear transition-all duration-100"
type="button"
onClick={() => refreshRooms()}>⟳</button>
);
}
web/src/pages/Rooms.tsx
View file @
ef87b29
...
...
@@ -2,6 +2,7 @@ import React, { useCallback, useContext, useEffect, useState } from 'react';
import { useHistory } from 'react-router';
import { Main } from '../components/common/Main';
import { MessageResponse, MessageType, RawMessage } from '../components/common/types';
import { Refresh } from '../components/rooms/Refrsh';
import { RoomBlock } from '../components/rooms/RoomBlock';
import { Room } from '../components/rooms/types';
import SocketContext from '../contexts/SocketContext';
...
...
@@ -30,6 +31,9 @@ export const Rooms: React.FC = () => {
return (
<Main>
<div className='mt-8'>
<Refresh refreshRooms={refreshRooms}/>
</div>
<div className='mt-auto w-screen flex flex-col items-center'>
{rooms.map((room) => (<RoomBlock key={room.uuid} room={room} />))}
</div>
...
...
Please
register
or
login
to post a comment