Skip to content

Commit a51afc0

Browse files
committed
Display initial 25 characters of last message in the message list.
1 parent 0479ce2 commit a51afc0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/RoomCard/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ const RoomCard = ({ room, onClickAction }: RoomCardProps) => {
147147
{!isLastMessageBySelfUser && room.groupName
148148
? `${room.lastMessage?.user.name}: `
149149
: ""}
150-
{room.lastMessage?.text}
150+
{room.lastMessage?.text &&
151+
room.lastMessage.text.slice(0, 25) +
152+
(room.lastMessage.text.length > 25 ? "..." : "")}
151153
</MessageText>
152154
)}
153155
</View>

0 commit comments

Comments
 (0)