Skip to content

Commit

Permalink
[feature/login_term] 네비게이션 로직 수정 (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
SsongSik committed Aug 28, 2023
1 parent 4119f2f commit c2a61de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import kotlinx.coroutines.flow.collectLatest

@Composable
fun CertificationScreen(
navController: NavController,
loginViewModel: LoginViewModel = hiltViewModel(),
navigateToTermScreen: () -> Unit,
) {
Expand Down Expand Up @@ -82,10 +81,10 @@ fun CertificationScreen(
}

LaunchedEffect(key1 = loginViewModel.effect) {
loginViewModel.effect.collectLatest { effect ->
loginViewModel.effect.collect { effect ->
when (effect) {
is LoginContract.LoginEffect.MoveToTerm -> {
navController.navigate(LoginNaviRoute.TermScreen.route)
navigateToTermScreen()
}
is LoginContract.LoginEffect.FailCertification -> {
/*
Expand Down Expand Up @@ -218,9 +217,7 @@ fun LoginPhoneTextField(
@Preview
@Composable
fun LoginScreenPreview() {
CertificationScreen(
navController = rememberNavController(),
) {
CertificationScreen() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.meongmoryteam.presentation.ui.register_family.RegisterFamilyNavigation
import com.meongmoryteam.presentation.ui.theme.MeongmoryTheme
import com.meongmoryteam.presentation.ui.theme.White
import dagger.hilt.android.AndroidEntryPoint

sealed class LoginNaviRoute(val route: String) {
Expand All @@ -30,7 +34,9 @@ class LoginActivity : ComponentActivity() {
private fun setUnivSelectScreen() {
setContent {
MeongmoryTheme {
LoginNavigation()
Surface(color = White, modifier = Modifier.fillMaxSize()) {
LoginNavigation()
}
}
}
}
Expand All @@ -55,7 +61,6 @@ fun LoginNavigation(
) {
composable(route = LoginNaviRoute.CertificationScreen.route) {
CertificationScreen(
navController = navController,
navigateToTermScreen = { navController.navigate(LoginNaviRoute.TermScreen.route) }
)
}
Expand Down

0 comments on commit c2a61de

Please sign in to comment.