From f1804a07a05de6999972c4268246078343b1cecb Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 14:07:15 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20AppleLoginView=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Login/AppleLoginFeature.swift | 33 +++++++++ .../Login/AppleLoginFeatureInterface.swift | 37 ++++++++++ .../Sources/Login/AppleLoginView.swift | 72 +++++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 Projects/Feature/Login/Interface/Sources/Login/AppleLoginFeature.swift create mode 100644 Projects/Feature/Login/Interface/Sources/Login/AppleLoginFeatureInterface.swift create mode 100644 Projects/Feature/Login/Interface/Sources/Login/AppleLoginView.swift diff --git a/Projects/Feature/Login/Interface/Sources/Login/AppleLoginFeature.swift b/Projects/Feature/Login/Interface/Sources/Login/AppleLoginFeature.swift new file mode 100644 index 00000000..77796231 --- /dev/null +++ b/Projects/Feature/Login/Interface/Sources/Login/AppleLoginFeature.swift @@ -0,0 +1,33 @@ +// +// AppleLoginFeature.swift +// FeatureLoginInterface +// +// Created by 임현규 on 8/23/24. +// + +import Foundation + +import ComposableArchitecture + +extension AppleLoginFeature { + public init() { + @Dependency(\.dismiss) var dismiss + + let reducer = Reduce { state, action in + switch action { + case .signInAppleButtonDidTapped: + return .send(.delegate(.signInAppleButtonDidTapped)) + + case .backButtonDidTapped: + return .run { send in + await dismiss() + } + + default: + return .none + } + } + + self.init(reducer: reducer) + } +} diff --git a/Projects/Feature/Login/Interface/Sources/Login/AppleLoginFeatureInterface.swift b/Projects/Feature/Login/Interface/Sources/Login/AppleLoginFeatureInterface.swift new file mode 100644 index 00000000..e9dd2af5 --- /dev/null +++ b/Projects/Feature/Login/Interface/Sources/Login/AppleLoginFeatureInterface.swift @@ -0,0 +1,37 @@ +// +// AppleLoginFeatureInterface.swift +// FeatureLoginInterface +// +// Created by 임현규 on 8/23/24. +// + +import Foundation + +import ComposableArchitecture + +@Reducer +public struct AppleLoginFeature { + private let reducer: Reduce + + public init(reducer: Reduce) { + self.reducer = reducer + } + + public struct State: Equatable { + public init() {} + } + + public enum Action { + case signInAppleButtonDidTapped + case backButtonDidTapped + case delegate(Delegate) + + public enum Delegate { + case signInAppleButtonDidTapped + } + } + + public var body: some ReducerOf { + reducer + } +} diff --git a/Projects/Feature/Login/Interface/Sources/Login/AppleLoginView.swift b/Projects/Feature/Login/Interface/Sources/Login/AppleLoginView.swift new file mode 100644 index 00000000..e1ace40d --- /dev/null +++ b/Projects/Feature/Login/Interface/Sources/Login/AppleLoginView.swift @@ -0,0 +1,72 @@ +// +// AppleLoginView.swift +// FeatureLoginInterface +// +// Created by 임현규 on 8/23/24. +// + +import SwiftUI + +import SharedDesignSystem + +import ComposableArchitecture + +public struct AppleLoginView: View { + private let store: StoreOf + + public init(store: StoreOf) { + self.store = store + } + + public var body: some View { + VStack(spacing: 0) { + Spacer() + .frame(height: 52) + whiteLogo + .padding(.top, 52) + .padding(.bottom, .xl) + mainText + + Spacer() + + signInWithAppleButton + .padding(.bottom, 30.0) + + } + .background { + BottleImageView( + type: .local(bottleImageSystem: .illustraition(.loginBackground)) + ) + } + .setNavigationBar { + makeNaivgationleftButton() { + store.send(.backButtonDidTapped) + } + } + .edgesIgnoringSafeArea([.top, .bottom]) + } +} + +private extension AppleLoginView { + var whiteLogo: some View { + BottleImageView(type: .local(bottleImageSystem: .illustraition(.whiteLogo))) + .frame(width: 117.1, height: 30) + } + + var mainText: some View { + WantedSansStyleText("진심을 담은 보틀로\n서로를 밀도있게 알아가요", style: .title2, color: .quaternary) + .padding(.horizontal, .md) + .multilineTextAlignment(.center) + } + + var signInWithAppleButton: some View { + SolidButton( + title: "Apple로 로그인", + sizeType: .large, + buttonType: .throttle, + buttonApperance: .apple, + action: { store.send(.signInAppleButtonDidTapped) } + ) + .padding(.horizontal, .md) + } +} From 737d29682083ef5ecc811a5ce57a0eeacc4af3c0 Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 14:07:32 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20LoginView=20AppleLoginView=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Login/LoginFeature.swift | 13 ++++ .../Sources/Login/LoginFeatureInterface.swift | 2 + .../Interface/Sources/Login/LoginView.swift | 67 +++++-------------- 3 files changed, 30 insertions(+), 52 deletions(-) diff --git a/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift b/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift index 4fd0dcf8..96e9b61e 100644 --- a/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift +++ b/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift @@ -99,6 +99,10 @@ extension LoginFeature { return goToOboarding(state: &state) } + case .snsLoginButtonDidTapped: + state.path.append(.appleLogin(AppleLoginFeature.State())) + return .none + case .path(.element(id: _, action: .onBoarding(.delegate(.createOnboardingProfileDidCompleted)))): return .send(.delegate(.createOnboardingProfileDidCompleted)) @@ -114,6 +118,13 @@ extension LoginFeature { return handleLoginSuccessUserInfo(state: &state, userInfo: userInfo) } + // appleLogin Delegate + + case let .path(.element(id: _, action: .appleLogin(.delegate(delegate)))): + switch delegate { + case .signInAppleButtonDidTapped: + return .send(.signInAppleButtonDidTapped) + } default: return .none } @@ -133,6 +144,7 @@ extension LoginFeature { Log.error(token) + state.path.removeAll() if let userName = userInfo.userName, !isSignUp { return .send(.userProfileFetchRequired(userName: userName)) } @@ -155,6 +167,7 @@ extension LoginFeature { case generalLogin(GeneralLogInFeature) case generalSignUp(GeneralSignUpFeature) case onBoarding(OnboardingFeature) + case appleLogin(AppleLoginFeature) } // MARK: - Destination diff --git a/Projects/Feature/Login/Interface/Sources/Login/LoginFeatureInterface.swift b/Projects/Feature/Login/Interface/Sources/Login/LoginFeatureInterface.swift index ad6f44ec..0b70a476 100644 --- a/Projects/Feature/Login/Interface/Sources/Login/LoginFeatureInterface.swift +++ b/Projects/Feature/Login/Interface/Sources/Login/LoginFeatureInterface.swift @@ -40,9 +40,11 @@ public struct LoginFeature { // View Life Cycle case onAppear + // User Action case signInKakaoButtonDidTapped case signInGeneralButtonDidTapped case signInAppleButtonDidTapped + case snsLoginButtonDidTapped case personalInformationTermButtonDidTapped case utilizationTermButtonDidTapped diff --git a/Projects/Feature/Login/Interface/Sources/Login/LoginView.swift b/Projects/Feature/Login/Interface/Sources/Login/LoginView.swift index 8526f634..cc0100ec 100644 --- a/Projects/Feature/Login/Interface/Sources/Login/LoginView.swift +++ b/Projects/Feature/Login/Interface/Sources/Login/LoginView.swift @@ -35,12 +35,10 @@ public struct LoginView: View { mainText Spacer() - VStack(spacing: 12.0) { + + VStack(spacing: 30.0) { signInWithKakaoButton - - signInWithAppleButton - - termsGuides + snsLoginButton } .padding(.bottom, 30.0) } @@ -77,6 +75,11 @@ public struct LoginView: View { if let store = store.scope(state: \.generalSignUp, action: \.generalSignUp) { GeneralSignUpView(store: store) } + + case .appleLogin: + if let store = store.scope(state: \.appleLogin, action: \.appleLogin) { + AppleLoginView(store: store) + } } } } @@ -127,54 +130,14 @@ public extension LoginView { .padding(.horizontal, .md) } - var signInWithGeneralButton: some View { - SolidButton( - title: "일반 로그인", - sizeType: .large, - buttonType: .throttle, - buttonApperance: .generalSignIn, - action: { store.send(.signInGeneralButtonDidTapped) } + var snsLoginButton: some View { + WantedSansStyleText( + "한국 전화번호가 없나요? SNS로 로그인하기", + style: .caption, + color: .enableQuaternary ) - .padding(.horizontal, .md) - } - - var termsGuides: some View { - VStack(alignment: .center, spacing: .xxs) { - HStack(spacing: 0.0) { - WantedSansStyleText( - "로그인 버튼을 누르면 ", - style: .caption, - color: .secondary - ) - - WantedSansStyleText( - "개인정보처리방침", - style: .caption, - color: .secondary - ) - .underline(color: ColorToken.text(.secondary).color) - .asThrottleButton { - store.send(.personalInformationTermButtonDidTapped) - } - } - - HStack(spacing: 0.0) { - WantedSansStyleText( - "보틀이용약관", - style: .caption, - color: .secondary - ) - .underline(color: ColorToken.text(.secondary).color) - .asThrottleButton { - store.send(.utilizationTermButtonDidTapped) - } - - WantedSansStyleText( - "에 동의한 것으로 간주합니다.", - style: .caption, - color: .secondary - ) - } + .asThrottleButton { + store.send(.snsLoginButtonDidTapped) } } } From 12495155d343d63f87bc8988c230c991d4173503 Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 22:11:46 +0900 Subject: [PATCH 3/3] =?UTF-8?q?chore:=20=EB=B9=8C=EB=93=9C=20=EB=84=98?= =?UTF-8?q?=EB=B2=84=201.0.2=20(21)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift b/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift index 0e81bb24..4f4a5380 100644 --- a/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift +++ b/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift @@ -10,8 +10,8 @@ import ProjectDescription public extension InfoPlist { static var app: InfoPlist { return .extendingDefault(with: [ - "CFBundleShortVersionString": "1.0.1", - "CFBundleVersion": "20", + "CFBundleShortVersionString": "1.0.2", + "CFBundleVersion": "21", "UIUserInterfaceStyle": "Light", "CFBundleName": "보틀", "UILaunchScreen": [ @@ -39,8 +39,8 @@ public extension InfoPlist { static var example: InfoPlist { return .extendingDefault(with: [ - "CFBundleShortVersionString": "1.0.1", - "CFBundleVersion": "20", + "CFBundleShortVersionString": "1.0.2", + "CFBundleVersion": "21", "UIUserInterfaceStyle": "Light", "UILaunchScreen": [:], "UISupportedInterfaceOrientations": [