-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 채팅 페이지 리디자인 #252
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
Merged
The head ref may contain hidden characters: "248-feat-\uCC44\uD305\uBC29-\uB9AC\uB514\uC790\uC778-\uBC18\uC601"
Merged
feat: 채팅 페이지 리디자인 #252
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4b78bd9
feat: 채팅 페이지 리디자인
ParkSungju01 6752257
Merge branch 'develop' into 248-feat-채팅방-리디자인-반영
ParkSungju01 ac3012e
fix:tailwind 문법 수정
ParkSungju01 80eb846
fix: 코드 수정
ParkSungju01 d81b9a7
fix: 폰트 색상 및 위치 수정
ParkSungju01 5703d9a
fix: 채팅방 사람수 정렬
ParkSungju01 d170fe3
fix: 오타 수정
ParkSungju01 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
25 changes: 25 additions & 0 deletions
25
src/components/layout/Header/components/ChatListHeader.tsx
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,25 @@ | ||
| import AddCircle from '@/assets/svg/add_circle.svg'; | ||
| import ChevronLeftIcon from '@/assets/svg/chevron-left.svg'; | ||
| import Search from '@/assets/svg/search.svg'; | ||
| import { useSmartBack } from '@/utils/hooks/useSmartBack'; | ||
|
|
||
| export default function ChatListHeader() { | ||
| const smartBack = useSmartBack(); | ||
|
|
||
| return ( | ||
| <header className="fixed top-0 right-0 left-0 z-30 flex h-13 items-center justify-center rounded-b-3xl bg-white px-4 py-2"> | ||
| <button type="button" aria-label="뒤로가기" onClick={smartBack} className="shrink-0"> | ||
| <ChevronLeftIcon /> | ||
| </button> | ||
| <span className="px-2 py-4 font-semibold">채팅방</span> | ||
| <div className="ml-auto flex items-center gap-2"> | ||
| <button type="button" aria-label="검색" className="shrink-0"> | ||
| <Search /> | ||
| </button> | ||
| <button type="button" aria-label="채팅방 추가" className="shrink-0"> | ||
| <AddCircle /> | ||
| </button> | ||
| </div> | ||
| </header> | ||
| ); | ||
| } | ||
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
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
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 |
|---|---|---|
|
|
@@ -4,7 +4,6 @@ import type { Advertisement } from '@/apis/advertisement/entity'; | |
| import type { Room } from '@/apis/chat/entity'; | ||
| import BellOffIcon from '@/assets/svg/bell-off.svg'; | ||
| import PersonIcon from '@/assets/svg/person.svg'; | ||
| import BottomOverlaySpacer from '@/components/layout/BottomOverlaySpacer'; | ||
| import { useAdvertisementInterval } from '@/utils/hooks/useAdvertisementInterval'; | ||
| import { useAdvertisements } from '@/utils/hooks/useAdvertisements'; | ||
| import useChat from './hooks/useChat'; | ||
|
|
@@ -91,8 +90,12 @@ function ChatRoomListItem({ room, itemRef }: ChatRoomListItemProps) { | |
|
|
||
| {hasUnreadMessage && ( | ||
| <span className="shrink-0"> | ||
| <span aria-hidden="true" className="bg-primary-500 block size-2 rounded-full" /> | ||
| <span className="sr-only">{`읽지 않은 메시지 ${room.unreadCount}개`}</span> | ||
| <span | ||
| aria-hidden="true" | ||
| className="bg-primary-500 flex h-4 min-w-5 items-center justify-center rounded-full px-1 py-0.5 text-[10px] text-white" | ||
| > | ||
| {room.unreadCount > 300 ? '300+' : room.unreadCount} | ||
| </span> | ||
|
Comment on lines
+93
to
+98
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 읽지 않은 메시지 수를 스크린리더에도 노출해주세요. Line 97에 예시 수정 {hasUnreadMessage && (
<span className="shrink-0">
+ <span className="sr-only">읽지 않은 메시지 {room.unreadCount > 300 ? '300+' : room.unreadCount}개</span>
<span
aria-hidden="true"
className="bg-primary-500 flex h-4 min-w-5 items-center justify-center rounded-full px-1 py-0.5 text-[10px] text-white"
>🤖 Prompt for AI Agents |
||
| </span> | ||
| )} | ||
| </div> | ||
|
|
@@ -193,30 +196,31 @@ function ChatListPage() { | |
| } | ||
|
|
||
| return ( | ||
| <div className="flex min-h-full flex-col bg-white py-3"> | ||
| {rooms.map((room, index) => { | ||
| const shouldRenderAdvertisement = | ||
| chatRoomSlotsPerAdvertisement !== null && (index + 1) % chatRoomSlotsPerAdvertisement === 0; | ||
| const advertisement = shouldRenderAdvertisement | ||
| ? advertisements[Math.floor(index / chatRoomSlotsPerAdvertisement)] | ||
| : undefined; | ||
|
|
||
| return ( | ||
| <Fragment key={room.roomId}> | ||
| <ChatRoomListItem | ||
| room={room} | ||
| itemRef={index === 0 ? firstChatRoomItemRef : index === 1 ? secondChatRoomItemRef : undefined} | ||
| /> | ||
| {advertisement && ( | ||
| <ChatAdvertisementListItem advertisement={advertisement} onClick={trackAdvertisementClick} /> | ||
| )} | ||
| {!advertisement && shouldRenderAdvertisement && isLoadingAdvertisements && ( | ||
| <ChatAdvertisementListItemSkeleton /> | ||
| )} | ||
| </Fragment> | ||
| ); | ||
| })} | ||
| <BottomOverlaySpacer gap={24} /> | ||
| <div className="flex min-h-full min-w-full flex-col overflow-y-auto bg-gray-100 px-5 py-[23px]"> | ||
| <div className="h-full [&>*:first-child]:rounded-t-2xl [&>*:last-child]:rounded-b-lg"> | ||
| {rooms.map((room, index) => { | ||
| const shouldRenderAdvertisement = | ||
| chatRoomSlotsPerAdvertisement !== null && (index + 1) % chatRoomSlotsPerAdvertisement === 0; | ||
| const advertisement = shouldRenderAdvertisement | ||
| ? advertisements[Math.floor(index / chatRoomSlotsPerAdvertisement)] | ||
| : undefined; | ||
|
|
||
| return ( | ||
| <Fragment key={room.roomId}> | ||
| <ChatRoomListItem | ||
| room={room} | ||
| itemRef={index === 0 ? firstChatRoomItemRef : index === 1 ? secondChatRoomItemRef : undefined} | ||
| /> | ||
| {advertisement && ( | ||
| <ChatAdvertisementListItem advertisement={advertisement} onClick={trackAdvertisementClick} /> | ||
| )} | ||
| {!advertisement && shouldRenderAdvertisement && isLoadingAdvertisements && ( | ||
| <ChatAdvertisementListItemSkeleton /> | ||
| )} | ||
| </Fragment> | ||
| ); | ||
| })} | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.