Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/#115 : 내 글 관리 - 데이터 없음 스크린 추가 #117

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ data class MyEvaluationState(
val showDeleteLectureEvaluationDialog: Boolean = false,
val showDeleteExamEvaluationDialog: Boolean = false,
val showLackPointDialog: Boolean = false,
)
) {
val showLectureEmptyScreen: Boolean = myLectureEvaluationList.isEmpty()
val showExamEmptyScreen: Boolean = myExamEvaluationList.isEmpty()
}

sealed interface MyEvaluationSideEffect {
data object PopBackStack : MyEvaluationSideEffect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.PagerState
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
Expand All @@ -20,14 +22,17 @@ import androidx.compose.runtime.setValue
import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import com.suwiki.core.designsystem.component.appbar.SuwikiAppBarWithTitle
import com.suwiki.core.designsystem.component.container.SuwikiEditContainer
import com.suwiki.core.designsystem.component.dialog.SuwikiDialog
import com.suwiki.core.designsystem.component.loading.LoadingScreen
import com.suwiki.core.designsystem.component.tabbar.SuwikiTabBar
import com.suwiki.core.designsystem.component.tabbar.TabTitle
import com.suwiki.core.designsystem.theme.Gray95
import com.suwiki.core.designsystem.theme.SuwikiTheme
import com.suwiki.core.designsystem.theme.White
import com.suwiki.core.model.enums.LectureEvaluationTab
Expand Down Expand Up @@ -160,21 +165,29 @@ fun MyEvaluationScreen(
) { page ->
when (LectureEvaluationTab.entries[page]) {
LectureEvaluationTab.LECTURE_EVALUATION -> {
MyLectureEvaluationLazyColumn(
itemList = uiState.myLectureEvaluationList,
listState = lectureEvaluationListState,
onClickLectureEditButton = onClickLectureEvaluationEditButton,
onClickDeleteButton = onClickLectureEvaluationDeleteButton,
)
if (uiState.showLectureEmptyScreen) {
EmptyScreen()
} else {
MyLectureEvaluationLazyColumn(
itemList = uiState.myLectureEvaluationList,
listState = lectureEvaluationListState,
onClickLectureEditButton = onClickLectureEvaluationEditButton,
onClickDeleteButton = onClickLectureEvaluationDeleteButton,
)
}
}

LectureEvaluationTab.EXAM_INFO -> {
MyExamEvaluationLazyColumn(
itemList = uiState.myExamEvaluationList,
listState = examEvaluationListState,
onClickExamEditButton = onClickExamEvaluationEditButton,
onClickDeleteButton = onClickExamEvaluationDeleteButton,
)
if (uiState.showExamEmptyScreen) {
EmptyScreen()
} else {
MyExamEvaluationLazyColumn(
itemList = uiState.myExamEvaluationList,
listState = examEvaluationListState,
onClickExamEditButton = onClickExamEvaluationEditButton,
onClickDeleteButton = onClickExamEvaluationDeleteButton,
)
}
}
}
}
Expand Down Expand Up @@ -247,6 +260,19 @@ fun MyLectureEvaluationLazyColumn(
}
}

@Composable
fun EmptyScreen() {
Text(
modifier = Modifier
.padding(top = 150.dp)
.fillMaxSize(),
text = stringResource(R.string.empty_screen_text),
textAlign = TextAlign.Center,
style = SuwikiTheme.typography.header4,
color = Gray95,
)
}

@Composable
fun MyExamEvaluationLazyColumn(
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
<string name="delete_dialog_body">강의평가를 정말로 삭제하시겠습니까?\n현재 보유 포인트 : %dp</string>
<string name="lack_point_dialog_header">포인트가 부족합니다.</string>
<string name="lack_point_dialog_body">현재 보유 포인트 : %dp</string>
<string name="empty_screen_text">등록된 평가가 없어요</string>
</resources>
Loading