Skip to content

Commit

Permalink
소소한 ui 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
eastshine2741 committed Nov 29, 2023
1 parent 1873880 commit 98cc710
Showing 1 changed file with 32 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ 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
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
Expand Down Expand Up @@ -49,7 +51,9 @@ fun NotificationPage() {
when {
refreshState is LoadState.NotLoading && appendState.endOfPaginationReached && notificationList.itemCount < 1 -> NotificationPlaceholder()
refreshState is LoadState.Error -> NotificationError()
else -> LazyColumn {
else -> LazyColumn(
modifier = Modifier.padding(horizontal = 9.dp)
) {
items(notificationList) {
it?.let { NotificationItem(it) }
}
Expand All @@ -61,34 +65,37 @@ fun NotificationPage() {
@Composable
fun NotificationItem(info: NotificationDto) {
val context = LocalContext.current
Row(modifier = Modifier.padding(horizontal = 15.dp, vertical = 10.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)
Spacer(modifier = Modifier.weight(1f))
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))
Text(
text = getNotificationTime(context, info),
style = SNUTTTypography.body2.copy(color = SNUTTColors.Gray600),
maxLines = 1,
overflow = TextOverflow.Ellipsis,
text = info.message,
style = SNUTTTypography.body2,
)
}
Spacer(modifier = Modifier.height(7.dp))
Text(
text = info.message,
style = SNUTTTypography.body2,
)
}
Divider(thickness = 0.5.dp, color = SNUTTColors.Gray400)
}
}

Expand Down

0 comments on commit 98cc710

Please sign in to comment.