Skip to content

Commit

Permalink
#6 [REFACTOR] 그룹 초대 확인 네비게이션 로직 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
youjin09222 committed Jan 3, 2025
1 parent 752a7b9 commit 7a1dab4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,8 @@ fun CheckInviteRoute(
}
CheckInviteScreen(
name = name,
onNoInViteTextClick = {
checkInviteViewModel.navigateToGroup()
},
onInputGroupCodeClick = {
checkInviteViewModel.navigateToInputGroupCode()
}
onNoInViteTextClick = checkInviteViewModel::navigateToGroup,
onInputGroupCodeClick = checkInviteViewModel::navigateToInputGroupCode
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import androidx.navigation.compose.composable
import androidx.navigation.toRoute
import com.sopt.core.navigation.Route
import com.sopt.presentation.auth.signup.checkInvite.CheckInviteRoute
import com.sopt.presentation.auth.signup.inputGroupCode.navigation.navigateInputGroupCode
import com.sopt.presentation.group.navigation.navigateGroup
import kotlinx.serialization.Serializable

fun NavController.navigateCheckInvite(
Expand All @@ -20,15 +22,14 @@ fun NavController.navigateCheckInvite(
}

fun NavGraphBuilder.checkInviteNavGraph(
navigateToGroup: () -> Unit,
navigateToInputGroupCode: () -> Unit,
navHostController: NavController
) {
composable<CheckInvite> {
val args = it.toRoute<CheckInvite>()
CheckInviteRoute(
name = args.name,
navigateToGroup = navigateToGroup,
navigateToInputGroupCode = navigateToInputGroupCode,
navigateToGroup = { navHostController.navigateGroup() },
navigateToInputGroupCode = { navHostController.navigateInputGroupCode() }
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,7 @@ fun MainScreen(
)
loginNavGraph(navHostController = navigator.navController)
signUpNavGraph(navHostController = navigator.navController)
checkInviteNavGraph(
navigateToGroup = {
navigator.navController.navigateGroup()
},
navigateToInputGroupCode = {
navigator.navController.navigateInputGroupCode()
}
)
checkInviteNavGraph(navHostController = navigator.navController)
inputGroupCodeNavGraph(
navigateUp = {
navigator.navController.navigateUp()
Expand Down

0 comments on commit 7a1dab4

Please sign in to comment.