Skip to content

Commit

Permalink
[FEAT/#162] 네비게이션 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyobeen-Park committed Jan 23, 2025
1 parent 6a1c7ed commit 8deaf56
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ fun MainScreen(
)

mapSearchNavGraph(
paddingValues = paddingValues
paddingValues = paddingValues,
navigateUp = navigator::navigateUp
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import kotlinx.collections.immutable.ImmutableList

@Composable
fun MapSearchRoute(
navigateUp: () -> Unit,
viewModel: MapSearchViewModel = hiltViewModel()
) {
val state by viewModel.state.collectAsStateWithLifecycle()
Expand All @@ -40,6 +41,7 @@ fun MapSearchRoute(
onSearchButtonClick = viewModel::searchLocation,
onDeleteButtonClick = {},
onResultItemClick = {},
onBackButtonClick = navigateUp,
onDeleteAllButtonClick = viewModel::initRecentSearch
)
}
Expand All @@ -50,6 +52,7 @@ private fun MapSearchScreen(
recentSearchList: ImmutableList<String>,
locationModelList: UiState<ImmutableList<LocationModel>>,
onSearchKeywordChanged: (String) -> Unit,
onBackButtonClick: () -> Unit,
onSearchButtonClick: () -> Unit,
onDeleteButtonClick: () -> Unit,
onResultItemClick: (Int) -> Unit,
Expand All @@ -59,7 +62,8 @@ private fun MapSearchScreen(
MapSearchTopAppBar(
value = searchKeyword,
onValueChanged = onSearchKeywordChanged,
onSearchAction = onSearchButtonClick
onSearchAction = onSearchButtonClick,
onBackButtonClick = onBackButtonClick
)

when {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ import com.spoony.spoony.core.designsystem.theme.SpoonyAndroidTheme
fun MapSearchTopAppBar(
value: String,
onValueChanged: (String) -> Unit,
onBackButtonClick: () -> Unit,
modifier: Modifier = Modifier,
onSearchAction: () -> Unit
) {
SpoonyBasicTopAppBar(
showBackButton = true,
onBackButtonClick = onBackButtonClick,
modifier = modifier
.background(SpoonyAndroidTheme.colors.white)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ fun NavController.navigateToMapSearch(
}

fun NavGraphBuilder.mapSearchNavGraph(
paddingValues: PaddingValues
paddingValues: PaddingValues,
navigateUp: () -> Unit
) {
composable<MapSearch> {
MapSearchRoute()
MapSearchRoute(
navigateUp = navigateUp
)
}
}

Expand Down

0 comments on commit 8deaf56

Please sign in to comment.