Skip to content

Commit

Permalink
[FEATURE] #63 : 더 보기 화면에서 뒤로가기 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Dec 27, 2023
1 parent eefc03e commit e0fcaab
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
12 changes: 11 additions & 1 deletion app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ import com.wap.wapp.feature.management.registration.survey.navigation.navigateTo
import com.wap.wapp.feature.management.registration.survey.navigation.surveyRegistrationScreen
import com.wap.wapp.feature.notice.navigation.navigateToNotice
import com.wap.wapp.feature.notice.navigation.noticeScreen
import com.wap.wapp.feature.profile.navigation.navigateToProfile
import com.wap.wapp.feature.profile.navigation.profileNavigationRoute
import com.wap.wapp.feature.profile.navigation.profileScreen
import com.wap.wapp.feature.profile.profilesetting.navigation.navigateToProfileSetting
import com.wap.wapp.feature.profile.profilesetting.navigation.profileSettingNavigationRoute
import com.wap.wapp.feature.profile.profilesetting.navigation.profileSettingScreen
import com.wap.wapp.feature.splash.navigation.splashNavigationRoute
import com.wap.wapp.feature.splash.navigation.splashScreen
Expand Down Expand Up @@ -86,7 +88,15 @@ fun WappNavHost(
)
},
)
profileSettingScreen()
profileSettingScreen(
navigateToProfile = {
navController.navigateToProfile(
navOptions {
popUpTo(profileSettingNavigationRoute) { inclusive = true }
},
)
},
)
managementScreen(
navigateToSurveyRegistration = navController::navigateToSurveyRegistration,
navigateToEventRegistration = navController::navigateToEventRegistration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ import com.wap.wapp.feature.profile.R.string

@Composable
internal fun ProfileSettingRoute(
navigateToProfile: () -> Unit,
viewModel: ProfileSettingViewModel = hiltViewModel(),
) {
ProfileSettingScreen()
ProfileSettingScreen(navigateToProfile)
}

@Composable
internal fun ProfileSettingScreen(
navigateToProfile: () -> Unit,
onClickedAlarmSetting: () -> Unit = {},
onClickedSignout: () -> Unit = {},
onClickedWithdrawal: () -> Unit = {},
Expand All @@ -50,7 +52,7 @@ internal fun ProfileSettingScreen(
WappTopBar(
titleRes = string.more,
showLeftButton = true,
onClickLeftButton = {},
onClickLeftButton = navigateToProfile,
modifier = Modifier.padding(top = 20.dp),
)

Expand Down Expand Up @@ -159,5 +161,5 @@ internal fun ProfileSettingScreen(
@Preview
@Composable
fun PreviewProfileMoreScreen() {
ProfileSettingScreen()
ProfileSettingScreen(navigateToProfile = {})
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ fun NavController.navigateToProfileSetting(navOptions: NavOptions? = navOptions
this.navigate(profileSettingNavigationRoute, navOptions)
}

fun NavGraphBuilder.profileSettingScreen() {
fun NavGraphBuilder.profileSettingScreen(navigateToProfile: () -> Unit) {
composable(route = profileSettingNavigationRoute) {
ProfileSettingRoute()
ProfileSettingRoute(navigateToProfile)
}
}

0 comments on commit e0fcaab

Please sign in to comment.