Overnap
Builds for 1 pipeline passed in 8 minutes 11 seconds

username 변경에 맞추어 수정

...@@ -12,7 +12,7 @@ export const UserStatus: React.FC<UserStatusProps> = ({ user }) => { ...@@ -12,7 +12,7 @@ export const UserStatus: React.FC<UserStatusProps> = ({ user }) => {
12 user.ready ? 'text-green-500' : 'text-black'} 12 user.ready ? 'text-green-500' : 'text-black'}
13 text-lg text-center align-middle 13 text-lg text-center align-middle
14 ease-linear transition-all duration-100`}> 14 ease-linear transition-all duration-100`}>
15 - {user.username}</div> 15 + {user.nickname}</div>
16 </div> 16 </div>
17 ) 17 )
18 } 18 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -7,17 +7,14 @@ export interface RoomData { ...@@ -7,17 +7,14 @@ export interface RoomData {
7 7
8 export interface User { 8 export interface User {
9 username: string; 9 username: string;
10 + nickname: string;
10 admin: boolean; 11 admin: boolean;
11 ready: boolean; 12 ready: boolean;
12 } 13 }
13 14
14 export interface UpdateRoomUser { 15 export interface UpdateRoomUser {
15 state: "added" | "updated" | "removed"; 16 state: "added" | "updated" | "removed";
16 - user: { 17 + user: User;
17 - username: string;
18 - admin: boolean;
19 - ready: boolean;
20 - };
21 } 18 }
22 19
23 export interface ChatData { 20 export interface ChatData {
......
...@@ -12,13 +12,13 @@ export const Login: React.FC = () => { ...@@ -12,13 +12,13 @@ export const Login: React.FC = () => {
12 const login = useCallback(() => { 12 const login = useCallback(() => {
13 const rawMessage: RawMessage = { 13 const rawMessage: RawMessage = {
14 type: MessageType.LOGIN, 14 type: MessageType.LOGIN,
15 - message: { username } 15 + message: { nickname: username }
16 } 16 }
17 - socket.emit('msg', rawMessage, (response : MessageResponse<undefined>) => { 17 + socket.emit('msg', rawMessage, (response : MessageResponse<string>) => {
18 if (response.ok) { 18 if (response.ok) {
19 history.push({ 19 history.push({
20 pathname: '/rooms', 20 pathname: '/rooms',
21 - state: { username: username } 21 + state: { username: response.result }
22 }); 22 });
23 } else { 23 } else {
24 console.error('login error!'); // TODO: 팝업 에러? 24 console.error('login error!'); // TODO: 팝업 에러?
......