From 81a179cfac896c714f346a18a489e7ddac866fb3 Mon Sep 17 00:00:00 2001 From: sian7563 Date: Wed, 26 Oct 2022 18:54:56 +0900 Subject: [PATCH 01/15] =?UTF-8?q?feat=20::=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=9C=84=EC=B9=98=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SignupFeature/Sources/{ => SchoolCode}/PasscodeView.swift | 0 .../Sources/{ => SchoolCode}/SchoolCodeComponent.swift | 0 .../SignupFeature/Sources/{ => SchoolCode}/SchoolCodeView.swift | 0 .../Sources/{ => SchoolCode}/SchoolCodeViewModel.swift | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename Projects/Features/SignupFeature/Sources/{ => SchoolCode}/PasscodeView.swift (100%) rename Projects/Features/SignupFeature/Sources/{ => SchoolCode}/SchoolCodeComponent.swift (100%) rename Projects/Features/SignupFeature/Sources/{ => SchoolCode}/SchoolCodeView.swift (100%) rename Projects/Features/SignupFeature/Sources/{ => SchoolCode}/SchoolCodeViewModel.swift (100%) diff --git a/Projects/Features/SignupFeature/Sources/PasscodeView.swift b/Projects/Features/SignupFeature/Sources/SchoolCode/PasscodeView.swift similarity index 100% rename from Projects/Features/SignupFeature/Sources/PasscodeView.swift rename to Projects/Features/SignupFeature/Sources/SchoolCode/PasscodeView.swift diff --git a/Projects/Features/SignupFeature/Sources/SchoolCodeComponent.swift b/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeComponent.swift similarity index 100% rename from Projects/Features/SignupFeature/Sources/SchoolCodeComponent.swift rename to Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeComponent.swift diff --git a/Projects/Features/SignupFeature/Sources/SchoolCodeView.swift b/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift similarity index 100% rename from Projects/Features/SignupFeature/Sources/SchoolCodeView.swift rename to Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift diff --git a/Projects/Features/SignupFeature/Sources/SchoolCodeViewModel.swift b/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeViewModel.swift similarity index 100% rename from Projects/Features/SignupFeature/Sources/SchoolCodeViewModel.swift rename to Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeViewModel.swift From d7e878bc30ef4b053fe81faad900600ddb9825f5 Mon Sep 17 00:00:00 2001 From: sian7563 Date: Thu, 27 Oct 2022 00:49:28 +0900 Subject: [PATCH 02/15] =?UTF-8?q?feat=20::=20SchoolConfirmationQuestionsCo?= =?UTF-8?q?mponent=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SchoolConfirmationQuestionsComponent.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsComponent.swift diff --git a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsComponent.swift b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsComponent.swift new file mode 100644 index 00000000..e5344a10 --- /dev/null +++ b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsComponent.swift @@ -0,0 +1,17 @@ +import DomainModule +import NeedleFoundation +import SwiftUI + +public protocol SchoolConfirmationQuestionsDependency: Dependency { + var checkSchoolQuestionUseCase: any CheckSchoolQuestionUseCase { get } +} + +public final class SchoolConfirmationQuestionsComponent: Component { + public func makeView() -> some View { + SchoolConfirmationQuestionsView( + viewModel: .init( + checkSchoolQuestionUseCase: dependency.checkSchoolQuestionUseCase + ) + ) + } +} From 6da83a2f7825fccd8335079b6edd2fc68147c237 Mon Sep 17 00:00:00 2001 From: sian7563 Date: Thu, 27 Oct 2022 00:49:59 +0900 Subject: [PATCH 03/15] =?UTF-8?q?feat=20::=20SchoolConfirmationQuestionsVi?= =?UTF-8?q?ew=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SchoolConfirmationQuestionsView.swift | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift diff --git a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift new file mode 100644 index 00000000..77076dfa --- /dev/null +++ b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift @@ -0,0 +1,73 @@ +import SwiftUI +import DesignSystem + +struct SchoolConfirmationQuestionsView: View { + private enum FocusField { + case id + case password + } + @FocusState private var focusField: FocusField? + @StateObject var viewModel: SchoolConfirmationQuestionsViewModel + + public init(viewModel: SchoolConfirmationQuestionsViewModel) { + _viewModel = StateObject(wrappedValue: viewModel) + } + var body: some View { + VStack { + HStack { + VStack(alignment: .leading, spacing: 8) { + Text("DMS") + .dmsFont(.title(.extraLarge), color: .PrimaryVariant.primary) + .padding(.top, 28) + + Text("학교 확인 질문") + .dmsFont(.text(.medium), color: .GrayScale.gray6) + + Text("우리 학교 학생 수는?") + .dmsFont(.text(.large), color: .GrayScale.gray7) + .padding(.top, 50) + }.padding(.horizontal, 24) + + Spacer() + } + + VStack(spacing: 72) { + DMSFloatingTextField( + "답변", + text: $viewModel.id, + isError: viewModel.isErrorOcuured + ) + .textContentType(.username) + .focused($focusField, equals: .id) + } + .padding(.top, 42) + .padding(.horizontal, 24) + + Spacer() + + HStack(spacing: 16) { + Text("이미 계정이 있으신가요?") + .dmsFont(.text(.extraSmall), color: .GrayScale.gray5) + + DMSButton(text: "로그인", style: .text, color: .GrayScale.gray6) { + viewModel.isNavigateCheckConfirmationQuestion.toggle() + } + } + + DMSWideButton(text: "확인", color: .PrimaryVariant.primary) { + viewModel.confirmButtonDidTap() + } + .disabled(!viewModel.isSignupButtonEnabled) + .padding(.top, 24) + .frame(maxWidth: .infinity) + .padding(.bottom, 40) + .padding(.horizontal, 24) + } + } +} + +struct SchoolConfirmationQuestionsView_Previews: PreviewProvider { + static var previews: some View { + Text("A") + } +} From 1e99fbd6d873c26e508e47ae24effc21067c00cf Mon Sep 17 00:00:00 2001 From: sian7563 Date: Thu, 27 Oct 2022 00:50:26 +0900 Subject: [PATCH 04/15] =?UTF-8?q?feat=20::=20SchoolConfirmationQuestionsVi?= =?UTF-8?q?ewModel=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...SchoolConfirmationQuestionsViewModel.swift | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsViewModel.swift diff --git a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsViewModel.swift b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsViewModel.swift new file mode 100644 index 00000000..ef97b72e --- /dev/null +++ b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsViewModel.swift @@ -0,0 +1,32 @@ +import BaseFeature +import Combine +import DomainModule + +final class SchoolConfirmationQuestionsViewModel: BaseViewModel { + @Published var id = "" + @Published var answer = "" + @Published var isDisabled = true + @Published var isNavigateCheckConfirmationQuestion = false + + var isSignupButtonEnabled: Bool { + !id.isEmpty + } + + private let checkSchoolQuestionUseCase: any CheckSchoolQuestionUseCase + + public init(checkSchoolQuestionUseCase: any CheckSchoolQuestionUseCase) { + self.checkSchoolQuestionUseCase = checkSchoolQuestionUseCase + } + + func confirmButtonDidTap() { + guard isSignupButtonEnabled else { return } + addCancellable( + checkSchoolQuestionUseCase.execute( + schoolID: id, + answer: answer + ) + ) { [weak self] _ in + self?.isNavigateCheckConfirmationQuestion = true + } + } +} From 28e001ce96a68a410996ccd5211b1e1e99e6ee97 Mon Sep 17 00:00:00 2001 From: sian7563 Date: Thu, 27 Oct 2022 00:50:46 +0900 Subject: [PATCH 05/15] feat :: NeedleGenerated --- .../Sources/Application/NeedleGenerated.swift | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Projects/App/Sources/Application/NeedleGenerated.swift b/Projects/App/Sources/Application/NeedleGenerated.swift index aeab5b94..b8a1a032 100644 --- a/Projects/App/Sources/Application/NeedleGenerated.swift +++ b/Projects/App/Sources/Application/NeedleGenerated.swift @@ -24,6 +24,19 @@ private func parent1(_ component: NeedleFoundation.Scope) -> NeedleFoundation.Sc #if !NEEDLE_DYNAMIC +private class SchoolConfirmationQuestionsDependency3fa2ccd12da7c7f5cfc1Provider: SchoolConfirmationQuestionsDependency { + var checkSchoolQuestionUseCase: any CheckSchoolQuestionUseCase { + return appComponent.checkSchoolQuestionUseCase + } + private let appComponent: AppComponent + init(appComponent: AppComponent) { + self.appComponent = appComponent + } +} +/// ^->AppComponent->SchoolConfirmationQuestionsComponent +private func factoryd462667f0418a53210fcf47b58f8f304c97af4d5(_ component: NeedleFoundation.Scope) -> AnyObject { + return SchoolConfirmationQuestionsDependency3fa2ccd12da7c7f5cfc1Provider(appComponent: parent1(component) as! AppComponent) +} private class SchoolCodeDependencyc0114744c1c8c7843672Provider: SchoolCodeDependency { var checkSchoolCodeUseCase: any CheckSchoolCodeUseCase { return appComponent.checkSchoolCodeUseCase @@ -94,6 +107,7 @@ extension AppComponent: Registration { localTable["schoolCodeComponent-SchoolCodeComponent"] = { self.schoolCodeComponent as Any } localTable["findIDComponent-FindIDComponent"] = { self.findIDComponent as Any } localTable["signinComponent-SigninComponent"] = { self.signinComponent as Any } + localTable["schoolConfirmationQuestionsComponent-SchoolConfirmationQuestionsComponent"] = { self.schoolConfirmationQuestionsComponent as Any } localTable["mainTabComponent-MainTabComponent"] = { self.mainTabComponent as Any } localTable["remoteStudentsDataSource-any RemoteStudentsDataSource"] = { self.remoteStudentsDataSource as Any } localTable["studentsRepository-any StudentsRepository"] = { self.studentsRepository as Any } @@ -111,6 +125,11 @@ extension AppComponent: Registration { localTable["checkSchoolCodeUseCase-any CheckSchoolCodeUseCase"] = { self.checkSchoolCodeUseCase as Any } } } +extension SchoolConfirmationQuestionsComponent: Registration { + public func registerItems() { + keyPathToName[\SchoolConfirmationQuestionsDependency.checkSchoolQuestionUseCase] = "checkSchoolQuestionUseCase-any CheckSchoolQuestionUseCase" + } +} extension SchoolCodeComponent: Registration { public func registerItems() { keyPathToName[\SchoolCodeDependency.checkSchoolCodeUseCase] = "checkSchoolCodeUseCase-any CheckSchoolCodeUseCase" @@ -119,7 +138,6 @@ extension SchoolCodeComponent: Registration { extension MainTabComponent: Registration { public func registerItems() { - } } extension SigninComponent: Registration { @@ -150,6 +168,7 @@ private func registerProviderFactory(_ componentPath: String, _ factory: @escapi private func register1() { registerProviderFactory("^->AppComponent", factoryEmptyDependencyProvider) + registerProviderFactory("^->AppComponent->SchoolConfirmationQuestionsComponent", factoryd462667f0418a53210fcf47b58f8f304c97af4d5) registerProviderFactory("^->AppComponent->SchoolCodeComponent", factoryb65c1efbf06b87162473f47b58f8f304c97af4d5) registerProviderFactory("^->AppComponent->MainTabComponent", factory1ab5a747ddf21e1393f9e3b0c44298fc1c149afb) registerProviderFactory("^->AppComponent->SigninComponent", factory2882a056d84a613debccf47b58f8f304c97af4d5) From 487235a21d72fcbb41f5b4e0ca4db5b6898137fa Mon Sep 17 00:00:00 2001 From: sian7563 Date: Thu, 27 Oct 2022 00:51:03 +0900 Subject: [PATCH 06/15] =?UTF-8?q?feat=20::=20AppComponent=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/App/Sources/Application/DI/AppComponent.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Projects/App/Sources/Application/DI/AppComponent.swift b/Projects/App/Sources/Application/DI/AppComponent.swift index c7c9a5c9..ef595156 100644 --- a/Projects/App/Sources/Application/DI/AppComponent.swift +++ b/Projects/App/Sources/Application/DI/AppComponent.swift @@ -29,6 +29,9 @@ public extension AppComponent { var signinComponent: SigninComponent { SigninComponent(parent: self) } + var schoolConfirmationQuestionsComponent: SchoolConfirmationQuestionsComponent { + SchoolConfirmationQuestionsComponent(parent: self) + } } // MARK: - Main From f414d4998ffde2f874bd6ebb388e9d92ed95e459 Mon Sep 17 00:00:00 2001 From: sian7563 Date: Thu, 27 Oct 2022 12:00:39 +0900 Subject: [PATCH 07/15] =?UTF-8?q?feat=20::=20SchoolConfirmationQuestionsVi?= =?UTF-8?q?ew=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SchoolConfirmationQuestionsView.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift index 77076dfa..38fdfd1b 100644 --- a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift +++ b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift @@ -47,22 +47,25 @@ struct SchoolConfirmationQuestionsView: View { HStack(spacing: 16) { Text("이미 계정이 있으신가요?") - .dmsFont(.text(.extraSmall), color: .GrayScale.gray5) + .dmsFont(.text(.small), color: .GrayScale.gray5) DMSButton(text: "로그인", style: .text, color: .GrayScale.gray6) { - viewModel.isNavigateCheckConfirmationQuestion.toggle() } } DMSWideButton(text: "확인", color: .PrimaryVariant.primary) { viewModel.confirmButtonDidTap() } - .disabled(!viewModel.isSignupButtonEnabled) + .disabled(!viewModel.isConfirmButtonEnabled) .padding(.top, 24) .frame(maxWidth: .infinity) .padding(.bottom, 40) .padding(.horizontal, 24) } + .dmsToast(isShowing: $viewModel.isErrorOcuured, message: viewModel.errorMessage, style: .error) + .frame(maxWidth: .infinity) + .dmsBackground() + .ignoresSafeArea(.keyboard, edges: .bottom) } } From b8dd6409d007083558485c7a38b42b65ebc15252 Mon Sep 17 00:00:00 2001 From: sian7563 Date: Thu, 27 Oct 2022 12:00:59 +0900 Subject: [PATCH 08/15] =?UTF-8?q?feat=20::=20ViewModel=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SchoolConfirmationQuestionsViewModel.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsViewModel.swift b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsViewModel.swift index ef97b72e..c3eb5d3b 100644 --- a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsViewModel.swift +++ b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsViewModel.swift @@ -6,9 +6,8 @@ final class SchoolConfirmationQuestionsViewModel: BaseViewModel { @Published var id = "" @Published var answer = "" @Published var isDisabled = true - @Published var isNavigateCheckConfirmationQuestion = false - var isSignupButtonEnabled: Bool { + var isConfirmButtonEnabled: Bool { !id.isEmpty } @@ -19,14 +18,13 @@ final class SchoolConfirmationQuestionsViewModel: BaseViewModel { } func confirmButtonDidTap() { - guard isSignupButtonEnabled else { return } + guard isConfirmButtonEnabled else { return } addCancellable( checkSchoolQuestionUseCase.execute( schoolID: id, answer: answer ) ) { [weak self] _ in - self?.isNavigateCheckConfirmationQuestion = true } } } From 8d9a7ed5d1a33c1f5be266117646c3c882b360b1 Mon Sep 17 00:00:00 2001 From: sian7563 Date: Thu, 27 Oct 2022 12:05:28 +0900 Subject: [PATCH 09/15] =?UTF-8?q?feat=20::=20SchoolConfirmationQuestionsVi?= =?UTF-8?q?ew=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SchoolConfirmationQuestionsView.swift | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift index 38fdfd1b..6a8a111c 100644 --- a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift +++ b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift @@ -2,11 +2,6 @@ import SwiftUI import DesignSystem struct SchoolConfirmationQuestionsView: View { - private enum FocusField { - case id - case password - } - @FocusState private var focusField: FocusField? @StateObject var viewModel: SchoolConfirmationQuestionsViewModel public init(viewModel: SchoolConfirmationQuestionsViewModel) { @@ -18,7 +13,6 @@ struct SchoolConfirmationQuestionsView: View { VStack(alignment: .leading, spacing: 8) { Text("DMS") .dmsFont(.title(.extraLarge), color: .PrimaryVariant.primary) - .padding(.top, 28) Text("학교 확인 질문") .dmsFont(.text(.medium), color: .GrayScale.gray6) @@ -26,19 +20,22 @@ struct SchoolConfirmationQuestionsView: View { Text("우리 학교 학생 수는?") .dmsFont(.text(.large), color: .GrayScale.gray7) .padding(.top, 50) - }.padding(.horizontal, 24) + } + + .padding(.horizontal, 24) Spacer() } + .padding(.top, 28) + VStack(spacing: 72) { DMSFloatingTextField( "답변", - text: $viewModel.id, + text: $viewModel.answer, isError: viewModel.isErrorOcuured ) .textContentType(.username) - .focused($focusField, equals: .id) } .padding(.top, 42) .padding(.horizontal, 24) From ffbc006280635f66af8c6a1b6aa2c770538f27fc Mon Sep 17 00:00:00 2001 From: sian7563 Date: Thu, 27 Oct 2022 16:05:41 +0900 Subject: [PATCH 10/15] =?UTF-8?q?feat=20::=20SchoolConfirmationQuestionsVi?= =?UTF-8?q?ew=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SchoolConfirmationQuestionsView.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift index 6a8a111c..07038e60 100644 --- a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift +++ b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift @@ -35,7 +35,6 @@ struct SchoolConfirmationQuestionsView: View { text: $viewModel.answer, isError: viewModel.isErrorOcuured ) - .textContentType(.username) } .padding(.top, 42) .padding(.horizontal, 24) From 39e2213f00c9879f00a5d7495943a40e999f503e Mon Sep 17 00:00:00 2001 From: sian7563 Date: Thu, 27 Oct 2022 16:18:04 +0900 Subject: [PATCH 11/15] =?UTF-8?q?feat=20::=20SchoolCodeView=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SignupFeature/Sources/SchoolCode/SchoolCodeView.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift b/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift index 5741b795..60868d8a 100644 --- a/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift +++ b/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift @@ -62,7 +62,6 @@ struct SchoolCodeView: View { } } -} struct SignupView_Previews: PreviewProvider { static var previews: some View { From 71e2456f940c07a5409c9c6660eb59b7102abdd1 Mon Sep 17 00:00:00 2001 From: sian7563 Date: Thu, 27 Oct 2022 16:18:27 +0900 Subject: [PATCH 12/15] feat :: NeedleGenerated --- Projects/App/Sources/Application/NeedleGenerated.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Projects/App/Sources/Application/NeedleGenerated.swift b/Projects/App/Sources/Application/NeedleGenerated.swift index a7da9fc4..7c61e9ce 100644 --- a/Projects/App/Sources/Application/NeedleGenerated.swift +++ b/Projects/App/Sources/Application/NeedleGenerated.swift @@ -203,7 +203,6 @@ extension SignupEmailVerifyComponent: Registration { } extension MainTabComponent: Registration { public func registerItems() { - keyPathToName[\MainTabDependency.homeComponent] = "homeComponent-HomeComponent" } } From 79b96ee470530145975e21bc94293c1ae01c4b07 Mon Sep 17 00:00:00 2001 From: sian7563 Date: Thu, 27 Oct 2022 20:06:47 +0900 Subject: [PATCH 13/15] =?UTF-8?q?feat=20::=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=ED=8C=8C=EC=9D=BC=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/SchoolCode/PasscodeView.swift | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 Projects/Features/SignupFeature/Sources/SchoolCode/PasscodeView.swift diff --git a/Projects/Features/SignupFeature/Sources/SchoolCode/PasscodeView.swift b/Projects/Features/SignupFeature/Sources/SchoolCode/PasscodeView.swift deleted file mode 100644 index 7ff8998f..00000000 --- a/Projects/Features/SignupFeature/Sources/SchoolCode/PasscodeView.swift +++ /dev/null @@ -1,36 +0,0 @@ -import SwiftUI - -import Combine - -struct PasscodeView: View { - @Binding var text: String - @FocusState var focused: Bool - - var body: some View { - VStack { - ZStack { - TextField("", text: $text) - .focused($focused) - .keyboardType(.numberPad) - .accentColor(.clear) - .foregroundColor(.clear) - .onReceive(Just(text), perform: { _ in - if 8 < text.count { - text = String(text.prefix(8)) - } - }) - - HStack(spacing: 20) { - ForEach(1...8, id: \.self) { num in - Circle() - .frame(width: 20, height: 20) - .foregroundColor(text.count >= num ? Color.GrayScale.gray6 : Color.GrayScale.gray4) - } - } - } - .onAppear { - self.focused = true - } - } - } -} From 3c554f5fc542812c281ecfee1b1f2a205f211d9f Mon Sep 17 00:00:00 2001 From: sian7563 Date: Thu, 27 Oct 2022 20:07:13 +0900 Subject: [PATCH 14/15] =?UTF-8?q?feat=20::=20SchoolCodeView=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SignupFeature/Sources/SchoolCode/SchoolCodeView.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift b/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift index 60868d8a..db9ee7e3 100644 --- a/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift +++ b/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift @@ -33,7 +33,6 @@ struct SchoolCodeView: View { .frame(height: 60) VStack { - PasscodeView(text: $viewModel.schoolCode) DMSPassCodeView(codeCount: 8, text: $viewModel.schoolCode) @@ -50,6 +49,9 @@ struct SchoolCodeView: View { .padding(.horizontal, 24) .frame(height: 40) } + + .padding(.bottom, 430) + Spacer() DMSWideButton(text: "인증", color: .PrimaryVariant.primary) { From a94b21fdc62fd8c39238c5fd09501b99fd8442d7 Mon Sep 17 00:00:00 2001 From: baegteun Date: Thu, 27 Oct 2022 22:20:17 +0900 Subject: [PATCH 15/15] =?UTF-8?q?style=20::=20=EB=A7=88=EC=9D=B4=EB=84=88?= =?UTF-8?q?=ED=95=98=EA=B3=A0=20=EC=9E=A1=EB=8B=A4=ED=95=9C=20=EC=9D=B4?= =?UTF-8?q?=EC=8A=88=20=ED=95=B4=EA=B2=B0=20=EB=B0=8F=20=EB=A6=B0=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/SchoolCode/SchoolCodeView.swift | 21 +------------------ .../SchoolCode/SchoolCodeViewModel.swift | 10 +++------ .../SchoolConfirmationQuestionsView.swift | 8 ++----- ...SchoolConfirmationQuestionsViewModel.swift | 4 ++-- 4 files changed, 8 insertions(+), 35 deletions(-) diff --git a/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift b/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift index db9ee7e3..63946ef6 100644 --- a/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift +++ b/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift @@ -19,11 +19,6 @@ struct SchoolCodeView: View { .dmsFont(.text(.medium), color: .GrayScale.gray6) } - .padding(.top, 28) - - Spacer() - } - Spacer() } .padding(.top, 24) @@ -33,13 +28,8 @@ struct SchoolCodeView: View { .frame(height: 60) VStack { - DMSPassCodeView(codeCount: 8, text: $viewModel.schoolCode) - .padding(.horizontal, 64) - .onChange(of: viewModel.schoolCode) { _ in - viewModel.checkIsEmptyAuthCode() - } Spacer() .frame(height: 24) @@ -50,23 +40,14 @@ struct SchoolCodeView: View { .frame(height: 40) } - .padding(.bottom, 430) - Spacer() DMSWideButton(text: "인증", color: .PrimaryVariant.primary) { viewModel.verifyAuthCodeButtonDidTap() } - .disabled(viewModel.isDisabled) + .disabled(!viewModel.isEnabledVerify) .padding(.bottom, 20) .padding(.horizontal, 24) - .ignoresSafeArea(.keyboard, edges: .bottom) } - - } - -struct SignupView_Previews: PreviewProvider { - static var previews: some View { - Text("A") } } diff --git a/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeViewModel.swift b/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeViewModel.swift index 107f2e6b..d977bd86 100644 --- a/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeViewModel.swift +++ b/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeViewModel.swift @@ -4,11 +4,10 @@ import DomainModule final class SchoolCodeViewModel: BaseViewModel { @Published var schoolCode = "" - @Published var isDisabled = true @Published var isNavigateCheckSchool = false - var isSigninButtonEnabled: Bool { - !schoolCode.isEmpty + var isEnabledVerify: Bool { + schoolCode.count == 8 } private let checkSchoolCodeUseCase: any CheckSchoolCodeUseCase @@ -18,7 +17,7 @@ final class SchoolCodeViewModel: BaseViewModel { } func verifyAuthCodeButtonDidTap() { - guard isSigninButtonEnabled else { return } + guard isEnabledVerify else { return } addCancellable( checkSchoolCodeUseCase.execute( code: schoolCode @@ -27,7 +26,4 @@ final class SchoolCodeViewModel: BaseViewModel { self?.isNavigateCheckSchool = true } } - func checkIsEmptyAuthCode() { - isDisabled = 8 != schoolCode.count - } } diff --git a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift index 07038e60..27f0f3dc 100644 --- a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift +++ b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift @@ -22,12 +22,10 @@ struct SchoolConfirmationQuestionsView: View { .padding(.top, 50) } - .padding(.horizontal, 24) - Spacer() } - .padding(.top, 28) + .padding(.top, 24) VStack(spacing: 72) { DMSFloatingTextField( @@ -37,7 +35,6 @@ struct SchoolConfirmationQuestionsView: View { ) } .padding(.top, 42) - .padding(.horizontal, 24) Spacer() @@ -54,12 +51,11 @@ struct SchoolConfirmationQuestionsView: View { } .disabled(!viewModel.isConfirmButtonEnabled) .padding(.top, 24) - .frame(maxWidth: .infinity) .padding(.bottom, 40) - .padding(.horizontal, 24) } .dmsToast(isShowing: $viewModel.isErrorOcuured, message: viewModel.errorMessage, style: .error) .frame(maxWidth: .infinity) + .padding(.horizontal, 24) .dmsBackground() .ignoresSafeArea(.keyboard, edges: .bottom) } diff --git a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsViewModel.swift b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsViewModel.swift index c3eb5d3b..8d0fefe6 100644 --- a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsViewModel.swift +++ b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsViewModel.swift @@ -8,7 +8,7 @@ final class SchoolConfirmationQuestionsViewModel: BaseViewModel { @Published var isDisabled = true var isConfirmButtonEnabled: Bool { - !id.isEmpty + !answer.isEmpty } private let checkSchoolQuestionUseCase: any CheckSchoolQuestionUseCase @@ -24,7 +24,7 @@ final class SchoolConfirmationQuestionsViewModel: BaseViewModel { schoolID: id, answer: answer ) - ) { [weak self] _ in + ) { _ in } } }