Overnap
Builds for 1 pipeline passed in 8 minutes 11 seconds

username 변경에 맞추어 수정

......@@ -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.username}</div>
{user.nickname}</div>
</div>
)
}
\ No newline at end of file
......
......@@ -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 {
......
......@@ -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: 팝업 에러?
......