-
Notifications
You must be signed in to change notification settings - Fork 3
채팅 기능 구현 #49
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
Open
xo-yeon
wants to merge
22
commits into
dev
Choose a base branch
from
feature/chat
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
채팅 기능 구현 #49
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
44c0271
fix: 파티 생성 페이지 헤더 css 수정 및 센터 변경 문제 수정
xo-yeon 4c6993f
fix: 파티 생성 후 이동 경로 수정
xo-yeon 339cab3
feature: 채팅 관련 api 적용 작업중 중간 커밋
xo-yeon 0c51699
파티 유저 강퇴 api 추가
xo-yeon a1d3391
페이지네이션 적용 및 api 수정
xo-yeon 4681803
채팅방 페이지에서 하단 탭 적용
xo-yeon 4fefb39
채팅 메시지 사용자 타입별 ui 수정
xo-yeon 47d1ed5
검색 기능 추가
xo-yeon 7593f7a
토큰 체크 추가
xo-yeon 8b4668c
비로그인 시 alert 뜬 후 이동 되도록 수정
xo-yeon 30ef846
코드 정리
xo-yeon dcfb762
fix: getlayout 제거
xo-yeon 322b31b
fix: 네이밍 변경 및 alt 추가
xo-yeon ecc9c52
fix: 파티 생성 페이지 수정중
xo-yeon ffc7fa8
refactor: 파티 코드 수정
xo-yeon ca473b9
fix: 헤더에 뒤로가기 추가
xo-yeon f36a93d
chore: 불필요한 코드 정리
xo-yeon 6199e45
refactor: chat hook 생성
xo-yeon f582397
feat: 파티 및 채팅 ui 수정
xo-yeon 3261cb1
feat: 채팅방 invalidate 추가
xo-yeon d085540
refactor: chat 리팩토링
xo-yeon acfb54e
fix: ui 수정 및 리팩토링
xo-yeon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,51 +1,27 @@ | ||
| import BottomInputGroup from "@components/chat/BottomInputGroup"; | ||
| import HeaderBtnGroup from "@components/chat/HeaderBtnGroup"; | ||
| import MessageList from "@components/chat/MessageList"; | ||
| import styled from "@emotion/styled"; | ||
| import { ReactElement, MouseEvent, useState } from "react"; | ||
|
|
||
| const Wrapper = styled.div({ | ||
| display: "flex", | ||
| flexDirection: "column", | ||
| justifyContent: "space-between", | ||
| height: "100vh", | ||
| }); | ||
|
|
||
| const Contents = styled.main({ | ||
| display: "flex", | ||
| flexDirection: "column", | ||
| justifyContent: "flex-end", | ||
| }); | ||
|
|
||
| const ChattingRoom = () => { | ||
| const [isOpenUserList, setIsOpenUserList] = useState(false); | ||
|
|
||
| const handleCloseUserList = (e: MouseEvent<HTMLDivElement>) => { | ||
| e.stopPropagation(); | ||
| setIsOpenUserList(false); | ||
| }; | ||
|
|
||
| const handleOpenUserList = (e: MouseEvent<HTMLButtonElement>) => { | ||
| e.stopPropagation(); | ||
| setIsOpenUserList(true); | ||
| }; | ||
|
|
||
| return ( | ||
| <Wrapper onClick={handleCloseUserList}> | ||
| <HeaderBtnGroup | ||
| isOpenUserList={isOpenUserList} | ||
| handleOpenUserList={handleOpenUserList} | ||
| /> | ||
| <Contents> | ||
| <MessageList /> | ||
| <BottomInputGroup /> | ||
| </Contents> | ||
| </Wrapper> | ||
| ); | ||
| }; | ||
|
|
||
| ChattingRoom.getLayout = (page: ReactElement) => { | ||
| return <>{page}</>; | ||
| import { GetServerSideProps } from 'next'; | ||
| import QuerySuspenseErrorBoundary from '@components/hoc/QuerySuspenseErrorBoundary'; | ||
| import ChatRoom from '@components/chat/room/ChatRoom'; | ||
| import ProfileLoading from '@components/profile/ProfileLoading'; | ||
| import ChatProvider from '@contexts/ChatProvider'; | ||
|
|
||
| interface ChatRoomPageProps { | ||
| roomId: number; | ||
| } | ||
|
|
||
| const ChatRoomPage = ({ roomId }: ChatRoomPageProps) => ( | ||
| <ChatProvider roomId={roomId}> | ||
| <QuerySuspenseErrorBoundary suspenseFallback={<ProfileLoading />}> | ||
| <ChatRoom /> | ||
| </QuerySuspenseErrorBoundary> | ||
| </ChatProvider> | ||
| ); | ||
|
|
||
| export default ChatRoomPage; | ||
|
|
||
| export const getServerSideProps: GetServerSideProps = async ({ params }) => { | ||
| const { id: roomId } = params as { id: string }; | ||
|
|
||
| return { | ||
| props: { roomId: Number(roomId) }, | ||
| }; | ||
| }; | ||
|
|
||
| export default ChattingRoom; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import styled from '@emotion/styled'; | ||
| import { NextPage } from 'next'; | ||
| import { DefaultHeader } from '@components/common/DefaultHeader'; | ||
| import { DefaultText } from '@components/common/DefaultText'; | ||
| import QuerySuspenseErrorBoundary from '@components/hoc/QuerySuspenseErrorBoundary'; | ||
| import ChatList from '@components/chat/list/ChatList'; | ||
|
|
||
| const Wrapper = styled.div` | ||
| margin: 0 auto; | ||
| padding: 45px 0 75px 0; | ||
| height: 100%; | ||
| min-height: calc(100vh); | ||
| max-width: 760px; | ||
| min-width: 320px; | ||
| `; | ||
|
|
||
| const NotList = styled.div` | ||
| text-align: center; | ||
| padding: 10rem; | ||
| font-size: 3vw; | ||
| `; | ||
|
|
||
| const ChatListPage: NextPage = () => ( | ||
| <Wrapper> | ||
| <DefaultHeader centerArea={<DefaultText text="채팅방" size={17} weight={700} />} /> | ||
| <QuerySuspenseErrorBoundary | ||
| errorFallback={() => <NotList>참여중인 방이 없습니다.</NotList>} | ||
| > | ||
| <ChatList /> | ||
| </QuerySuspenseErrorBoundary> | ||
| </Wrapper> | ||
| ); | ||
|
|
||
| export default ChatListPage; | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
서버 단에서 전부 응답이 400이나 500이나 참여중인 방이 없으면 똑같은 건가요?