From b15bf6658fe6c9f42b8cc246112fb1a2940b3836 Mon Sep 17 00:00:00 2001 From: jinhyo Date: Sun, 19 Apr 2026 09:07:27 +0900 Subject: [PATCH 01/12] =?UTF-8?q?=F0=9F=90=9B=20Fix:=20=EC=B1=84=ED=8C=85?= =?UTF-8?q?=ED=95=98=EA=B8=B0=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=EB=90=9C=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=EB=A7=8C=20=EC=A0=91=EA=B7=BC=20?= =?UTF-8?q?=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84=EB=A1=9D=20(#372)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProfilePage/components/ProfileCard.tsx | 9 ++++++++- .../components/PromptAuthorAndReview.tsx | 20 ++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/pages/ProfilePage/components/ProfileCard.tsx b/src/pages/ProfilePage/components/ProfileCard.tsx index 9234a1c5..8f9c4aa7 100644 --- a/src/pages/ProfilePage/components/ProfileCard.tsx +++ b/src/pages/ProfilePage/components/ProfileCard.tsx @@ -94,6 +94,13 @@ const ProfileCard = ({ mypage }: ProfileCardProps) => { }); }; + // 채팅하기 로그인 관련 + const handleChatting = () => { + handleShowLoginModal(() => { + openChatRoom(member_id); + }); + }; + const normalizedFollowerList: FollowerWithStatus[] = followerData?.data.map((f) => ({ ...f, @@ -215,7 +222,7 @@ const ProfileCard = ({ mypage }: ProfileCardProps) => { {!isMyProfile && !isAdmin && (
- openChatRoom(member_id)} /> + { + handleShowLoginModal(() => { + openChatRoom(member_id); + }); + }; + return (
{/* 작성자 프로필 카드 */} @@ -318,8 +325,8 @@ const PromptAuthorAndReview = ({
@@ -413,6 +420,9 @@ const PromptAuthorAndReview = ({
{showModal && setShowModal(false)} size="lg" />} + {loginModalShow && ( + setLoginModalShow(false)} onClick={() => {}} /> + )}
); }; From 5205a4005c31cc7fc1d586969c9f490fb35e2667 Mon Sep 17 00:00:00 2001 From: jinhyo Date: Sun, 19 Apr 2026 09:26:09 +0900 Subject: [PATCH 02/12] =?UTF-8?q?=E2=9C=A8=20Feat:=20=EC=B4=88=EA=B8=B0=20?= =?UTF-8?q?=EB=A0=8C=EB=8D=94=EB=A7=81=EC=8B=9C=20=EC=B5=9C=EC=B4=88=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=20=EC=B1=84=ED=8C=85=20=EB=9C=A8?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20(#372)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Navbar/Navbar.tsx | 4 ++-- src/pages/ChatPage/ChatPage.tsx | 17 +++++++++++++++-- src/pages/ChatPage/components/ChatList.tsx | 4 +++- src/pages/ChatPage/components/ChatListItem.tsx | 9 +++++++-- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/components/Navbar/Navbar.tsx b/src/components/Navbar/Navbar.tsx index 529a0347..687def25 100644 --- a/src/components/Navbar/Navbar.tsx +++ b/src/components/Navbar/Navbar.tsx @@ -139,8 +139,8 @@ const Navbar = () => { src={data?.data.has_unread_messages ? MessageIcon : MessageIcon} alt="메세지 알림" className="self-center max-phone:w-[16px] max-phone:h-[16px]" - // onClick={() => navigate('/chat')} - onClick={() => setIsMessageModalShow((prev) => !prev)} + onClick={() => navigate('/chat')} + // onClick={() => setIsMessageModalShow((prev) => !prev)} /> { const [selectedRoomId, setSelectedRoomId] = useState(null); const isTablet = window.innerWidth < 1024; + const { data } = useGetInfiniteChatRooms({ limit: 20 }); // 채팅 목록 조회 + + useEffect(() => { + const latestRoomId = data?.pages?.[0]?.data?.rooms?.[0].room_id; + + if (latestRoomId) { + setSelectedRoomId(latestRoomId); + } + }, [data]); + return (
{(!isTablet || selectedRoomId === null) && ( @@ -13,7 +24,9 @@ const ChatPage = () => { )}
- {(!isTablet || selectedRoomId === null) && } + {(!isTablet || selectedRoomId === null) && ( + + )} {(!isTablet || selectedRoomId !== null) && }
diff --git a/src/pages/ChatPage/components/ChatList.tsx b/src/pages/ChatPage/components/ChatList.tsx index e7c7e80d..1b1f1326 100644 --- a/src/pages/ChatPage/components/ChatList.tsx +++ b/src/pages/ChatPage/components/ChatList.tsx @@ -7,6 +7,7 @@ import { useNavigate } from 'react-router-dom'; interface ChatListProps { setSelectedRoomId: (roomId: number) => void; + selectedRoomId: number; } type ActiveButton = { @@ -21,7 +22,7 @@ const BUTTONS: ActiveButton[] = [ { id: 3, label: '고정된 메시지', filter: 'pinned' }, ]; -const ChatList = ({ setSelectedRoomId }: ChatListProps) => { +const ChatList = ({ setSelectedRoomId, selectedRoomId }: ChatListProps) => { const [search, setSearch] = useState(''); const [activeButton, setActiveButton] = useState(BUTTONS[0]); const isTablet = window.innerWidth < 1024; @@ -81,6 +82,7 @@ const ChatList = ({ setSelectedRoomId }: ChatListProps) => { last_message={list.last_message} unread_count={list.unread_count} is_pinned={list.is_pinned} + is_clicked={list.room_id === selectedRoomId} onClick={() => { if (isTablet) { navigate(`/chat/${list.room_id}`); diff --git a/src/pages/ChatPage/components/ChatListItem.tsx b/src/pages/ChatPage/components/ChatListItem.tsx index 2e80c9c4..5f604d81 100644 --- a/src/pages/ChatPage/components/ChatListItem.tsx +++ b/src/pages/ChatPage/components/ChatListItem.tsx @@ -1,5 +1,6 @@ import formatDate from '@/utils/formatDate'; import Default from '@assets/icon-profile-image-default.svg'; +import clsx from 'clsx'; interface ChatListItemProps { partner: { @@ -13,16 +14,20 @@ interface ChatListItemProps { }; unread_count: number; is_pinned: boolean; + is_clicked: boolean; onClick: () => void; } -const ChatListItem = ({ partner, last_message, unread_count, onClick }: ChatListItemProps) => { +const ChatListItem = ({ partner, last_message, unread_count, is_clicked, onClick }: ChatListItemProps) => { const { month, day } = formatDate(last_message.sent_at); return (
+ className={clsx( + 'p-[16px] flex gap-[16px] items-center lg:max-w-[317px] w-full cursor-pointer hover:bg-background rounded-[8px]', + is_clicked && 'bg-background', + )}>
Date: Sun, 19 Apr 2026 09:38:37 +0900 Subject: [PATCH 03/12] =?UTF-8?q?=E2=9C=A8=20Feat:=20=EC=B1=84=ED=8C=85=20?= =?UTF-8?q?=EC=8B=9C=EA=B0=84=20=EC=B6=94=EA=B0=80=20(#372)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ChatPage/components/ChatBubble.tsx | 17 +++++++++++++++-- src/pages/ChatPage/components/ChattingRoom.tsx | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/pages/ChatPage/components/ChatBubble.tsx b/src/pages/ChatPage/components/ChatBubble.tsx index e757242f..ae40dc0d 100644 --- a/src/pages/ChatPage/components/ChatBubble.tsx +++ b/src/pages/ChatPage/components/ChatBubble.tsx @@ -12,15 +12,28 @@ interface ChatBubbleProps { files: Attachment[]; isMine: boolean; popup?: boolean; + date: string; } -const ChatBubble = ({ text, files, isMine, popup }: ChatBubbleProps) => { +const ChatBubble = ({ text, files, isMine, popup, date }: ChatBubbleProps) => { const [preview, setPreview] = useState(null); const [selected, setSelected] = useState(null); const hasFile = files.some((file) => file.type === 'FILE'); + const formatTime = (date: string) => { + const d = new Date(date); + + return new Intl.DateTimeFormat('ko-KR', { + hour: '2-digit', + minute: '2-digit', + hour12: true, + }).format(d); + }; + return ( -
+
+
{formatTime(date)}
+
))}
From 0cf893ad10f50c8684566d5395a414d405077b02 Mon Sep 17 00:00:00 2001 From: jinhyo Date: Sat, 16 May 2026 17:31:43 +0900 Subject: [PATCH 04/12] =?UTF-8?q?=F0=9F=92=84=20Design:=20=EB=82=A0?= =?UTF-8?q?=EC=A7=9C=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20=ED=81=AC=EA=B8=B0=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#406)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ChatPage/components/ChattingRoom.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ChatPage/components/ChattingRoom.tsx b/src/pages/ChatPage/components/ChattingRoom.tsx index 334133b2..1baa43d4 100644 --- a/src/pages/ChatPage/components/ChattingRoom.tsx +++ b/src/pages/ChatPage/components/ChattingRoom.tsx @@ -487,7 +487,7 @@ const ChattingRoom = ({ selectedRoomId, className, popup }: ChattingRoomProps) = {/* 날짜 */}
-
{`${year}.${month}.${day}(${dayOfWeek})`}
+
{`${year}.${month}.${day}(${dayOfWeek})`}
From d6cf5265a503a458c03a1c1b5faaea55e1b49e2c Mon Sep 17 00:00:00 2001 From: jinhyo Date: Sat, 16 May 2026 17:34:34 +0900 Subject: [PATCH 05/12] =?UTF-8?q?=F0=9F=92=84=20Design:=20=EC=B1=84?= =?UTF-8?q?=ED=8C=85=EC=B0=BD=20=ED=95=98=EB=8B=A8=20=EC=9E=85=EB=A0=A5?= =?UTF-8?q?=EB=B0=95=EC=8A=A4=20pt=20=EC=B6=94=EA=B0=80=20(#406)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ChatPage/components/ChattingRoom.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/ChatPage/components/ChattingRoom.tsx b/src/pages/ChatPage/components/ChattingRoom.tsx index 1baa43d4..224bece8 100644 --- a/src/pages/ChatPage/components/ChattingRoom.tsx +++ b/src/pages/ChatPage/components/ChattingRoom.tsx @@ -487,7 +487,7 @@ const ChattingRoom = ({ selectedRoomId, className, popup }: ChattingRoomProps) = {/* 날짜 */}
-
{`${year}.${month}.${day}(${dayOfWeek})`}
+
{`${year}.${month}.${day}(${dayOfWeek})`}
@@ -511,8 +511,8 @@ const ChattingRoom = ({ selectedRoomId, className, popup }: ChattingRoomProps) = {/* 입력창 */} -
-
+
+
{/* 파일 선택 */}