From cbcf4a384c857b1a6ac81a7e3eccb28c0c953478 Mon Sep 17 00:00:00 2001 From: chws0508 Date: Fri, 22 Mar 2024 18:11:57 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20NavHost=EC=97=90=20postDetail=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 1 + .../main/java/com/withpeace/withpeace/navigation/NavHost.kt | 5 +++++ .../feature/postdetail/navigation/PostDetailNavigation.kt | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6f5f2404..6df215b6 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -45,6 +45,7 @@ dependencies { implementation(project(":feature:mypage")) implementation(project(":feature:registerpost")) implementation(project(":feature:gallery")) + implementation(project(":feature:postdetail")) implementation(project(":core:interceptor")) implementation(project(":core:data")) implementation(project(":core:network")) diff --git a/app/src/main/java/com/withpeace/withpeace/navigation/NavHost.kt b/app/src/main/java/com/withpeace/withpeace/navigation/NavHost.kt index d8ff3372..8e618579 100644 --- a/app/src/main/java/com/withpeace/withpeace/navigation/NavHost.kt +++ b/app/src/main/java/com/withpeace/withpeace/navigation/NavHost.kt @@ -10,6 +10,7 @@ import com.withpeace.withpeace.feature.home.navigation.homeNavGraph import com.withpeace.withpeace.feature.login.navigation.LOGIN_ROUTE import com.withpeace.withpeace.feature.login.navigation.loginNavGraph import com.withpeace.withpeace.feature.mypage.navigation.myPageNavGraph +import com.withpeace.withpeace.feature.postdetail.navigation.postDetailGraph import com.withpeace.withpeace.feature.postlist.navigation.postListGraph import com.withpeace.withpeace.feature.registerpost.navigation.IMAGE_LIST_ARGUMENT import com.withpeace.withpeace.feature.registerpost.navigation.registerPostNavGraph @@ -55,6 +56,10 @@ fun WithpeaceNavHost( ) homeNavGraph(onShowSnackBar) postListGraph(onShowSnackBar) + postDetailGraph( + onShowSnackBar = onShowSnackBar, + onClickBackButton = navController::popBackStack, + ) myPageNavGraph(onShowSnackBar) } } diff --git a/feature/postdetail/src/main/java/com/withpeace/withpeace/feature/postdetail/navigation/PostDetailNavigation.kt b/feature/postdetail/src/main/java/com/withpeace/withpeace/feature/postdetail/navigation/PostDetailNavigation.kt index a0c7a159..4c24b347 100644 --- a/feature/postdetail/src/main/java/com/withpeace/withpeace/feature/postdetail/navigation/PostDetailNavigation.kt +++ b/feature/postdetail/src/main/java/com/withpeace/withpeace/feature/postdetail/navigation/PostDetailNavigation.kt @@ -18,7 +18,7 @@ fun NavController.navigateToPostDetail( navOptions: NavOptions? = null, ) = navigate(route = "$POST_DETAIL_ROUTE/$postId", navOptions) -fun NavGraphBuilder.postDetailNavGraph( +fun NavGraphBuilder.postDetailGraph( onShowSnackBar: (String) -> Unit, onClickBackButton: () -> Unit, ) {