Skip to content

Commit e8cc4e4

Browse files
committed
[refactor]: alias color, category color 수정 (#81)
1 parent e48a3f1 commit e8cc4e4

7 files changed

Lines changed: 15 additions & 10 deletions

File tree

app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomsPlayingResponse.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ data class RoomsPlayingResponse(
1212
val progressStartDate: String,
1313
val progressEndDate: String,
1414
val category: String,
15+
val categoryColor: String,
1516
val roomDescription: String,
1617
val memberCount: Int,
1718
val recruitCount: Int,

app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomsUsersResponse.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ data class UserList(
1212
val userId: Int,
1313
val nickname: String,
1414
val imageUrl: String,
15+
val aliasColor: String,
1516
val aliasName: String,
1617
val followerCount: Int,
1718
)

app/src/main/java/com/texthip/thip/ui/common/header/ProfileBar.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fun ProfileBar(
3232
profileImage: String,
3333
topText: String,
3434
bottomText: String,
35-
bottomTextColor: Color = colors.NeonGreen, // todo: 서버에서 색 보내주는걸로 받기?
35+
bottomTextColor: Color = colors.NeonGreen,
3636
showSubscriberInfo: Boolean,
3737
subscriberCount: Int = 0,
3838
hoursAgo: String = "",

app/src/main/java/com/texthip/thip/ui/group/room/component/GroupRoomHeader.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import androidx.compose.ui.unit.dp
2626
import com.texthip.thip.R
2727
import com.texthip.thip.ui.theme.ThipTheme.colors
2828
import com.texthip.thip.ui.theme.ThipTheme.typography
29-
import com.texthip.thip.utils.type.GenreColor
29+
import com.texthip.thip.utils.color.hexToColor
3030

3131
@Composable
3232
fun GroupRoomHeader(
@@ -37,12 +37,9 @@ fun GroupRoomHeader(
3737
progressEndDate: String,
3838
memberCount: Int,
3939
category: String,
40-
color: String = "RED", // TODO: 서버에서 색상 추가해주면 수정,
40+
categoryColor: String = "#A0F8E8",
4141
onNavigateToMates: () -> Unit = { }
4242
) {
43-
val categoryColorEnum = GenreColor.fromString(color)
44-
val categoryColor = categoryColorEnum.colorProvider()
45-
4643
Column(
4744
modifier = Modifier.padding(horizontal = 20.dp)
4845
) {
@@ -176,7 +173,7 @@ fun GroupRoomHeader(
176173
Text(
177174
text = category,
178175
style = typography.info_m500_s12,
179-
color = categoryColor
176+
color = hexToColor(categoryColor)
180177
)
181178
}
182179
}

app/src/main/java/com/texthip/thip/ui/group/room/component/GroupRoomMatesList.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import com.texthip.thip.data.model.rooms.response.RoomsUsersResponse
1313
import com.texthip.thip.data.model.rooms.response.UserList
1414
import com.texthip.thip.ui.common.header.ProfileBar
1515
import com.texthip.thip.ui.theme.ThipTheme.colors
16+
import com.texthip.thip.utils.color.hexToColor
1617

1718
@Composable
1819
fun GroupRoomMatesList(
@@ -31,8 +32,7 @@ fun GroupRoomMatesList(
3132
profileImage = member.imageUrl,
3233
topText = member.nickname,
3334
bottomText = member.aliasName,
34-
// bottomTextColor = member.aliasColor,
35-
bottomTextColor = colors.ScienceIt, // TODO: 서버에서 보내주는 색상으로 수정
35+
bottomTextColor = hexToColor(member.aliasColor),
3636
showSubscriberInfo = true,
3737
subscriberCount = member.followerCount
3838
) { onUserClick(member.userId) }
@@ -58,13 +58,15 @@ private fun GroupRoomMatesListPreview() {
5858
userId = 1,
5959
nickname = "김희용",
6060
aliasName = "문학가",
61+
aliasColor= "#A0F8E8",
6162
imageUrl = "https://example.com/image1.jpg",
6263
followerCount = 100
6364
),
6465
UserList(
6566
userId = 2,
6667
nickname = "노성준",
6768
aliasName = "문학가",
69+
aliasColor= "#A0F8E8",
6870
imageUrl = "https://example.com/image1.jpg",
6971
followerCount = 100
7072
),

app/src/main/java/com/texthip/thip/ui/group/room/screen/GroupRoomMatesScreen.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,15 @@ private fun GroupRoomMatesScreenPreview() {
104104
userId = 1,
105105
nickname = "김희용",
106106
aliasName = "문학가",
107+
aliasColor = "#A0F8E8",
107108
imageUrl = "https://example.com/image1.jpg",
108109
followerCount = 100
109110
),
110111
UserList(
111112
userId = 2,
112113
nickname = "노성준",
113114
aliasName = "문학가",
115+
aliasColor = "#A0F8E8",
114116
imageUrl = "https://example.com/image1.jpg",
115117
followerCount = 100
116118
),

app/src/main/java/com/texthip/thip/ui/group/room/screen/GroupRoomScreen.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ fun GroupRoomContent(
162162
progressStartDate = roomDetails.progressStartDate,
163163
progressEndDate = roomDetails.progressEndDate,
164164
memberCount = roomDetails.memberCount,
165-
category = roomDetails.category
165+
category = roomDetails.category,
166+
categoryColor = roomDetails.categoryColor,
166167
) {
167168
onNavigateToMates()
168169
}
@@ -282,6 +283,7 @@ private fun GroupRoomScreenPreview() {
282283
progressStartDate = "2023.10.01",
283284
progressEndDate = "2023.10.31",
284285
category = "문학",
286+
categoryColor = "#A0F8E8",
285287
roomDescription = "‘시집만 읽는 사람들’ 3월 모임입니다.",
286288
memberCount = 22,
287289
recruitCount = 30,

0 commit comments

Comments
 (0)