Skip to content

Commit

Permalink
refactor :: navigation 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
parkuiery committed Oct 11, 2024
1 parent 71a5604 commit 1a657a5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ internal fun NavGraphBuilder.authNavigation(
signIn(
navigateToMain = { },
navigateToSignUp = { },
navigateToFindId = { },
navigateToFindPassword = { },
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ const val NAVIGATION_SIGN_IN = "signIn"
fun NavGraphBuilder.signIn(
navigateToMain: () -> Unit,
navigateToSignUp: () -> Unit,
navigateToFindId: () -> Unit,
navigateToFindPassword: () -> Unit,
) {
composable(NAVIGATION_SIGN_IN) {
SignIn()
SignIn(
navigateToMain = navigateToMain,
navigateToSignUp = navigateToSignUp,
navigateToFindId = navigateToFindId,
navigateToFindPassword = navigateToFindPassword,
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,18 @@ import team.aliens.dms.kmp.feature.signin.viewmodel.SignInState
import team.aliens.dms.kmp.feature.signin.viewmodel.SignInViewModel

@Composable
internal fun SignIn() {
internal fun SignIn(
navigateToMain: () -> Unit,
navigateToSignUp: () -> Unit,
navigateToFindId: () -> Unit,
navigateToFindPassword: () -> Unit,
) {
val viewModel: SignInViewModel = koinInject()
val state by viewModel.state.collectAsState()

SignInScreen(
navigateToMain = navigateToMain,
navigateToSignUp = navigateToSignUp,
state = state,
onAccountIdChange = viewModel::setAccountId,
onPasswordChange = viewModel::setPassword,
Expand All @@ -44,6 +51,8 @@ internal fun SignIn() {

@Composable
fun SignInScreen(
navigateToMain: () -> Unit,
navigateToSignUp: () -> Unit,
state: SignInState,
onAccountIdChange: (String) -> Unit,
onPasswordChange: (String) -> Unit,
Expand Down Expand Up @@ -85,7 +94,7 @@ fun SignInScreen(
.horizontalPadding()
.bottomPadding(16.dp),
text = "회원가입 하기",
onClick = { },
onClick = navigateToSignUp,
)
}
}
Expand Down

0 comments on commit 1a657a5

Please sign in to comment.