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-10 00:00:23 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
53d88c2bbec326b98a2c131d416496cbc85b1fd6
53d88c2b
1 parent
009b3157
Builds for 1 pipeline
passed
in 8 minutes 11 seconds
username 변경에 맞추어 수정
Changes
3
Builds
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
web/src/components/room/UserStatus.tsx
web/src/components/room/types.ts
web/src/pages/Login.tsx
web/src/components/room/UserStatus.tsx
View file @
53d88c2
...
...
@@ -12,7 +12,7 @@ export const UserStatus: React.FC<UserStatusProps> = ({ user }) => {
user.ready ? 'text-green-500' : 'text-black'}
text-lg text-center align-middle
ease-linear transition-all duration-100`}>
{user.
user
name}</div>
{user.
nick
name}</div>
</div>
)
}
\ No newline at end of file
...
...
web/src/components/room/types.ts
View file @
53d88c2
...
...
@@ -7,17 +7,14 @@ export interface RoomData {
export
interface
User
{
username
:
string
;
nickname
:
string
;
admin
:
boolean
;
ready
:
boolean
;
}
export
interface
UpdateRoomUser
{
state
:
"added"
|
"updated"
|
"removed"
;
user
:
{
username
:
string
;
admin
:
boolean
;
ready
:
boolean
;
};
user
:
User
;
}
export
interface
ChatData
{
...
...
web/src/pages/Login.tsx
View file @
53d88c2
...
...
@@ -12,13 +12,13 @@ export const Login: React.FC = () => {
const login = useCallback(() => {
const rawMessage: RawMessage = {
type: MessageType.LOGIN,
message: { username }
message: {
nickname:
username }
}
socket.emit('msg', rawMessage, (response : MessageResponse<
undefined
>) => {
socket.emit('msg', rawMessage, (response : MessageResponse<
string
>) => {
if (response.ok) {
history.push({
pathname: '/rooms',
state: { username:
username
}
state: { username:
response.result
}
});
} else {
console.error('login error!'); // TODO: 팝업 에러?
...
...
Please
register
or
login
to post a comment