diff --git a/Projects/Feature/SigninFeature/Project.swift b/Projects/Feature/SigninFeature/Project.swift index 7bde5f1..048b497 100644 --- a/Projects/Feature/SigninFeature/Project.swift +++ b/Projects/Feature/SigninFeature/Project.swift @@ -9,7 +9,8 @@ let project = Project.module( .implements(module: .feature(.SigninFeature), dependencies: [ .feature(target: .SigninFeature, type: .interface), .feature(target: .BaseFeature), - .feature(target: .SignupFeature, type: .interface) + .feature(target: .SignupFeature, type: .interface), + .feature(target: .FindPasswordFeature, type: .interface) ]), .tests(module: .feature(.SigninFeature), dependencies: [ .feature(target: .SigninFeature) diff --git a/Projects/Feature/SigninFeature/Sources/SigninComponent.swift b/Projects/Feature/SigninFeature/Sources/SigninComponent.swift index d5d2bc9..1c3e783 100644 --- a/Projects/Feature/SigninFeature/Sources/SigninComponent.swift +++ b/Projects/Feature/SigninFeature/Sources/SigninComponent.swift @@ -2,16 +2,19 @@ import SwiftUI import NeedleFoundation import SigninFeatureInterface import SignupFeatureInterface +import FindPasswordFeatureInterface public protocol SigninDependency: Dependency { var signupEmailFactory: any SignupEmailFactory { get } + var inputEmailFactory: any InputEmailFactory { get } } public final class SigninComponent: Component, SigninFactory { public func makeView() -> some View { SigninView( viewModel: .init(), - signupEmailFactory: dependency.signupEmailFactory + signupEmailFactory: dependency.signupEmailFactory, + inputEmailFactory: dependency.inputEmailFactory ) } } diff --git a/Projects/Feature/SigninFeature/Sources/SigninView.swift b/Projects/Feature/SigninFeature/Sources/SigninView.swift index ad9b48f..0bee470 100644 --- a/Projects/Feature/SigninFeature/Sources/SigninView.swift +++ b/Projects/Feature/SigninFeature/Sources/SigninView.swift @@ -3,6 +3,7 @@ import SwiftUI import BaseFeature import ViewUtil import SignupFeatureInterface +import FindPasswordFeatureInterface struct SigninView: View { private enum FocusField { @@ -13,13 +14,16 @@ struct SigninView: View { @StateObject var viewModel: SigninViewModel private let signupEmailFactory: any SignupEmailFactory + private let inputEmailFactory: any InputEmailFactory init( viewModel: SigninViewModel, - signupEmailFactory: any SignupEmailFactory + signupEmailFactory: any SignupEmailFactory, + inputEmailFactory: any InputEmailFactory ) { _viewModel = StateObject(wrappedValue: viewModel) self.signupEmailFactory = signupEmailFactory + self.inputEmailFactory = inputEmailFactory } var body: some View { @@ -63,13 +67,24 @@ struct SigninView: View { Color.Grays.gray700 .frame(width: 1, height: 16) - Text("비밀번호 찾기") - .kgFont(.label, weight: .regular, color: .Grays.gray700) + Button(action: viewModel.findPasswordButtonDidTap) { + Text("비밀번호 찾기") + .kgFont(.label, weight: .regular, color: .Grays.gray700) + } } } Spacer() } - .navigate(to: signupEmailFactory.makeView().eraseToAnyView(), when: $viewModel.isNavigatedToSignup) + .hideKeyboardWhenTap() + .navigate( + to: signupEmailFactory.makeView().eraseToAnyView(), + when: $viewModel.isNavigatedToSignup + ) + .navigate( + to: inputEmailFactory.makeView().eraseToAnyView() + .environment(\.rootPresentationMode, $viewModel.isNavigatedToFindPassword), + when: $viewModel.isNavigatedToFindPassword + ) } } diff --git a/Projects/Feature/SigninFeature/Sources/SigninViewModel.swift b/Projects/Feature/SigninFeature/Sources/SigninViewModel.swift index ca3ec76..4e89503 100644 --- a/Projects/Feature/SigninFeature/Sources/SigninViewModel.swift +++ b/Projects/Feature/SigninFeature/Sources/SigninViewModel.swift @@ -6,6 +6,7 @@ final class SigninViewModel: BaseViewModel { @Published var password: String = "" @Published var isNavigatedToSignup: Bool = false + @Published var isNavigatedToFindPassword: Bool = false func signinButtonDidTap() { print("Signin") @@ -14,4 +15,8 @@ final class SigninViewModel: BaseViewModel { func signupButtonDidTap() { self.isNavigatedToSignup = true } + + func findPasswordButtonDidTap() { + self.isNavigatedToFindPassword = true + } } diff --git a/Projects/Feature/SignupFeature/Interface/SignupAuthCodeVerifyFactory.swift b/Projects/Feature/SignupFeature/Interface/SignupVerifyAuthCodeFactory.swift similarity index 100% rename from Projects/Feature/SignupFeature/Interface/SignupAuthCodeVerifyFactory.swift rename to Projects/Feature/SignupFeature/Interface/SignupVerifyAuthCodeFactory.swift