diff --git a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/notifications/NotificationPage.kt b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/notifications/NotificationPage.kt index 0e8674d6a..15410af02 100644 --- a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/notifications/NotificationPage.kt +++ b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/notifications/NotificationPage.kt @@ -3,7 +3,6 @@ package com.wafflestudio.snutt2.views.logged_in.notifications import androidx.compose.foundation.background import androidx.compose.foundation.layout.* import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.material.Divider import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment @@ -11,7 +10,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview @@ -52,7 +50,7 @@ fun NotificationPage() { refreshState is LoadState.NotLoading && appendState.endOfPaginationReached && notificationList.itemCount < 1 -> NotificationPlaceholder() refreshState is LoadState.Error -> NotificationError() else -> LazyColumn( - modifier = Modifier.padding(horizontal = 9.dp) + modifier = Modifier.padding(horizontal = 9.dp), ) { items(notificationList) { it?.let { NotificationItem(it) } @@ -65,37 +63,34 @@ fun NotificationPage() { @Composable fun NotificationItem(info: NotificationDto) { val context = LocalContext.current - Column { - Row(modifier = Modifier.padding(horizontal = 15.dp, vertical = 15.dp)) { - when (info.type) { - 0 -> WarningIcon(modifier = Modifier.size(20.dp), colorFilter = ColorFilter.tint(SNUTTColors.Black900)) - 1 -> CalendarIcon(modifier = Modifier.size(20.dp), colorFilter = ColorFilter.tint(SNUTTColors.Black900)) - 2 -> RefreshIcon(modifier = Modifier.size(20.dp), colorFilter = ColorFilter.tint(SNUTTColors.Black900)) - 3 -> TrashIcon(modifier = Modifier.size(20.dp), colorFilter = ColorFilter.tint(SNUTTColors.Black900)) - 4 -> NotificationIcon(modifier = Modifier.size(20.dp), colorFilter = ColorFilter.tint(SNUTTColors.Black900)) - 5 -> PeopleIcon(modifier = Modifier.size(20.dp), colorFilter = ColorFilter.tint(SNUTTColors.Black900)) - else -> MegaphoneIcon(modifier = Modifier.size(20.dp), colorFilter = ColorFilter.tint(SNUTTColors.Black900)) - } - Spacer(modifier = Modifier.width(10.dp)) - Column { - Row(modifier = Modifier.fillMaxWidth()) { - Text(text = info.title, fontWeight = FontWeight.SemiBold) - Spacer(modifier = Modifier.weight(1f)) - Text( - text = getNotificationTime(context, info), - style = SNUTTTypography.body2.copy(color = SNUTTColors.Gray600), - maxLines = 1, - overflow = TextOverflow.Ellipsis, - ) - } - Spacer(modifier = Modifier.height(7.dp)) + Row(modifier = Modifier.padding(horizontal = 15.dp, vertical = 15.dp)) { + when (info.type) { + 0 -> WarningIcon(modifier = Modifier.size(20.dp), colorFilter = ColorFilter.tint(SNUTTColors.Black900)) + 1 -> CalendarIcon(modifier = Modifier.size(20.dp), colorFilter = ColorFilter.tint(SNUTTColors.Black900)) + 2 -> RefreshIcon(modifier = Modifier.size(20.dp), colorFilter = ColorFilter.tint(SNUTTColors.Black900)) + 3 -> TrashIcon(modifier = Modifier.size(20.dp), colorFilter = ColorFilter.tint(SNUTTColors.Black900)) + 4 -> NotificationIcon(modifier = Modifier.size(20.dp), colorFilter = ColorFilter.tint(SNUTTColors.Black900)) + 5 -> PeopleIcon(modifier = Modifier.size(20.dp), colorFilter = ColorFilter.tint(SNUTTColors.Black900)) + else -> MegaphoneIcon(modifier = Modifier.size(20.dp), colorFilter = ColorFilter.tint(SNUTTColors.Black900)) + } + Spacer(modifier = Modifier.width(10.dp)) + Column { + Row(modifier = Modifier.fillMaxWidth()) { + Text(text = info.title, style = SNUTTTypography.h4) + Spacer(modifier = Modifier.weight(1f)) Text( - text = info.message, - style = SNUTTTypography.body2, + text = getNotificationTime(context, info), + style = SNUTTTypography.body2.copy(color = SNUTTColors.Gray600), + maxLines = 1, + overflow = TextOverflow.Ellipsis, ) } + Spacer(modifier = Modifier.height(7.dp)) + Text( + text = info.message, + style = SNUTTTypography.body2, + ) } - Divider(thickness = 0.5.dp, color = SNUTTColors.Gray400) } }