-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
대기실 페이지 2차 작업 #114
base: dev
Are you sure you want to change the base?
대기실 페이지 2차 작업 #114
Conversation
- add, reset 함수도 추가 - 선택을 완료한 플레이어들의 이름을 저장한다.
- 게임 시작 시 UserInfoCard 색상 원래대로 변경
…pHi/grouphi-mvp-fe into GRPHI-133-feat/WaitingRoomSocket2
- handleEnterNextRound로 함수 통합 - useEffect문에 if문 추가
- api 폴더 생성 및 기존 roomDetail 훅 이동
- 중복 로직 쿼리로 통합 - refetch 이용해 쿼리 데이터 업데이트 - 다음 라운드 이동 시 쿼리 데이터 삭제
- 겹치는 로직 하나로 통일 - 쿼리 불필요해져서 다시 삭제
- page가 너무 커져서 분리
- 추후에 새로운 게임 추가되면 그에 맞춰 변경 될 예정 - UserList section 디자인 이관
- 변경 후 방 상세조회 시 바뀐 이름으로 유저가 새로 생기는 문제 발생하므로 해결 필요
…into GRPHI-133-feat/WaitingRoomSocket2
…into GRPHI-133-feat/WaitingRoomSocket2
<div className="fixed w-full h-screen -z-10"> | ||
<StarsBackground /> | ||
<ShootingStars /> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[기록용] 별똥별 배경이 다른 컴포넌트 위로 올라오는 이슈 수정
/> | ||
{votes1 !== 0 && ( | ||
<BarItem | ||
className={clsx('bg-primary', votes2 === 0 && 'rounded-r-full')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clsx 사용보다 cn 유틸함수
를 사용해보는 건 어떨까요? cn 유틸함수는 clsx, twMerge를 조합한 함수입니다.
clsx
는 조건부 className을 하나로 합쳐주는 역할입니다.twMerge
는 중복되거나 불필요한 TailwindCSS className을 제거하여 최적화합니다.
setChatMessages(() => [ | ||
{ | ||
sender: SOCKET.SYSTEM, | ||
content: '게임이 종료되었습니다.', | ||
}, | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
디테일 좋아요! 👍
case SOCKET.TYPE.ERROR: | ||
toast({ | ||
variant: 'destructive', | ||
title: '문제가 생겼습니다. 다시 시도해주세요.', | ||
}); | ||
router.push(PATH.HOME); | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
에러 챙겨주셔서 감사합니다👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!
플레이어 전원 선택 시 바로 결과창으로 넘어가는 로직 추가
아이디어가 좋다고 생각합니다!
그런데 우려되는 점은 무의미한 선택하면서 고민하는 사람도 있을 것 같다는 생각이 들어요. 선택은 바꿀 수 있으니까요. 타이머가 있으니 충분히 고민할 시간을 주고, 방장에게만 모두 선택 시 결과로 가는 버튼을 보여주는 건 어떨까요? 채팅이 있으니 팀원 간에 소통도 가능하구요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨어요 현주님! 리뷰 내용 한 번 봐주세요~~
const handleEnterNextRound = async () => { | ||
sendMessage({ | ||
destination: `${SOCKET.ENDPOINT.BALANCE_GAME.NEXT}`, | ||
}); | ||
}; | ||
|
||
const handleMoveToWaitingRoom = () => { | ||
sendMessage({ | ||
destination: `${SOCKET.ENDPOINT.BALANCE_GAME.END}`, | ||
}); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3;
async 키워드가 사용되지 않아도 되는 곳에 붙어있는 것 같습니다.
만약 client.current?.publish 로직을 사용하는데에 async 키워드가 필요하다면 통일해주시면 좋을 것 같아요~
/> | ||
{votes2 !== 0 && ( | ||
<BarItem | ||
className={clsx('bg-secondary', votes1 === 0 && 'rounded-l-full')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
36번쨰 줄 리뷰와 동일합니다.
)} | ||
{players.map((data, index) => ( | ||
<UserInfoCard | ||
key={index} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1;
생각해보니 키값으로 인덱스를 사용해도 괜찮을까요? 유저 목록의 변동이 잦은 경우, 잘못된 값을 재사용할 가능성이 존재할 것 같다고 느껴지는데 어떻게 생각하시나요?
📝작업 내용
이슈 내역
📷스크린샷(필요 시)
2025-02-04.9.29.12.mov
전원 선택 시 바로 결과 창으로 이동한다.
2025-02-04.9.34.12.mov
게임 종료 시 채팅창을 초기화 한다.
✨PR Point