-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] #93 : Management - Survey Navigation 구현 SurveyForm (Registr…
…ation, Edit Route)
- Loading branch information
1 parent
f9765ac
commit 5ff4718
Showing
2 changed files
with
53 additions
and
24 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
...main/java/com/wap/wapp/feature/management/survey/navigation/ManagementSurveyNavigation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.wap.wapp.feature.management.survey.navigation | ||
|
||
import androidx.navigation.NavController | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.NavOptions | ||
import androidx.navigation.NavType | ||
import androidx.navigation.compose.composable | ||
import androidx.navigation.navArgument | ||
import androidx.navigation.navOptions | ||
import com.wap.wapp.feature.management.survey.edit.SurveyFormEditScreen | ||
import com.wap.wapp.feature.management.survey.registration.SurveyRegistrationScreen | ||
|
||
fun NavController.navigateToSurveyFormRegistration(navOptions: NavOptions? = navOptions {}) { | ||
this.navigate(ManagementSurveyRoute.surveyFormRegistrationRoute, navOptions) | ||
} | ||
|
||
fun NavController.navigateToSurveyFormEdit( | ||
surveyFormId: String, | ||
navOptions: NavOptions? = navOptions {}, | ||
) { | ||
this.navigate(ManagementSurveyRoute.surveyFormEditRoute(surveyFormId), navOptions) | ||
} | ||
|
||
fun NavGraphBuilder.managementSurveyNavGraph( | ||
navigateToManagement: () -> Unit, | ||
) { | ||
composable(route = ManagementSurveyRoute.surveyFormRegistrationRoute) { | ||
SurveyRegistrationScreen( | ||
navigateToManagement = navigateToManagement, | ||
) | ||
} | ||
|
||
composable( | ||
route = ManagementSurveyRoute.surveyFormEditRoute("{id}"), | ||
arguments = listOf( | ||
navArgument("id") { | ||
type = NavType.StringType | ||
}, | ||
), | ||
) { navBackStackEntry -> | ||
val surveyFormId = navBackStackEntry.arguments?.getString("id") ?: "" | ||
SurveyFormEditScreen( | ||
surveyFormId = surveyFormId, | ||
navigateToManagement = navigateToManagement, | ||
) | ||
} | ||
} | ||
|
||
object ManagementSurveyRoute { | ||
const val surveyFormRegistrationRoute = "surveyForm/registration" | ||
|
||
fun surveyFormEditRoute(surveyFormId: String) = "surveyForm/edit/$surveyFormId" | ||
} |
24 changes: 0 additions & 24 deletions
24
.../wap/wapp/feature/management/survey/registration/navigation/ManagementSurveyNavigation.kt
This file was deleted.
Oops, something went wrong.