Skip to content

Commit

Permalink
feat: 회원가입 데이터를 공유하기 위한 viewmodel 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
kang9366 committed Mar 3, 2024
1 parent 93f5414 commit 6ad45c4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import com.kusitms.connectdog.core.designsystem.theme.Orange_40
import com.kusitms.connectdog.core.designsystem.theme.PetOrange
import com.kusitms.connectdog.core.util.UserType
import com.kusitms.connectdog.signup.viewmodel.RegisterPasswordViewModel
import com.kusitms.connectdog.signup.viewmodel.SignUpViewModel

@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
@Composable
Expand All @@ -45,6 +46,7 @@ fun RegisterPasswordScreen(
onNavigateToIntermediatorProfile: () -> Unit,
userType: UserType,
imeHeight: Int,
signUpViewModel: SignUpViewModel,
viewModel: RegisterPasswordViewModel = hiltViewModel()
) {
val focusManager = LocalFocusManager.current
Expand Down Expand Up @@ -127,6 +129,7 @@ fun RegisterPasswordScreen(
},
onClick = {
if (isValidPassword == false && isValidConfirmPassword == false) {
signUpViewModel.updatePassword(viewModel.password)
when (userType) {
UserType.INTERMEDIATOR -> onNavigateToIntermediatorProfile()
else -> onNavigateToVolunteerProfile()
Expand All @@ -143,6 +146,6 @@ fun RegisterPasswordScreen(
@Composable
private fun Preview() {
ConnectDogTheme {
RegisterPasswordScreen({}, {}, {}, UserType.INTERMEDIATOR, 10)
RegisterPasswordScreen({}, {}, {}, UserType.INTERMEDIATOR, 10, hiltViewModel())
}
}

0 comments on commit 6ad45c4

Please sign in to comment.