Skip to content

Commit

Permalink
[MERGE] #193 -> develop
Browse files Browse the repository at this point in the history
[REFACTOR/#193] 홈 뷰 리팩토링
  • Loading branch information
Hyobeen-Park authored Aug 30, 2024
2 parents 6d31941 + 2bfd7a4 commit 65777d3
Show file tree
Hide file tree
Showing 6 changed files with 232 additions and 222 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ fun ChangeFilterRoute(
val lifecycleOwner = LocalLifecycleOwner.current
val context = LocalContext.current

val filteringState by viewModel.homeFilteringState.collectAsStateWithLifecycle()
val homeState by viewModel.homeState.collectAsStateWithLifecycle()

when (filteringState) {
when (homeState.homeFilteringInfoState) {
is UiState.Success -> ChangeFilterScreen(
(filteringState as UiState.Success<HomeFilteringInfo>).data,
navController,
filterData = (homeState.homeFilteringInfoState as UiState.Success<HomeFilteringInfo>).data,
navigateToHome = { navController.popBackStack() },
viewModel,
)

Expand All @@ -75,7 +75,7 @@ fun ChangeFilterRoute(
@Composable
fun ChangeFilterScreen(
filterData: HomeFilteringInfo,
navController: NavController,
navigateToHome: () -> Unit,
viewModel: HomeViewModel,
) {
var currentGrade by remember { mutableIntStateOf(filterData.grade ?: -1) }
Expand All @@ -96,7 +96,7 @@ fun ChangeFilterScreen(
topBar = {
BackButtonTopAppBar(
title = stringResource(id = R.string.change_filter_top_bar_title),
onBackButtonClick = { navController.popBackStack() },
onBackButtonClick = navigateToHome,
modifier = Modifier
.shadow(elevation = 2.dp)
)
Expand Down
Loading

0 comments on commit 65777d3

Please sign in to comment.