Skip to content

Commit

Permalink
[feature/#1011] 다이얼로그 navigation 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeyubin committed Jan 1, 2025
1 parent 7245528 commit fc41b4f
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.activity.viewModels
Expand All @@ -51,6 +52,7 @@ import org.sopt.official.auth.model.UserStatus
import org.sopt.official.common.di.Auth
import org.sopt.official.designsystem.SoptTheme
import org.sopt.official.feature.home.HomeActivity
import org.sopt.official.feature.mypage.web.WebUrlConstant
import org.sopt.official.network.model.response.OAuthToken
import org.sopt.official.network.persistence.SoptDataStore
import javax.inject.Inject
Expand Down Expand Up @@ -145,7 +147,8 @@ class AuthActivity : AppCompatActivity() {
}
}
}
}
},
navigateToChannel = { startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(WebUrlConstant.OPINION_KAKAO_CHAT))) }
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.sopt.official.feature.auth.feature.certificate.navigation.navigateCer
internal fun AuthScreen(
navigateToUnAuthenticatedHome: () -> Unit,
onGoogleLoginCLick: () -> Unit,
navigateToChannel:() -> Unit,
navController: NavHostController = rememberNavController(),
) {
Scaffold(
Expand All @@ -44,7 +45,9 @@ internal fun AuthScreen(
},
navigateToCertification = {
navController.navigateCertification()
}
},
navigateToChannel = navigateToChannel

)
certificationNavGraph()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ import org.sopt.official.designsystem.SoptTheme
@Composable
internal fun LoginErrorDialog(
onDismissRequest: () -> Unit,
onFindAccountClick: () -> Unit,
onResetAccountClick: () -> Unit,
onContactChannelClick: () -> Unit,
modifier: Modifier = Modifier,
) {
Popup {
Expand All @@ -81,17 +84,17 @@ internal fun LoginErrorDialog(
Spacer(modifier = Modifier.height(12.dp))
LoginDialogText(
text = "로그인한 계정을 알고 싶어요.",
onClick = {}
onClick = onFindAccountClick
)
Spacer(modifier = Modifier.height(4.dp))
LoginDialogText(
text = "소셜 계정을 재설정하고 싶어요.",
onClick = {}
onClick = onResetAccountClick
)
Spacer(modifier = Modifier.height(4.dp))
LoginDialogText(
text = "카카오톡 채널에 문의할게요.",
onClick = {}
onClick = onContactChannelClick
)
}
}
Expand Down Expand Up @@ -148,7 +151,10 @@ private fun LoginDialogText(
private fun LoginErrorDialogPreview() {
SoptTheme {
LoginErrorDialog(
onDismissRequest = {}
onDismissRequest = {},
onFindAccountClick = {},
onResetAccountClick = {},
onContactChannelClick = {}
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,27 @@ internal fun AuthMainRoute(
viewModel: AuthViewModel = hiltViewModel(),
navigateToUnAuthenticatedHome: () -> Unit,
onGoogleLoginCLick: () -> Unit,
navigateToCertification: () -> Unit
navigateToCertification: () -> Unit,
navigateToChannel: () -> Unit
) {
var loginDialogVisibility by remember { mutableStateOf(false) }

if (loginDialogVisibility) {
LoginErrorDialog(
onDismissRequest = {
loginDialogVisibility = false
},
onFindAccountClick = {
navigateToCertification()
loginDialogVisibility = false
},
onResetAccountClick = {
navigateToCertification()
loginDialogVisibility = false
},
onContactChannelClick = {
navigateToChannel()
loginDialogVisibility = false
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ import org.sopt.official.feature.auth.feature.authmain.AuthMainRoute
fun NavGraphBuilder.authMainNavGraph(
navigateToUnAuthenticatedHome: () -> Unit,
onGoogleLoginCLick: () -> Unit,
navigateToCertification: () -> Unit
navigateToCertification: () -> Unit,
navigateToChannel:()-> Unit
) {
composable<AuthMainNavigation> {
AuthMainRoute(
navigateToUnAuthenticatedHome = navigateToUnAuthenticatedHome,
onGoogleLoginCLick = onGoogleLoginCLick,
navigateToCertification = navigateToCertification
navigateToCertification = navigateToCertification,
navigateToChannel = navigateToChannel
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@ import kotlinx.coroutines.launch
import org.sopt.official.domain.auth.model.InformationWithCode
import org.sopt.official.domain.auth.model.InitialInformation
import org.sopt.official.domain.auth.repository.AuthRepository
import org.sopt.official.feature.auth.model.AuthStatus
import javax.inject.Inject

enum class CertificationType(val type: String) {
REGISTER("REGISTER"),
CHANGE("CHANGE"),
SEARCH("SEARCH")
}

@HiltViewModel
class CertificationViewModel @Inject constructor(
private val repository: AuthRepository
Expand All @@ -31,7 +26,7 @@ class CertificationViewModel @Inject constructor(
InitialInformation(
name = "Mock-Success-Register",
phone = "01012345678",
type = CertificationType.REGISTER.type
type = AuthStatus.REGISTER.type
)
).onSuccess {
_sideEffect.emit(CertificationSideEffect.ShowToast("성공!!!"))
Expand All @@ -48,7 +43,7 @@ class CertificationViewModel @Inject constructor(
name = "Mock-Success-Register",
phone = "01012345678",
code = "123456",
type = CertificationType.REGISTER.type
type = AuthStatus.REGISTER.type
)
).onSuccess {
_sideEffect.emit(CertificationSideEffect.ShowToast("성공!!!"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.sopt.official.feature.auth.model

enum class AuthStatus(val type: String) {
REGISTER("REGISTER"),
CHANGE("CHANGE"),
SEARCH("SEARCH")
}

0 comments on commit fc41b4f

Please sign in to comment.