Skip to content

Commit

Permalink
[FEATURE] #125 : 설문 페이지 Loading Lottie 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Feb 17, 2024
1 parent c18af5c commit 7ef9aac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.wap.designsystem.WappTheme
import com.wap.designsystem.component.CircleLoader
import com.wap.designsystem.component.WappLeftMainTopBar
import com.wap.wapp.core.commmon.extensions.toSupportingText
import com.wap.wapp.core.model.user.UserRole
Expand Down Expand Up @@ -61,7 +62,9 @@ internal fun SurveyScreen(
is SurveyViewModel.UserRoleUiState.Init -> {}
is SurveyViewModel.UserRoleUiState.Success -> {
when (userRoleUiState.userRole) {
UserRole.GUEST -> { isGuest = true }
UserRole.GUEST -> {
isGuest = true
}

// 비회원이 아닌 경우, 목록 호출
UserRole.MEMBER -> viewModel.getSurveyFormList()
Expand Down Expand Up @@ -95,6 +98,10 @@ internal fun SurveyScreen(
) { paddingValues ->
when (surveyFormListUiState) {
is SurveyViewModel.SurveyFormListUiState.Init -> {}

is SurveyViewModel.SurveyFormListUiState.Loading ->
CircleLoader(modifier = Modifier.fillMaxSize())

is SurveyViewModel.SurveyFormListUiState.Success -> {
SurveyContent(
surveyFormList = surveyFormListUiState.surveyFormList,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class SurveyViewModel @Inject constructor(
}

fun getSurveyFormList() = viewModelScope.launch {
_surveyFormListUiState.value = SurveyFormListUiState.Loading

getSurveyFormListUseCase()
.onSuccess { surveyFormList ->
val filteredSurveyFormList = surveyFormList.filter { survey ->
Expand Down

0 comments on commit 7ef9aac

Please sign in to comment.