Skip to content

Commit a13d576

Browse files
authored
Merge pull request #319 from WeGo-Together/hwanwook-fix/chat-input
[Fix] 채팅 관련 여러가지 에러 수정 작업
2 parents 121ce3c + bbd91a9 commit a13d576

File tree

8 files changed

+16
-9
lines changed

8 files changed

+16
-9
lines changed
File renamed without changes.

src/components/pages/chat/chat-input/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export const ChatInput = ({ onSubmit }: IProps) => {
3838
<div className='relative w-full max-w-110'>
3939
<textarea
4040
ref={inputRef}
41-
className='bg-mono-white text-text-md-medium w-full resize-none rounded-2xl border border-gray-300 px-4 py-4 text-gray-800 placeholder:text-gray-500 focus:outline-none [&::-webkit-scrollbar]:hidden'
41+
className='bg-mono-white text-text-md-medium w-full resize-none rounded-2xl border border-gray-300 px-4 py-4 pr-14 break-words text-gray-800 placeholder:text-gray-500 focus:outline-none [&::-webkit-scrollbar]:hidden'
42+
maxLength={1000}
4243
placeholder='메세지를 입력해주세요.'
4344
rows={1}
4445
value={message}

src/components/pages/chat/chat-list/index.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface IProps {
1919
export const ChatList = ({ userId, accessToken }: IProps) => {
2020
const router = useRouter();
2121
const handleClick = (chatId: number) => {
22-
router.push(`/chat/${chatId}`);
22+
router.push(`/message/chat/${chatId}`);
2323
};
2424
const { data: chatList } = useGetChatList({ userId });
2525

@@ -62,19 +62,25 @@ export const ChatList = ({ userId, accessToken }: IProps) => {
6262
{/* 텍스트 영역 */}
6363
<div className='flex flex-1 flex-col'>
6464
<span className='text-text-md-bold text-gray-800'>{chat.chatRoomName}</span>
65-
<span className={cn('text-text-sm-medium line-clamp-1 text-gray-700')}>
65+
<span
66+
className={cn(
67+
'text-text-sm-medium line-clamp-1 overflow-hidden break-all text-gray-700',
68+
)}
69+
>
6670
{chat.lastMessage ? chat.lastMessage.content : '아직 대화가 없습니다.'}
6771
</span>
6872
</div>
6973

7074
{/* 안 읽은 메시지 수 */}
7175
<span
7276
className={cn(
73-
'text-mono-white text-text-xs-bold rounded-full bg-red-500 px-2 py-0.5',
77+
'text-mono-white text-text-xs-bold bg-mint-500 flex items-center justify-center rounded-full',
7478
chat.unreadCount === 0 && 'opacity-0',
79+
chat.unreadCount < 10 && 'size-6',
80+
chat.unreadCount >= 10 && 'h-6 w-7',
7581
)}
7682
>
77-
{chat.unreadCount > 99 ? '99+' : chat.unreadCount}
83+
{chat.unreadCount > 99 ? '99' : chat.unreadCount}
7884
</span>
7985
</li>
8086
))

src/components/pages/chat/chat-long-text/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const ExpandableText = ({ text, className }: Props) => {
1919
<>
2020
<span
2121
ref={textRef}
22-
className={`line-clamp-20 block whitespace-pre-line text-gray-800 ${className}`}
22+
className={`line-clamp-20 block break-all whitespace-pre-line text-gray-800 ${className}`}
2323
>
2424
{text}
2525
</span>

src/components/pages/chat/chat-modal/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const LongTextModal = ({ text }: { text: string }) => (
77
</div>
88

99
<div className='scrollbar-thin max-h-[70vh] overflow-y-auto px-1'>
10-
<div className='whitespace-pre-line text-gray-800'>{text}</div>
10+
<div className='break-all whitespace-pre-line text-gray-800'>{text}</div>
1111
</div>
1212
</ModalContent>
1313
);

src/components/pages/chat/chat-my-chat/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const MyChat = ({ item }: IProps) => {
1919
</div>
2020

2121
<div className='ml-1.5'>
22-
<div className='bg-mint-200 mt-1 max-w-60 rounded-tl-2xl rounded-tr-sm rounded-br-2xl rounded-bl-2xl px-4 py-3'>
22+
<div className='bg-mint-200 mt-1 max-w-60 rounded-tl-2xl rounded-tr-sm rounded-br-2xl rounded-bl-2xl px-4 py-3 break-words'>
2323
<ExpandableText text={content} />
2424
</div>
2525
</div>

src/components/pages/chat/chat-other-chat/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const OtherChat = ({ item }: IProps) => {
2828
<div className='mr-1.5 max-w-60'>
2929
<span className='text-text-xs-medium text-gray-800'>{senderName}</span>
3030

31-
<div className='bg-mono-white mt-1 rounded-tl-sm rounded-tr-2xl rounded-br-2xl rounded-bl-2xl px-4 py-3'>
31+
<div className='bg-mono-white mt-1 rounded-tl-sm rounded-tr-2xl rounded-br-2xl rounded-bl-2xl px-4 py-3 break-words'>
3232
<ExpandableText text={content} />
3333
</div>
3434
</div>

0 commit comments

Comments
 (0)