From 86b0e4ef2c936c0201416719cc1747765b5ea392 Mon Sep 17 00:00:00 2001 From: takahirom Date: Fri, 26 Jul 2024 16:41:03 +0900 Subject: [PATCH] Fix test --- .../confsched/model/EventMapEvent.kt | 2 +- .../eventmap/component/EventMapItem.kt | 115 +++++++++--------- 2 files changed, 60 insertions(+), 57 deletions(-) diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched/model/EventMapEvent.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched/model/EventMapEvent.kt index d2a5665fd..c9747308f 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched/model/EventMapEvent.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched/model/EventMapEvent.kt @@ -19,7 +19,7 @@ fun createSampleEventMapEvent( isFavorite: Boolean = false, ) = EventMapEvent( name = "ランチミートアップ", - roomName = "Arctic Fox", + roomName = "Iguana", dateLabel = "DAY1", isFavorite = isFavorite, description = "様々なテーマごとに集まって、一緒にランチを食べながらお話ししましょう。席に限りがありますので、お弁当受け取り後お早めにお越しください。", diff --git a/feature/eventmap/src/commonMain/kotlin/io/github/droidkaigi/confsched/eventmap/component/EventMapItem.kt b/feature/eventmap/src/commonMain/kotlin/io/github/droidkaigi/confsched/eventmap/component/EventMapItem.kt index 8974dd2a3..cad53bead 100644 --- a/feature/eventmap/src/commonMain/kotlin/io/github/droidkaigi/confsched/eventmap/component/EventMapItem.kt +++ b/feature/eventmap/src/commonMain/kotlin/io/github/droidkaigi/confsched/eventmap/component/EventMapItem.kt @@ -25,6 +25,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import io.github.droidkaigi.confsched.designsystem.theme.LocalRoomTheme +import io.github.droidkaigi.confsched.designsystem.theme.ProvideRoomTheme import io.github.droidkaigi.confsched.model.EventMapEvent @Composable @@ -35,68 +36,70 @@ fun EventMapItem( onClickFavorite: (eventMapEvent: EventMapEvent) -> Unit, modifier: Modifier = Modifier, ) { - val green = LocalRoomTheme.current.primaryColor - val gray = Color(0xFFC5C7C4) - Column( - modifier = modifier - .border(1.dp, gray, RoundedCornerShape(5.dp)) - .background(Color.Transparent, RoundedCornerShape(5.dp)) - .clickable { + ProvideRoomTheme(eventMapEvent.roomName) { + val green = LocalRoomTheme.current.primaryColor + val gray = Color(0xFFC5C7C4) + Column( + modifier = modifier + .border(1.dp, gray, RoundedCornerShape(5.dp)) + .background(Color.Transparent, RoundedCornerShape(5.dp)) + .clickable { // eventMapEvent.profileUrl?.let(onClick) - } - .padding(12.dp), - verticalArrangement = Arrangement.Top, - horizontalAlignment = Alignment.Start, - ) { - Row( - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.Start, + } + .padding(12.dp), + verticalArrangement = Arrangement.Top, + horizontalAlignment = Alignment.Start, ) { - ToolTip( - text = eventMapEvent.roomName, - icon = Icons.Filled.Star, - color = green, + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Start, + ) { + ToolTip( + text = eventMapEvent.roomName, + icon = Icons.Filled.Star, + color = green, + ) + Spacer(Modifier.width(4.dp)) + ToolTip( + text = eventMapEvent.dateLabel, + color = Color(0xFFBFC9C2), + ) + Spacer(Modifier.weight(1F)) + Icon( + imageVector = Icons.Default.Star, + contentDescription = null, + modifier = Modifier.size(24.dp).clickable { onClickFavorite(eventMapEvent) }, + tint = if (eventMapEvent.isFavorite) green else gray, + ) + } + Spacer(Modifier.height(8.dp)) + Text( + text = eventMapEvent.name, + fontSize = 17.sp, + lineHeight = 23.8.sp, + fontWeight = FontWeight.W600, + letterSpacing = 0.1.sp, + color = gray, ) - Spacer(Modifier.width(4.dp)) - ToolTip( - text = eventMapEvent.dateLabel, - color = Color(0xFFBFC9C2), + Spacer(Modifier.height(8.dp)) + Text( + text = eventMapEvent.description, + fontSize = 13.sp, + lineHeight = 20.sp, + fontWeight = FontWeight.W400, + letterSpacing = 0.25.sp, + color = Color.White.copy(alpha = 0.7F), ) - Spacer(Modifier.weight(1F)) - Icon( - imageVector = Icons.Default.Star, - contentDescription = null, - modifier = Modifier.size(24.dp).clickable { onClickFavorite(eventMapEvent) }, - tint = if (eventMapEvent.isFavorite) green else gray, + Spacer(Modifier.height(8.dp)) + Text( + text = eventMapEvent.timeDuration, + fontSize = 11.sp, + lineHeight = 15.sp, + fontWeight = FontWeight.W600, + letterSpacing = 0.1.sp, + color = green, ) } - Spacer(Modifier.height(8.dp)) - Text( - text = eventMapEvent.name, - fontSize = 17.sp, - lineHeight = 23.8.sp, - fontWeight = FontWeight.W600, - letterSpacing = 0.1.sp, - color = gray, - ) - Spacer(Modifier.height(8.dp)) - Text( - text = eventMapEvent.description, - fontSize = 13.sp, - lineHeight = 20.sp, - fontWeight = FontWeight.W400, - letterSpacing = 0.25.sp, - color = Color.White.copy(alpha = 0.7F), - ) - Spacer(Modifier.height(8.dp)) - Text( - text = eventMapEvent.timeDuration, - fontSize = 11.sp, - lineHeight = 15.sp, - fontWeight = FontWeight.W600, - letterSpacing = 0.1.sp, - color = green, - ) } }