Skip to content

Commit

Permalink
#26 구현 중
Browse files Browse the repository at this point in the history
  • Loading branch information
seoyeonsw committed Nov 8, 2024
1 parent 89c5dd2 commit ad62643
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.hackathon.alddeul_babsang.presentation.profile.screen

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
Expand All @@ -19,6 +20,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
Expand Down Expand Up @@ -146,12 +148,17 @@ fun LikeScreen(
val data = (getLikesState as UiState.Success).data // getLikesState로 수정
if (data.isEmpty()) {
item {
Text(
text = "좋아요를 누른 밥상이 없어요",
style = head6Semi,
color = Orange900,
modifier = Modifier.padding(vertical = 20.dp)
)
Box(
modifier = Modifier
.fillMaxSize()
) {
Text(
text = "좋아요를 누른 밥상이 없어요",
style = head6Semi,
color = Orange900,
modifier = Modifier.align(Alignment.Center)
)
}
}
} else {
itemsIndexed(data) { index, item ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.hackathon.alddeul_babsang.presentation.report.screen

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
Expand All @@ -18,6 +19,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
Expand Down Expand Up @@ -135,12 +137,17 @@ fun ReportScreen(
val data = (getReportState as UiState.Success).data
if (data.isEmpty()) {
item {
Text(
text = "밥상 데이터가 없어요",
style = head6Semi,
color = Orange900,
modifier = Modifier.padding(vertical = 20.dp)
)
Box(
modifier = Modifier
.fillMaxSize()
) {
Text(
text = "제보된 밥상이 없어요",
style = head6Semi,
color = Orange900,
modifier = Modifier.align(Alignment.Center)
)
}
}
} else {
itemsIndexed(data) { index, item ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ReportViewModel @Inject constructor(


fun postReports(
userId : Long = 1
userId : Int = 1
) = viewModelScope.launch {
_getReportState.emit(UiState.Loading)
reportRepository.postReports(userId).fold(
Expand Down

0 comments on commit ad62643

Please sign in to comment.