Skip to content

Commit 26b1519

Browse files
committed
adds styling for conversation
1 parent d3f83b0 commit 26b1519

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

client/app/(protected)/(main)/messages/page.tsx

+14-17
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,20 @@ const MessagesPage = () => {
2929
}, []);
3030

3131
return (
32-
<div>
33-
<h1>Messages</h1>
34-
<div>
35-
{chatrooms.map((chatroom) => {
36-
console.log("chatroom: ", chatroom);
37-
return (
38-
<Conversation
39-
key={chatroom.chatroomId}
40-
chatroomId={chatroom.chatroomId}
41-
username={chatroom.username}
42-
display_name={chatroom.display_name}
43-
profile_avatar={chatroom.profile_avatar}
44-
lastMessageSentAt={chatroom.lastMessageSentAt}
45-
/>
46-
);
47-
})}
48-
</div>
32+
<div className="m-4 flex flex-col gap-4">
33+
{chatrooms.map((chatroom) => {
34+
console.log("chatroom: ", chatroom);
35+
return (
36+
<Conversation
37+
key={chatroom.chatroomId}
38+
chatroomId={chatroom.chatroomId}
39+
username={chatroom.username}
40+
display_name={chatroom.display_name}
41+
profile_avatar={chatroom.profile_avatar}
42+
lastMessageSentAt={chatroom.lastMessageSentAt}
43+
/>
44+
);
45+
})}
4946
</div>
5047
);
5148
};

client/components/Conversation.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,16 @@ export const Conversation = ({
4848
};
4949

5050
return (
51-
<Link href={`/${username}/${chatroomId}`} onClick={handleStartMessage}>
52-
<Avatar url={profile_avatar} type="conversation" />
53-
<div>
51+
<Link
52+
href={`/${username}/${chatroomId}`}
53+
onClick={handleStartMessage}
54+
className="flex text-center text-text-white font-semibold border-b border-surface shadow-md justify-between gap-2 hover:border-primary-500 transition duration-300 p-4"
55+
>
56+
<div className="flex items-center gap-4">
57+
<Avatar url={profile_avatar} type="conversation" />
5458
<p>{display_name}</p>
55-
<p>{formatTime(lastMessageSentAt)}</p>
5659
</div>
60+
<p>{formatTime(lastMessageSentAt)}</p>
5761
</Link>
5862
);
5963
};

0 commit comments

Comments
 (0)