diff --git a/core/data/src/main/java/com/plottwist/core/data/mapper/Gathering.kt b/core/data/src/main/java/com/plottwist/core/data/mapper/Gathering.kt index 0076902c..0be5bc6e 100644 --- a/core/data/src/main/java/com/plottwist/core/data/mapper/Gathering.kt +++ b/core/data/src/main/java/com/plottwist/core/data/mapper/Gathering.kt @@ -38,14 +38,17 @@ fun GatheringDetailData.toDomainModel() : GatheringDetail { gatheringIntervalDays = this.gatheringIntervalDays, sentProposalCount = this.sentProposalCount, receivedProposalCount = this.receivedProposalCount, - members = this.members.map { it.toDomainModel() } + members = this.members.map { it.toDomainModel() }, + isHost = this.isHost ) } fun GatheringMemberData.toDomainModel() : GatheringMember { return GatheringMember( memberId = this.memberId, - memberName = this.memberName + memberName = this.memberName, + isHost = this.isHost, + isMe = this.isMe ) } diff --git a/core/domain/src/main/java/com/plottwist/core/domain/model/Gathering.kt b/core/domain/src/main/java/com/plottwist/core/domain/model/Gathering.kt index 1dbbee30..49f53827 100644 --- a/core/domain/src/main/java/com/plottwist/core/domain/model/Gathering.kt +++ b/core/domain/src/main/java/com/plottwist/core/domain/model/Gathering.kt @@ -18,12 +18,15 @@ data class GatheringDetail( val gatheringIntervalDays: Long = 0, val sentProposalCount: Int = 0, val receivedProposalCount: Int = 0, - val members: List = emptyList() + val members: List = emptyList(), + val isHost: Boolean = false ) data class GatheringMember( val memberId: Long = 0, - val memberName: String = "" + val memberName: String = "", + val isHost: Boolean = false, + val isMe: Boolean = false ) data class Purposes( diff --git a/core/network/src/main/java/com/plottwist/core/network/model/gathering/GatheringDetailResponse.kt b/core/network/src/main/java/com/plottwist/core/network/model/gathering/GatheringDetailResponse.kt index b4157c41..fa4e8c08 100644 --- a/core/network/src/main/java/com/plottwist/core/network/model/gathering/GatheringDetailResponse.kt +++ b/core/network/src/main/java/com/plottwist/core/network/model/gathering/GatheringDetailResponse.kt @@ -19,11 +19,14 @@ data class GatheringDetailData( val gatheringIntervalDays: Long, val sentProposalCount: Int, val receivedProposalCount: Int, - val members: List + val members: List, + val isHost: Boolean ) @Serializable data class GatheringMemberData( val memberId: Long, - val memberName: String + val memberName: String, + val isHost: Boolean, + val isMe: Boolean ) diff --git a/feature/gathering-detail/src/main/java/com/plottwist/feature/gathering_detail/GatheringDetailScreen.kt b/feature/gathering-detail/src/main/java/com/plottwist/feature/gathering_detail/GatheringDetailScreen.kt index cbeb5e80..7809e026 100644 --- a/feature/gathering-detail/src/main/java/com/plottwist/feature/gathering_detail/GatheringDetailScreen.kt +++ b/feature/gathering-detail/src/main/java/com/plottwist/feature/gathering_detail/GatheringDetailScreen.kt @@ -6,8 +6,10 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer 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.width import androidx.compose.foundation.lazy.LazyColumn @@ -82,6 +84,7 @@ fun GatheringDetailScreen( lastAlarm = state.gatheringDetail.lastPushRelativeTime, sentProposalCount = state.gatheringDetail.sentProposalCount, receivedProposalCount = state.gatheringDetail.receivedProposalCount, + isHost = state.gatheringDetail.isHost, onAlarmSettingClick = { viewModel.handleAction(GatheringDetailAction.ClickAlarmSetting) }, @@ -110,6 +113,7 @@ private fun GatheringDetailScreen( lastAlarm: String, sentProposalCount: Int, receivedProposalCount: Int, + isHost: Boolean, onAlarmSettingClick: () -> Unit, onProposalClick: () -> Unit, onSentProposalClick: () -> Unit, @@ -138,10 +142,14 @@ private fun GatheringDetailScreen( } item(key = Items.ALARM_SETTING) { - GatheringAlarmSetting( - modifier = Modifier.padding(top = 24.dp), - onClick = onAlarmSettingClick - ) + if(isHost) { + GatheringAlarmSetting( + modifier = Modifier.padding(top = 24.dp), + onClick = onAlarmSettingClick + ) + } else { + Spacer(modifier = Modifier.fillMaxWidth().height(44.dp)) + } } item(key = Items.GATHERING_INFO) { @@ -243,6 +251,7 @@ private fun GatheringDetailScreenPreview() { lastAlarm = "3달 전", sentProposalCount = 99, receivedProposalCount = 99, + isHost = true, onAlarmSettingClick = {}, onProposalClick = {}, onSentProposalClick = {}, diff --git a/feature/gathering-detail/src/main/java/com/plottwist/feature/gathering_detail/component/GatheringMembers.kt b/feature/gathering-detail/src/main/java/com/plottwist/feature/gathering_detail/component/GatheringMembers.kt index 2f6b46bc..d81a034d 100644 --- a/feature/gathering-detail/src/main/java/com/plottwist/feature/gathering_detail/component/GatheringMembers.kt +++ b/feature/gathering-detail/src/main/java/com/plottwist/feature/gathering_detail/component/GatheringMembers.kt @@ -9,6 +9,7 @@ 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.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon @@ -22,7 +23,9 @@ import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.vectorResource import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp import com.plottwist.core.designsystem.R +import com.plottwist.core.designsystem.foundation.TukColorTokens.Gray300 import com.plottwist.core.designsystem.foundation.type.TukPretendardTypography import com.plottwist.core.designsystem.foundation.type.TukSerifTypography import com.plottwist.core.domain.model.GatheringMember @@ -59,15 +62,37 @@ fun GatheringMembers( ) members.forEach { member -> - Text( - text = member.memberName, - style = TukPretendardTypography.body16R, - color = Color(0xFF1f1f1f) - ) + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(5.dp) + ){ + Text( + text = member.memberName, + style = TukPretendardTypography.body16R, + color = Color(0xFF1f1f1f) + ) + if(member.isMe){ + MemberMarkAsMe() + } + } + } } } +@Composable +fun MemberMarkAsMe(modifier: Modifier = Modifier) { + Text( + modifier = modifier.background( + color = Gray300, + shape = CircleShape + ).padding(horizontal = 5.dp), + text = "나", + style = TukPretendardTypography.body12M.copy( + fontSize = 10.sp + ) + ) +} @Composable fun InvitationMemberText(