-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] chat 탭 UI 구현 #194
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
Merged
[Feat] chat 탭 UI 구현 #194
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,81 @@ | ||
| 'use client'; | ||
| import Image from 'next/image'; | ||
|
|
||
| import { DEFAULT_PROFILE_IMAGE } from 'constants/default-images'; | ||
|
|
||
| import { cn } from '@/lib/utils'; | ||
|
|
||
| const dummy = [ | ||
| { | ||
| id: 1, | ||
| name: '토끼조아', | ||
| message: '안녕하세요. 저는 토끼조아입니다 반가워요 혹시 어디 사시나요?', | ||
| messageCount: 8, | ||
| }, | ||
| { | ||
| id: 2, | ||
| name: '바다소년', | ||
| message: '클라이밍 모임 하시나요?', | ||
| messageCount: 12, | ||
| }, | ||
| { | ||
| id: 3, | ||
| name: '흰둥이', | ||
| message: '월월', | ||
| messageCount: 1, | ||
| }, | ||
| { | ||
| id: 4, | ||
| name: '여행자', | ||
| message: '안녕하세요 여행자입니다.', | ||
| messageCount: 0, | ||
| }, | ||
| { | ||
| id: 5, | ||
| name: '한별', | ||
| message: '고생하셨습니다', | ||
| messageCount: 0, | ||
| }, | ||
| ]; | ||
|
|
||
| export const Chat = () => { | ||
| return <>채팅 컴포넌트</>; | ||
| return ( | ||
| <ul className='flex flex-col'> | ||
| {dummy.map((item) => ( | ||
| <li | ||
| key={item.id} | ||
| className='flex cursor-pointer items-center gap-3 bg-white p-5 transition hover:bg-gray-50' | ||
| > | ||
| {/* 프로필 이미지 */} | ||
| <div className='relative size-12 overflow-hidden rounded-full'> | ||
| <Image | ||
| className='object-cover' | ||
| alt='프로필 이미지' | ||
| fill | ||
| loading='eager' | ||
| src={DEFAULT_PROFILE_IMAGE} | ||
| /> | ||
| </div> | ||
|
|
||
| {/* 텍스트 영역 */} | ||
| <div className='flex flex-1 flex-col'> | ||
| <span className='text-text-md-bold text-gray-800'>{item.name}</span> | ||
| <span className={cn('text-text-sm-medium line-clamp-1 text-gray-700')}> | ||
| {item.message} | ||
| </span> | ||
| </div> | ||
|
|
||
| {/* 안 읽은 메시지 수 */} | ||
| <span | ||
| className={cn( | ||
| 'text-mono-white text-text-xs-bold rounded-full bg-red-500 px-2 py-0.5', | ||
| item.messageCount === 0 && 'opacity-0', | ||
| )} | ||
| > | ||
| {item.messageCount > 99 ? '99+' : item.messageCount} | ||
| </span> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| ); | ||
| }; | ||
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
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.
이미지는 ImageWithFallback 컴포넌트를 사용해주시면 됩니당