Skip to content

Commit

Permalink
ui 되돌림
Browse files Browse the repository at this point in the history
  • Loading branch information
eastshine2741 committed Dec 13, 2023
1 parent 98cc710 commit ecb1e72
Showing 1 changed file with 25 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ 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 @@ -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) }
Expand All @@ -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)
}
}

Expand Down

0 comments on commit ecb1e72

Please sign in to comment.