From f501324f87c31a726a758834817d368351ee3b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:59:18 +0900 Subject: [PATCH 1/9] =?UTF-8?q?[refactor]=20#129=20LoginFeature=20?= =?UTF-8?q?=EC=95=A1=EC=85=98=20=ED=95=9C=EA=B8=80=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Login/LoginFeature.swift | 44 +++++++++---------- .../Sources/Login/LoginView.swift | 4 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Projects/Feature/FeatureLogin/Sources/Login/LoginFeature.swift b/Projects/Feature/FeatureLogin/Sources/Login/LoginFeature.swift index d02e8d28..12eb4db8 100644 --- a/Projects/Feature/FeatureLogin/Sources/Login/LoginFeature.swift +++ b/Projects/Feature/FeatureLogin/Sources/Login/LoginFeature.swift @@ -45,21 +45,21 @@ public struct LoginFeature { @CasePathable public enum View: Equatable { /// - Button Tapped - case appleLoginButtonTapped - case googleLoginButtonTapped + case 애플로그인_버튼_눌렀을때 + case 구글로그인_버튼_눌렀을때 } public enum InnerAction: Equatable { - case pushAgreeToTermsView - case pushRegisterNicknameView - case pushSelectFieldView(nickname: String) - case pushSignUpDoneView - case 애플로그인(SocialLoginInfo) - case 구글로그인(SocialLoginInfo) + case 약관동의_화면이동 + case 닉네임_등록_화면이동 + case 관심분야_선택_화면이동(nickname: String) + case 회원가입_완료_화면이동 + case 로그인_수행(SocialLoginInfo) case 로그인_이후_화면이동(isRegistered: Bool) } public enum AsyncAction: Equatable { - case 회원가입 - case 로그인(SocialLoginInfo) + case 회원가입_API + case 애플로그인_API(SocialLoginInfo) + case 구글로그인_API(SocialLoginInfo) } public enum ScopeAction { case agreeToTerms(AgreeToTermsFeature.Action.DelegateAction) @@ -106,32 +106,32 @@ private extension LoginFeature { /// - View Effect func handleViewAction(_ action: Action.View, state: inout State) -> Effect { switch action { - case .appleLoginButtonTapped: + case .애플로그인_버튼_눌렀을때: return .run { send in let response = try await socialLogin.appleLogin() - await send(.async(.로그인(response))) + await send(.inner(.로그인_수행(response))) } - case .googleLoginButtonTapped: + case .구글로그인_버튼_눌렀을때: return .run { send in let response = try await socialLogin.googleLogin() - await send(.async(.로그인(response))) + await send(.inner(.로그인_수행(response))) } } } /// - Inner Effect func handleInnerAction(_ action: Action.InnerAction, state: inout State) -> Effect { switch action { - case .pushAgreeToTermsView: + case .약관동의_화면이동: state.path.append(.agreeToTerms(AgreeToTermsFeature.State())) return .none - case .pushRegisterNicknameView: + case .닉네임_등록_화면이동: state.path.append(.registerNickname(RegisterNicknameFeature.State())) return .none - case .pushSelectFieldView(let nickname): + case .관심분야_선택_화면이동(let nickname): state.path.append(.selecteField(SelectFieldFeature.State(nickname: nickname))) return .none - case .pushSignUpDoneView: + case .회원가입_완료_화면이동: return .send(.delegate(.회원가입_완료_화면_이동)) case let .애플로그인(response): return .run { send in @@ -157,7 +157,7 @@ private extension LoginFeature { await send(.inner(.로그인_이후_화면이동(isRegistered: tokenResponse.isRegistered))) } - case let .구글로그인(response): + case let .구글로그인_API(response): return .run { send in guard let idToken = response.idToken else { return } let platform = response.provider.description @@ -210,19 +210,19 @@ private extension LoginFeature { case .agreeToTerms(let delegate): switch delegate { case .pushRegisterNicknameView: - return .send(.inner(.pushRegisterNicknameView)) + return .send(.inner(.닉네임_등록_화면이동)) } case .registerNickname(let delegate): switch delegate { case .pushSelectFieldView(let nickname): state.nickName = nickname - return .send(.inner(.pushSelectFieldView(nickname: nickname))) + return .send(.inner(.관심분야_선택_화면이동(nickname: nickname))) } case .selectField(let delegate): switch delegate { case let .pushSignUpDoneView(interests): state.interests = interests - return .send(.async(.회원가입)) + return .send(.async(.회원가입_API)) } } } diff --git a/Projects/Feature/FeatureLogin/Sources/Login/LoginView.swift b/Projects/Feature/FeatureLogin/Sources/Login/LoginView.swift index 17519224..7452a7e1 100644 --- a/Projects/Feature/FeatureLogin/Sources/Login/LoginView.swift +++ b/Projects/Feature/FeatureLogin/Sources/Login/LoginView.swift @@ -82,7 +82,7 @@ extension LoginView { private var appleLoginButton: some View { Button { - send(.appleLoginButtonTapped) + send(.애플로그인_버튼_눌렀을때) } label: { appleLoginButtonLabel } @@ -123,7 +123,7 @@ extension LoginView { private var googleLoginButton: some View { Button { - send(.googleLoginButtonTapped) + send(.구글로그인_버튼_눌렀을때) } label: { googleLoginButtonLabel } From 7cd6767f475f08654e4d100c03d72f4e81d7032c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Sat, 28 Sep 2024 17:08:55 +0900 Subject: [PATCH 2/9] =?UTF-8?q?[refactor]=20#129=20=EB=AA=A9=EC=A0=81?= =?UTF-8?q?=EC=97=90=20=EB=A7=9E=EB=8A=94=20=EC=95=A1=EC=85=98=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Login/LoginFeature.swift | 80 ++++++++++--------- 1 file changed, 42 insertions(+), 38 deletions(-) diff --git a/Projects/Feature/FeatureLogin/Sources/Login/LoginFeature.swift b/Projects/Feature/FeatureLogin/Sources/Login/LoginFeature.swift index 12eb4db8..70bc368c 100644 --- a/Projects/Feature/FeatureLogin/Sources/Login/LoginFeature.swift +++ b/Projects/Feature/FeatureLogin/Sources/Login/LoginFeature.swift @@ -53,13 +53,15 @@ public struct LoginFeature { case 닉네임_등록_화면이동 case 관심분야_선택_화면이동(nickname: String) case 회원가입_완료_화면이동 - case 로그인_수행(SocialLoginInfo) case 로그인_이후_화면이동(isRegistered: Bool) + case 소셜로그인_반영(SocialLoginInfo) } public enum AsyncAction: Equatable { case 회원가입_API case 애플로그인_API(SocialLoginInfo) case 구글로그인_API(SocialLoginInfo) + case 애플로그인_소셜_API + case 구글로그인_소셜_API } public enum ScopeAction { case agreeToTerms(AgreeToTermsFeature.Action.DelegateAction) @@ -107,16 +109,9 @@ private extension LoginFeature { func handleViewAction(_ action: Action.View, state: inout State) -> Effect { switch action { case .애플로그인_버튼_눌렀을때: - return .run { send in - let response = try await socialLogin.appleLogin() - await send(.inner(.로그인_수행(response))) - } - + return .send(.async(.애플로그인_소셜_API)) case .구글로그인_버튼_눌렀을때: - return .run { send in - let response = try await socialLogin.googleLogin() - await send(.inner(.로그인_수행(response))) - } + return .send(.async(.구글로그인_소셜_API)) } } /// - Inner Effect @@ -133,7 +128,35 @@ private extension LoginFeature { return .none case .회원가입_완료_화면이동: return .send(.delegate(.회원가입_완료_화면_이동)) - case let .애플로그인(response): + case let .로그인_이후_화면이동(isRegistered): + /// [3]. 이미 회원가입했던 유저라면 `메인`이동 + if isRegistered { + return .run { send in await send(.delegate(.dismissLoginRootView)) } + } else { + return .run { send in await send(.inner(.약관동의_화면이동)) } + } + case .소셜로그인_반영(let response): + switch response.provider { + case .apple: + return .send(.async(.애플로그인_API(response))) + case .google: + return .send(.async(.구글로그인_API(response))) + } + } + } + /// - Async Effect + func handleAsyncAction(_ action: Action.AsyncAction, state: inout State) -> Effect { + switch action { + case .회원가입_API: + return .run { [nickName = state.nickName, interests = state.interests] send in + guard let nickName else { return } + guard let interests else { return } + let signUpRequest = SignupRequest(nickName: nickName, interests: interests) + let _ = try await userClient.회원등록(signUpRequest) + + await send(.inner(.회원가입_완료_화면이동)) + } + case let .애플로그인_API(response): return .run { send in guard let idToken = response.idToken else { return } guard let authCode = response.authCode else { return } @@ -173,34 +196,15 @@ private extension LoginFeature { await send(.inner(.로그인_이후_화면이동(isRegistered: tokenResponse.isRegistered))) } - case let .로그인_이후_화면이동(isRegistered): - /// [3]. 이미 회원가입했던 유저라면 `메인`이동 - if isRegistered { - return .run { send in await send(.delegate(.dismissLoginRootView)) } - } else { - return .run { send in await send(.inner(.pushAgreeToTermsView)) } - } - } - } - /// - Async Effect - func handleAsyncAction(_ action: Action.AsyncAction, state: inout State) -> Effect { - switch action { - case .회원가입: - return .run { [nickName = state.nickName, interests = state.interests] send in - guard let nickName else { return } - guard let interests else { return } - let signUpRequest = SignupRequest(nickName: nickName, interests: interests) - let _ = try await userClient.회원등록(signUpRequest) - - await send(.inner(.pushSignUpDoneView)) + case .애플로그인_소셜_API: + return .run { send in + let response = try await socialLogin.appleLogin() + await send(.inner(.소셜로그인_반영(response))) } - - case .로그인(let response): - switch response.provider { - case .apple: - return .run { send in await send(.inner(.애플로그인(response))) } - case .google: - return .run { send in await send(.inner(.구글로그인(response))) } + case .구글로그인_소셜_API: + return .run { send in + let response = try await socialLogin.googleLogin() + await send(.inner(.소셜로그인_반영(response))) } } } From 9e472b6d2da9e80492e0cc2ce0a5b1fdf8bd6922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Sat, 28 Sep 2024 17:18:14 +0900 Subject: [PATCH 3/9] =?UTF-8?q?[refactor]=20#129=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=ED=95=9C=20=EC=95=A1=EC=85=98=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FeatureLogin/Sources/Login/LoginFeature.swift | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Projects/Feature/FeatureLogin/Sources/Login/LoginFeature.swift b/Projects/Feature/FeatureLogin/Sources/Login/LoginFeature.swift index 70bc368c..a5e2c166 100644 --- a/Projects/Feature/FeatureLogin/Sources/Login/LoginFeature.swift +++ b/Projects/Feature/FeatureLogin/Sources/Login/LoginFeature.swift @@ -54,7 +54,6 @@ public struct LoginFeature { case 관심분야_선택_화면이동(nickname: String) case 회원가입_완료_화면이동 case 로그인_이후_화면이동(isRegistered: Bool) - case 소셜로그인_반영(SocialLoginInfo) } public enum AsyncAction: Equatable { case 회원가입_API @@ -135,13 +134,6 @@ private extension LoginFeature { } else { return .run { send in await send(.inner(.약관동의_화면이동)) } } - case .소셜로그인_반영(let response): - switch response.provider { - case .apple: - return .send(.async(.애플로그인_API(response))) - case .google: - return .send(.async(.구글로그인_API(response))) - } } } /// - Async Effect @@ -199,12 +191,12 @@ private extension LoginFeature { case .애플로그인_소셜_API: return .run { send in let response = try await socialLogin.appleLogin() - await send(.inner(.소셜로그인_반영(response))) + await send(.async(.애플로그인_API(response))) } case .구글로그인_소셜_API: return .run { send in let response = try await socialLogin.googleLogin() - await send(.inner(.소셜로그인_반영(response))) + await send(.async(.구글로그인_API(response))) } } } From 1eff5218c4bcf11f96d0e83301634066846fc0fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Sun, 6 Oct 2024 19:26:30 +0900 Subject: [PATCH 4/9] =?UTF-8?q?[refactor]=20#129=20RegisterNicknameFeature?= =?UTF-8?q?=20=EC=95=A1=EC=85=98=20=ED=95=9C=EA=B8=80=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RegisterNicknameFeature.swift | 28 ++++++++++--------- .../RegisterNicknameView.swift | 4 +-- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift b/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift index 64b5da36..3b3c926b 100644 --- a/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift +++ b/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift @@ -45,15 +45,17 @@ public struct RegisterNicknameFeature { /// - Binding case binding(BindingAction) /// - Button Tapped - case nextButtonTapped - case backButtonTapped + case 다음_버튼_눌렀을때 + case 뒤로가기_버튼_눌렀을때 } + public enum InnerAction: Equatable { - case textChanged - case 닉네임_중복_체크_네트워크_결과(Bool) + case 닉네임_변경되었을때 + case 닉네임_중복_체크_API_반영(Bool) } + public enum AsyncAction: Equatable { - case 닉네임_중복_체크_네트워크 + case 닉네임_중복_체크_API } public enum ScopeAction: Equatable { case doNothing } public enum DelegateAction: Equatable { @@ -94,16 +96,16 @@ private extension RegisterNicknameFeature { /// - View Effect func handleViewAction(_ action: Action.ViewAction, state: inout State) -> Effect { switch action { - case .nextButtonTapped: + case .다음_버튼_눌렀을때: return .run { [nickName = state.nicknameText] send in await send(.delegate(.pushSelectFieldView(nickname: nickName))) } - case .backButtonTapped: + case .뒤로가기_버튼_눌렀을때: return .run { _ in await self.dismiss() } case .binding(\.nicknameText): state.buttonActive = false return .run { send in - await send(.inner(.textChanged)) + await send(.inner(.닉네임_변경되었을때)) } .debounce( id: CancelID.response, @@ -117,7 +119,7 @@ private extension RegisterNicknameFeature { /// - Inner Effect func handleInnerAction(_ action: Action.InnerAction, state: inout State) -> Effect { switch action { - case .textChanged: + case .닉네임_변경되었을때: /// [1]. 닉네임 텍스트필드가 비어있을 때 if state.nicknameText.isEmpty { state.buttonActive = false @@ -136,10 +138,10 @@ private extension RegisterNicknameFeature { return .none } else { /// [4]. 정상 케이스일 때 - return .run { send in await send(.async(.닉네임_중복_체크_네트워크)) } + return .run { send in await send(.async(.닉네임_중복_체크_API)) } } - case let .닉네임_중복_체크_네트워크_결과(isDuplicate): + case let .닉네임_중복_체크_API_반영(isDuplicate): if isDuplicate { state.textfieldState = .error(message: "중복된 닉네임입니다.") state.buttonActive = false @@ -153,10 +155,10 @@ private extension RegisterNicknameFeature { /// - Async Effect func handleAsyncAction(_ action: Action.AsyncAction, state: inout State) -> Effect { switch action { - case .닉네임_중복_체크_네트워크: + case .닉네임_중복_체크_API: return .run { [nickName = state.nicknameText] send in let result = try await userClient.닉네임_중복_체크(nickName) - await send(.inner(.닉네임_중복_체크_네트워크_결과(result.isDuplicate))) + await send(.inner(.닉네임_중복_체크_API_반영(result.isDuplicate))) } } } diff --git a/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameView.swift b/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameView.swift index e321c920..19f40ef5 100644 --- a/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameView.swift +++ b/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameView.swift @@ -42,7 +42,7 @@ public extension RegisterNicknameView { state: store.buttonActive ? .filled(.primary) : .disable, - action: { send(.nextButtonTapped) } + action: { send(.다음_버튼_눌렀을때) } ) .setKeyboardHeight() } @@ -52,7 +52,7 @@ public extension RegisterNicknameView { PokitHeader { PokitHeaderItems(placement: .leading) { PokitToolbarButton(.icon(.arrowLeft)) { - send(.backButtonTapped) + send(.뒤로가기_버튼_눌렀을때) } } } From 847276e4848a1b75e1e9c27843a488919cbd545a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Sun, 6 Oct 2024 19:29:21 +0900 Subject: [PATCH 5/9] =?UTF-8?q?[refactor]=20#129=20RegisterNicknameFeature?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RegisterNickname/RegisterNicknameFeature.swift | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift b/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift index 3b3c926b..b5d9e7da 100644 --- a/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift +++ b/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift @@ -97,16 +97,15 @@ private extension RegisterNicknameFeature { func handleViewAction(_ action: Action.ViewAction, state: inout State) -> Effect { switch action { case .다음_버튼_눌렀을때: - return .run { [nickName = state.nicknameText] send in - await send(.delegate(.pushSelectFieldView(nickname: nickName))) - } + let nickname = state.nicknameText + return .send(.delegate(.pushSelectFieldView(nickname: nickname))) case .뒤로가기_버튼_눌렀을때: return .run { _ in await self.dismiss() } case .binding(\.nicknameText): state.buttonActive = false - return .run { send in - await send(.inner(.닉네임_변경되었을때)) - } + return .send( + .inner(.닉네임_변경되었을때) + ) .debounce( id: CancelID.response, for: 0.5, From 6d95610241daba529ac04e626d7217ee6ecc7bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Sun, 6 Oct 2024 19:40:39 +0900 Subject: [PATCH 6/9] =?UTF-8?q?[refactor]=20#129=20SignUpDoneFeature=20?= =?UTF-8?q?=EC=95=A1=EC=85=98=20=ED=95=9C=EA=B8=80=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SignUpDone/SignUpDoneFeature.swift | 26 +++++++++---------- .../Sources/SignUpDone/SignUpDoneView.swift | 10 +++---- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Projects/Feature/FeatureLogin/Sources/SignUpDone/SignUpDoneFeature.swift b/Projects/Feature/FeatureLogin/Sources/SignUpDone/SignUpDoneFeature.swift index df3fa547..4a9a50ff 100644 --- a/Projects/Feature/FeatureLogin/Sources/SignUpDone/SignUpDoneFeature.swift +++ b/Projects/Feature/FeatureLogin/Sources/SignUpDone/SignUpDoneFeature.swift @@ -35,16 +35,16 @@ public struct SignUpDoneFeature { @CasePathable public enum View: Equatable { /// - Button Tapped - case startButtonTapped + case 시작_버튼_눌렀을때 - case firecrackerOnAppeared - case titleOnAppeared - case confettiOnAppeared - case pookiOnAppeared + case 폭죽불꽃_이미지_나타났을때 + case 제목_나타났을때 + case 폭죽_이미지_나타났을때 + case 푸키_이미지_나타났을때 } - public enum InnerAction: Equatable { case doNothing } - public enum AsyncAction: Equatable { case doNothing } - public enum ScopeAction: Equatable { case doNothing } + public enum InnerAction: Equatable { case 없음 } + public enum AsyncAction: Equatable { case 없음 } + public enum ScopeAction: Equatable { case 없음 } public enum DelegateAction: Equatable { case dismissLoginRootView } @@ -81,18 +81,18 @@ private extension SignUpDoneFeature { /// - View Effect func handleViewAction(_ action: Action.ViewAction, state: inout State) -> Effect { switch action { - case .startButtonTapped: + case .시작_버튼_눌렀을때: return .send(.delegate(.dismissLoginRootView), animation: .pokitDissolve) - case .firecrackerOnAppeared: + case .폭죽불꽃_이미지_나타났을때: state.firecrackIsAppear = true return .none - case .titleOnAppeared: + case .제목_나타났을때: state.titleIsAppear = true return .none - case .confettiOnAppeared: + case .폭죽_이미지_나타났을때: state.confettiIsAppear = true return .none - case .pookiOnAppeared: + case .푸키_이미지_나타났을때: state.pookiIsAppear = true return .none } diff --git a/Projects/Feature/FeatureLogin/Sources/SignUpDone/SignUpDoneView.swift b/Projects/Feature/FeatureLogin/Sources/SignUpDone/SignUpDoneView.swift index d5f5c0de..018e4360 100644 --- a/Projects/Feature/FeatureLogin/Sources/SignUpDone/SignUpDoneView.swift +++ b/Projects/Feature/FeatureLogin/Sources/SignUpDone/SignUpDoneView.swift @@ -41,7 +41,7 @@ public extension SignUpDoneView { PokitBottomButton( "시작하기", state: .filled(.primary), - action: { send(.startButtonTapped) } + action: { send(.시작_버튼_눌렀을때) } ) .pokitMaxWidth() .padding(.horizontal, 20) @@ -65,7 +65,7 @@ extension SignUpDoneView { store.firecrackIsAppear ? 1 : 0, anchor: .bottomTrailing ) - .onAppear { send(.firecrackerOnAppeared, animation: .pokitSpring) } + .onAppear { send(.폭죽불꽃_이미지_나타났을때, animation: .pokitSpring) } Spacer() } @@ -83,7 +83,7 @@ extension SignUpDoneView { .multilineTextAlignment(.center) } .opacity(store.titleIsAppear ? 1 : 0) - .onAppear { send(.titleOnAppeared, animation: .pokitDissolve) } + .onAppear { send(.제목_나타났을때, animation: .pokitDissolve) } } private var images: some View { @@ -97,7 +97,7 @@ extension SignUpDoneView { store.confettiIsAppear ? 1 : 0, anchor: .bottom ) - .onAppear { send(.confettiOnAppeared, animation: .pokitSpring) } + .onAppear { send(.폭죽_이미지_나타났을때, animation: .pokitSpring) } Image(.character(.pooki)) .resizable() @@ -107,7 +107,7 @@ extension SignUpDoneView { store.pookiIsAppear ? 1 : 0, anchor: .bottom ) - .onAppear{ send(.pookiOnAppeared, animation: .pokitSpring) } + .onAppear{ send(.푸키_이미지_나타났을때, animation: .pokitSpring) } } } } From 352ffa8734d7e7e58d95ac62617270ff1571a54b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Sun, 6 Oct 2024 19:44:27 +0900 Subject: [PATCH 7/9] =?UTF-8?q?[refactor]=20#129=20AgreeToTermsFeature=20?= =?UTF-8?q?=EC=95=A1=EC=85=98=20=ED=95=9C=EA=B8=80=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AgreeToTerms/AgreeToTermsFeature.swift | 54 +++++++++---------- .../AgreeToTerms/AgreeToTermsView.swift | 10 ++-- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Projects/Feature/FeatureLogin/Sources/AgreeToTerms/AgreeToTermsFeature.swift b/Projects/Feature/FeatureLogin/Sources/AgreeToTerms/AgreeToTermsFeature.swift index 21dca3b0..590b4d0a 100644 --- a/Projects/Feature/FeatureLogin/Sources/AgreeToTerms/AgreeToTermsFeature.swift +++ b/Projects/Feature/FeatureLogin/Sources/AgreeToTerms/AgreeToTermsFeature.swift @@ -39,21 +39,21 @@ public struct AgreeToTermsFeature { /// - Binding case binding(BindingAction) /// - Button Tapped - case nextButtonTapped - case backButtonTapped - case 개인정보_동의_버튼_클릭 - case 서비스_이용약관_버튼_클릭 - case 마케팅_정보_수신_버튼_클릭 + case 다음_버튼_눌렀을때 + case 뒤로가기_버튼_눌렀을때 + case 개인정보_동의_버튼_눌렀을때 + case 서비스_이용약관_버튼_눌렀을때 + case 마케팅_정보_수신_버튼_눌렀을때 } public enum InnerAction: Equatable { - case checkAgreements - case personalAndUsageAgreeSelected - case serviceAgreeSelected - case marketingAgreeSelected - case allAgreementSelected + case 동의_체크_확인 + case 개인정보_동의_선택됐을때 + case 서비스_이용약관_동의_선택됐을때 + case 마케팅_정보_수신_동의_선택됐을때 + case 전체_동의_선택됐을때 } - public enum AsyncAction: Equatable { case doNothing } - public enum ScopeAction: Equatable { case doNothing } + public enum AsyncAction: Equatable { case 없음 } + public enum ScopeAction: Equatable { case 없음 } public enum DelegateAction: Equatable { case pushRegisterNicknameView } @@ -91,29 +91,29 @@ private extension AgreeToTermsFeature { /// - View Effect func handleViewAction(_ action: Action.ViewAction, state: inout State) -> Effect { switch action { - case .nextButtonTapped: + case .다음_버튼_눌렀을때: return .send(.delegate(.pushRegisterNicknameView)) - case .backButtonTapped: + case .뒤로가기_버튼_눌렀을때: return .run { _ in await self.dismiss() } case .binding(\.isAgreeAllTerms): - return .send(.inner(.allAgreementSelected)) + return .send(.inner(.전체_동의_선택됐을때)) case .binding(\.isPersonalAndUsageArgee): - return .send(.inner(.personalAndUsageAgreeSelected)) + return .send(.inner(.개인정보_동의_선택됐을때)) case .binding(\.isServiceAgree): - return .send(.inner(.serviceAgreeSelected)) + return .send(.inner(.서비스_이용약관_동의_선택됐을때)) case .binding(\.isMarketingAgree): - return .send(.inner(.marketingAgreeSelected)) + return .send(.inner(.마케팅_정보_수신_동의_선택됐을때)) case .binding: return .none - case .개인정보_동의_버튼_클릭: + case .개인정보_동의_버튼_눌렀을때: state.webViewURL = Constants.개인정보_처리방침_주소 state.isWebViewPresented = true return .none - case .서비스_이용약관_버튼_클릭: + case .서비스_이용약관_버튼_눌렀을때: state.webViewURL = Constants.서비스_이용약관_주소 state.isWebViewPresented = true return .none - case .마케팅_정보_수신_버튼_클릭: + case .마케팅_정보_수신_버튼_눌렀을때: state.webViewURL = Constants.마케팅_정보_수신_주소 state.isWebViewPresented = true return .none @@ -123,19 +123,19 @@ private extension AgreeToTermsFeature { func handleInnerAction(_ action: Action.InnerAction, state: inout State) -> Effect { switch action { /// - 개별 동의 체크 박스를 확인 하여 전체 동의 체크 여부 결정 - case .checkAgreements: + case .동의_체크_확인: let isAgreeAllterm = state.isPersonalAndUsageArgee && state.isServiceAgree && state.isMarketingAgree state.isAgreeAllTerms = isAgreeAllterm return .none /// - 각각의 개별 동의 체크박스가 선택 되었을 때 - case .personalAndUsageAgreeSelected, - .serviceAgreeSelected, - .marketingAgreeSelected: - return .send(.inner(.checkAgreements)) + case .개인정보_동의_선택됐을때, + .서비스_이용약관_동의_선택됐을때, + .마케팅_정보_수신_동의_선택됐을때: + return .send(.inner(.동의_체크_확인)) /// - 전체 동의 체크박으가 선택 되었을 때 - case .allAgreementSelected: + case .전체_동의_선택됐을때: state.isPersonalAndUsageArgee = state.isAgreeAllTerms state.isServiceAgree = state.isAgreeAllTerms state.isMarketingAgree = state.isAgreeAllTerms diff --git a/Projects/Feature/FeatureLogin/Sources/AgreeToTerms/AgreeToTermsView.swift b/Projects/Feature/FeatureLogin/Sources/AgreeToTerms/AgreeToTermsView.swift index 39e20bbb..3361dae5 100644 --- a/Projects/Feature/FeatureLogin/Sources/AgreeToTerms/AgreeToTermsView.swift +++ b/Projects/Feature/FeatureLogin/Sources/AgreeToTerms/AgreeToTermsView.swift @@ -40,7 +40,7 @@ public extension AgreeToTermsView { PokitBottomButton( "다음", state: store.isPersonalAndUsageArgee && store.isServiceAgree ? .filled(.primary) : .disable, - action: { send(.nextButtonTapped) } + action: { send(.다음_버튼_눌렀을때) } ) } .pokitMaxWidth() @@ -49,7 +49,7 @@ public extension AgreeToTermsView { PokitHeader { PokitHeaderItems(placement: .leading) { PokitToolbarButton(.icon(.arrowLeft)) { - send(.backButtonTapped) + send(.뒤로가기_버튼_눌렀을때) } } } @@ -98,19 +98,19 @@ extension AgreeToTermsView { termsButton( "(필수)개인정보 수집 및 이용 동의", isSelected: $store.isPersonalAndUsageArgee, - action: { send(.개인정보_동의_버튼_클릭) } + action: { send(.개인정보_동의_버튼_눌렀을때) } ) termsButton( "(필수)서비스 이용약관", isSelected: $store.isServiceAgree, - action: { send(.서비스_이용약관_버튼_클릭) } + action: { send(.서비스_이용약관_버튼_눌렀을때) } ) termsButton( "(선택)마케팅 정보 수신", isSelected: $store.isMarketingAgree, - action: { send(.마케팅_정보_수신_버튼_클릭) } + action: { send(.마케팅_정보_수신_버튼_눌렀을때) } ) } .padding(.leading, 20) From d649ccf93a54d090827a938a62fb29436154b98e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Sun, 6 Oct 2024 19:45:20 +0900 Subject: [PATCH 8/9] =?UTF-8?q?[refactor]=20#129=20doNothing=20=ED=95=9C?= =?UTF-8?q?=EA=B8=80=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/RegisterNickname/RegisterNicknameFeature.swift | 2 +- .../FeatureLogin/Sources/SelectField/SelectFieldFeature.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift b/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift index b5d9e7da..2b02eeda 100644 --- a/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift +++ b/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift @@ -57,7 +57,7 @@ public struct RegisterNicknameFeature { public enum AsyncAction: Equatable { case 닉네임_중복_체크_API } - public enum ScopeAction: Equatable { case doNothing } + public enum ScopeAction: Equatable { case 없음 } public enum DelegateAction: Equatable { case pushSelectFieldView(nickname: String) } diff --git a/Projects/Feature/FeatureLogin/Sources/SelectField/SelectFieldFeature.swift b/Projects/Feature/FeatureLogin/Sources/SelectField/SelectFieldFeature.swift index fa069c78..38771fd6 100644 --- a/Projects/Feature/FeatureLogin/Sources/SelectField/SelectFieldFeature.swift +++ b/Projects/Feature/FeatureLogin/Sources/SelectField/SelectFieldFeature.swift @@ -48,8 +48,8 @@ public struct SelectFieldFeature { public enum InnerAction: Equatable { case 관심사_목록_조회_결과(interests: [InterestResponse]) } - public enum AsyncAction: Equatable { case doNothing } - public enum ScopeAction: Equatable { case doNothing } + public enum AsyncAction: Equatable { case 없음 } + public enum ScopeAction: Equatable { case 없음 } public enum DelegateAction: Equatable { case pushSignUpDoneView(interests: [String]) } From 167cc1a21050191ad8851b2fbcfcf25a7b7d60f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:56:53 +0900 Subject: [PATCH 9/9] =?UTF-8?q?[refactor]=20#129=20=ED=94=BC=EB=93=9C?= =?UTF-8?q?=EB=B0=B1=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AgreeToTerms/AgreeToTermsFeature.swift | 24 +++++++++---------- .../RegisterNicknameFeature.swift | 13 ++++------ .../RegisterNicknameView.swift | 2 +- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/Projects/Feature/FeatureLogin/Sources/AgreeToTerms/AgreeToTermsFeature.swift b/Projects/Feature/FeatureLogin/Sources/AgreeToTerms/AgreeToTermsFeature.swift index 590b4d0a..bec21026 100644 --- a/Projects/Feature/FeatureLogin/Sources/AgreeToTerms/AgreeToTermsFeature.swift +++ b/Projects/Feature/FeatureLogin/Sources/AgreeToTerms/AgreeToTermsFeature.swift @@ -47,10 +47,10 @@ public struct AgreeToTermsFeature { } public enum InnerAction: Equatable { case 동의_체크_확인 - case 개인정보_동의_선택됐을때 - case 서비스_이용약관_동의_선택됐을때 - case 마케팅_정보_수신_동의_선택됐을때 - case 전체_동의_선택됐을때 + case 개인정보_동의_선택했을때 + case 서비스_이용약관_동의_선택했을때 + case 마케팅_정보_수신_동의_선택했을때 + case 전체_동의_선택했을때 } public enum AsyncAction: Equatable { case 없음 } public enum ScopeAction: Equatable { case 없음 } @@ -96,13 +96,13 @@ private extension AgreeToTermsFeature { case .뒤로가기_버튼_눌렀을때: return .run { _ in await self.dismiss() } case .binding(\.isAgreeAllTerms): - return .send(.inner(.전체_동의_선택됐을때)) + return .send(.inner(.전체_동의_선택했을때)) case .binding(\.isPersonalAndUsageArgee): - return .send(.inner(.개인정보_동의_선택됐을때)) + return .send(.inner(.개인정보_동의_선택했을때)) case .binding(\.isServiceAgree): - return .send(.inner(.서비스_이용약관_동의_선택됐을때)) + return .send(.inner(.서비스_이용약관_동의_선택했을때)) case .binding(\.isMarketingAgree): - return .send(.inner(.마케팅_정보_수신_동의_선택됐을때)) + return .send(.inner(.마케팅_정보_수신_동의_선택했을때)) case .binding: return .none case .개인정보_동의_버튼_눌렀을때: @@ -130,12 +130,12 @@ private extension AgreeToTermsFeature { state.isAgreeAllTerms = isAgreeAllterm return .none /// - 각각의 개별 동의 체크박스가 선택 되었을 때 - case .개인정보_동의_선택됐을때, - .서비스_이용약관_동의_선택됐을때, - .마케팅_정보_수신_동의_선택됐을때: + case .개인정보_동의_선택했을때, + .서비스_이용약관_동의_선택했을때, + .마케팅_정보_수신_동의_선택했을때: return .send(.inner(.동의_체크_확인)) /// - 전체 동의 체크박으가 선택 되었을 때 - case .전체_동의_선택됐을때: + case .전체_동의_선택했을때: state.isPersonalAndUsageArgee = state.isAgreeAllTerms state.isServiceAgree = state.isAgreeAllTerms state.isMarketingAgree = state.isAgreeAllTerms diff --git a/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift b/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift index 2b02eeda..ee5bf4df 100644 --- a/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift +++ b/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift @@ -46,11 +46,11 @@ public struct RegisterNicknameFeature { case binding(BindingAction) /// - Button Tapped case 다음_버튼_눌렀을때 - case 뒤로가기_버튼_눌렀을때 + case dismiss } public enum InnerAction: Equatable { - case 닉네임_변경되었을때 + case 닉네임_텍스트_변경되었을때 case 닉네임_중복_체크_API_반영(Bool) } @@ -99,14 +99,11 @@ private extension RegisterNicknameFeature { case .다음_버튼_눌렀을때: let nickname = state.nicknameText return .send(.delegate(.pushSelectFieldView(nickname: nickname))) - case .뒤로가기_버튼_눌렀을때: + case .dismiss: return .run { _ in await self.dismiss() } case .binding(\.nicknameText): state.buttonActive = false - return .send( - .inner(.닉네임_변경되었을때) - ) - .debounce( + return .send(.inner(.닉네임_텍스트_변경되었을때)).debounce( id: CancelID.response, for: 0.5, scheduler: mainQueue @@ -118,7 +115,7 @@ private extension RegisterNicknameFeature { /// - Inner Effect func handleInnerAction(_ action: Action.InnerAction, state: inout State) -> Effect { switch action { - case .닉네임_변경되었을때: + case .닉네임_텍스트_변경되었을때: /// [1]. 닉네임 텍스트필드가 비어있을 때 if state.nicknameText.isEmpty { state.buttonActive = false diff --git a/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameView.swift b/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameView.swift index 19f40ef5..83cf8c24 100644 --- a/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameView.swift +++ b/Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameView.swift @@ -52,7 +52,7 @@ public extension RegisterNicknameView { PokitHeader { PokitHeaderItems(placement: .leading) { PokitToolbarButton(.icon(.arrowLeft)) { - send(.뒤로가기_버튼_눌렀을때) + send(.dismiss) } } }