Skip to content

Commit

Permalink
[IDLE-490] 채팅방 읽지 않은 메세지 컴포넌트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Oct 31, 2024
1 parent 41000f4 commit dbf2be0
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,56 @@ class GetChatRoomListUseCase @Inject constructor(
) {
suspend operator fun invoke(): Result<List<ChatRoom>> = Result.success(
listOf(
// ChatRoom(
// id = "1",
// sender = "user1",
// receiver = "user2",
// createdAt = LocalDateTime.now().minusDays(1),
// lastMessage = "안녕하세요!안녕하세요!안녕하세요!안녕하세요!안녕하세요!안녕하세요!",
// lastSentAt = LocalDateTime.now().minusHours(1),
// unReadMessageCount = 3,
// profileImageUrl = "",
// ),
// ChatRoom(
// id = "2",
// sender = "user3",
// receiver = "user4",
// createdAt = LocalDateTime.now().minusDays(3),
// lastMessage = "오늘 만날 수 있을까요?",
// lastSentAt = LocalDateTime.now().minusHours(5),
// unReadMessageCount = 2,
// profileImageUrl = "",
// ),
// ChatRoom(
// id = "3",
// sender = "user5",
// receiver = "user6",
// createdAt = LocalDateTime.now().minusDays(7),
// lastMessage = "네, 좋습니다!",
// lastSentAt = LocalDateTime.now().minusDays(1).minusHours(2),
// unReadMessageCount = 1,
// profileImageUrl = "",
// ),
// ChatRoom(
// id = "4",
// sender = "user7user7user7user7user7user7user7user7user7user7user7user7",
// receiver = "user8",
// createdAt = LocalDateTime.now().minusHours(2),
// lastMessage = "곧 출발합니다.곧 출발합니다.곧 출발합니다.곧 출발합니다.곧 출발합니다.곧 출발합니다.곧 출발합니다.곧 출발합니다.",
// lastSentAt = LocalDateTime.now().minusMinutes(30),
// unReadMessageCount = 0,
// profileImageUrl = "",
// ),
// ChatRoom(
// id = "5",
// sender = "user9",
// receiver = "user10",
// createdAt = LocalDateTime.now().minusWeeks(1),
// lastMessage = "다음 주에 봐요!",
// lastSentAt = LocalDateTime.now().minusDays(3),
// unReadMessageCount = 0,
// profileImageUrl = "https://cdn.pixabay.com/photo/2020/05/17/20/21/cat-5183427_1280.jpg",
// )
ChatRoom(
id = "1",
sender = "user1",
receiver = "user2",
createdAt = LocalDateTime.now().minusDays(1),
lastMessage = "안녕하세요!안녕하세요!안녕하세요!안녕하세요!안녕하세요!안녕하세요!",
lastSentAt = LocalDateTime.now().minusHours(1),
unReadMessageCount = 3,
profileImageUrl = "",
),
ChatRoom(
id = "2",
sender = "user3",
receiver = "user4",
createdAt = LocalDateTime.now().minusDays(3),
lastMessage = "오늘 만날 수 있을까요?",
lastSentAt = LocalDateTime.now().minusHours(5),
unReadMessageCount = 99,
profileImageUrl = "",
),
ChatRoom(
id = "3",
sender = "user5",
receiver = "user6",
createdAt = LocalDateTime.now().minusDays(7),
lastMessage = "네, 좋습니다!",
lastSentAt = LocalDateTime.now().minusDays(1).minusHours(2),
unReadMessageCount = 1,
profileImageUrl = "",
),
ChatRoom(
id = "4",
sender = "user7user7user7user7user7user7user7user7user7user7user7user7",
receiver = "user8",
createdAt = LocalDateTime.now().minusHours(2),
lastMessage = "곧 출발합니다.곧 출발합니다.곧 출발합니다.곧 출발합니다.곧 출발합니다.곧 출발합니다.곧 출발합니다.곧 출발합니다.",
lastSentAt = LocalDateTime.now().minusMinutes(30),
unReadMessageCount = 0,
profileImageUrl = "",
),
ChatRoom(
id = "5",
sender = "user9",
receiver = "user10",
createdAt = LocalDateTime.now().minusWeeks(1),
lastMessage = "다음 주에 봐요!",
lastSentAt = LocalDateTime.now().minusDays(3),
unReadMessageCount = 0,
profileImageUrl = "https://cdn.pixabay.com/photo/2020/05/17/20/21/cat-5183427_1280.jpg",
)
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
Expand Down Expand Up @@ -100,7 +101,7 @@ fun CareChatSenderTextBubbleWithImage(
horizontalAlignment = Alignment.Start,
modifier = Modifier
.padding(start = 4.dp)
.width(35.dp)
.wrapContentWidth()
.align(Alignment.Bottom),
) {
if (isRead) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.CircleShape
Expand Down Expand Up @@ -228,7 +231,9 @@ internal fun ChatRoomItem(

Box(
modifier = Modifier
.size(22.dp)
.height(22.dp)
.wrapContentWidth()
.widthIn(min = 22.dp)
.clip(RoundedCornerShape(300.dp))
.background(unReadMessageColor),
) {
Expand All @@ -238,7 +243,9 @@ internal fun ChatRoomItem(
style = CareTheme.typography.caption1.copy(fontWeight = FontWeight.Bold),
color = CareTheme.colors.white000,
textAlign = TextAlign.Center,
modifier = Modifier.align(Alignment.Center),
modifier = Modifier
.padding(horizontal = 6.dp)
.align(Alignment.Center),
)
}
}
Expand Down

0 comments on commit dbf2be0

Please sign in to comment.