Skip to content

Commit d321de7

Browse files
authored
Merge pull request #200 from Nexters/release/1.0.2
v1.0.2 Release -> Main
2 parents 43a24e3 + 1249515 commit d321de7

File tree

7 files changed

+176
-56
lines changed

7 files changed

+176
-56
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// AppleLoginFeature.swift
3+
// FeatureLoginInterface
4+
//
5+
// Created by 임현규 on 8/23/24.
6+
//
7+
8+
import Foundation
9+
10+
import ComposableArchitecture
11+
12+
extension AppleLoginFeature {
13+
public init() {
14+
@Dependency(\.dismiss) var dismiss
15+
16+
let reducer = Reduce<State, Action> { state, action in
17+
switch action {
18+
case .signInAppleButtonDidTapped:
19+
return .send(.delegate(.signInAppleButtonDidTapped))
20+
21+
case .backButtonDidTapped:
22+
return .run { send in
23+
await dismiss()
24+
}
25+
26+
default:
27+
return .none
28+
}
29+
}
30+
31+
self.init(reducer: reducer)
32+
}
33+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// AppleLoginFeatureInterface.swift
3+
// FeatureLoginInterface
4+
//
5+
// Created by 임현규 on 8/23/24.
6+
//
7+
8+
import Foundation
9+
10+
import ComposableArchitecture
11+
12+
@Reducer
13+
public struct AppleLoginFeature {
14+
private let reducer: Reduce<State, Action>
15+
16+
public init(reducer: Reduce<State, Action>) {
17+
self.reducer = reducer
18+
}
19+
20+
public struct State: Equatable {
21+
public init() {}
22+
}
23+
24+
public enum Action {
25+
case signInAppleButtonDidTapped
26+
case backButtonDidTapped
27+
case delegate(Delegate)
28+
29+
public enum Delegate {
30+
case signInAppleButtonDidTapped
31+
}
32+
}
33+
34+
public var body: some ReducerOf<Self> {
35+
reducer
36+
}
37+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
//
2+
// AppleLoginView.swift
3+
// FeatureLoginInterface
4+
//
5+
// Created by 임현규 on 8/23/24.
6+
//
7+
8+
import SwiftUI
9+
10+
import SharedDesignSystem
11+
12+
import ComposableArchitecture
13+
14+
public struct AppleLoginView: View {
15+
private let store: StoreOf<AppleLoginFeature>
16+
17+
public init(store: StoreOf<AppleLoginFeature>) {
18+
self.store = store
19+
}
20+
21+
public var body: some View {
22+
VStack(spacing: 0) {
23+
Spacer()
24+
.frame(height: 52)
25+
whiteLogo
26+
.padding(.top, 52)
27+
.padding(.bottom, .xl)
28+
mainText
29+
30+
Spacer()
31+
32+
signInWithAppleButton
33+
.padding(.bottom, 30.0)
34+
35+
}
36+
.background {
37+
BottleImageView(
38+
type: .local(bottleImageSystem: .illustraition(.loginBackground))
39+
)
40+
}
41+
.setNavigationBar {
42+
makeNaivgationleftButton() {
43+
store.send(.backButtonDidTapped)
44+
}
45+
}
46+
.edgesIgnoringSafeArea([.top, .bottom])
47+
}
48+
}
49+
50+
private extension AppleLoginView {
51+
var whiteLogo: some View {
52+
BottleImageView(type: .local(bottleImageSystem: .illustraition(.whiteLogo)))
53+
.frame(width: 117.1, height: 30)
54+
}
55+
56+
var mainText: some View {
57+
WantedSansStyleText("진심을 담은 보틀로\n서로를 밀도있게 알아가요", style: .title2, color: .quaternary)
58+
.padding(.horizontal, .md)
59+
.multilineTextAlignment(.center)
60+
}
61+
62+
var signInWithAppleButton: some View {
63+
SolidButton(
64+
title: "Apple로 로그인",
65+
sizeType: .large,
66+
buttonType: .throttle,
67+
buttonApperance: .apple,
68+
action: { store.send(.signInAppleButtonDidTapped) }
69+
)
70+
.padding(.horizontal, .md)
71+
}
72+
}

Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ extension LoginFeature {
9999
return goToOboarding(state: &state)
100100
}
101101

102+
case .snsLoginButtonDidTapped:
103+
state.path.append(.appleLogin(AppleLoginFeature.State()))
104+
return .none
105+
102106
case .path(.element(id: _, action: .onBoarding(.delegate(.createOnboardingProfileDidCompleted)))):
103107
return .send(.delegate(.createOnboardingProfileDidCompleted))
104108

@@ -114,6 +118,13 @@ extension LoginFeature {
114118
return handleLoginSuccessUserInfo(state: &state, userInfo: userInfo)
115119
}
116120

121+
// appleLogin Delegate
122+
123+
case let .path(.element(id: _, action: .appleLogin(.delegate(delegate)))):
124+
switch delegate {
125+
case .signInAppleButtonDidTapped:
126+
return .send(.signInAppleButtonDidTapped)
127+
}
117128
default:
118129
return .none
119130
}
@@ -133,6 +144,7 @@ extension LoginFeature {
133144

134145
Log.error(token)
135146

147+
state.path.removeAll()
136148
if let userName = userInfo.userName, !isSignUp {
137149
return .send(.userProfileFetchRequired(userName: userName))
138150
}
@@ -155,6 +167,7 @@ extension LoginFeature {
155167
case generalLogin(GeneralLogInFeature)
156168
case generalSignUp(GeneralSignUpFeature)
157169
case onBoarding(OnboardingFeature)
170+
case appleLogin(AppleLoginFeature)
158171
}
159172

160173
// MARK: - Destination

Projects/Feature/Login/Interface/Sources/Login/LoginFeatureInterface.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ public struct LoginFeature {
4040
// View Life Cycle
4141
case onAppear
4242

43+
// User Action
4344
case signInKakaoButtonDidTapped
4445
case signInGeneralButtonDidTapped
4546
case signInAppleButtonDidTapped
47+
case snsLoginButtonDidTapped
4648

4749
case personalInformationTermButtonDidTapped
4850
case utilizationTermButtonDidTapped

Projects/Feature/Login/Interface/Sources/Login/LoginView.swift

Lines changed: 15 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,10 @@ public struct LoginView: View {
3535
mainText
3636

3737
Spacer()
38-
VStack(spacing: 12.0) {
38+
39+
VStack(spacing: 30.0) {
3940
signInWithKakaoButton
40-
41-
signInWithAppleButton
42-
43-
termsGuides
41+
snsLoginButton
4442
}
4543
.padding(.bottom, 30.0)
4644
}
@@ -77,6 +75,11 @@ public struct LoginView: View {
7775
if let store = store.scope(state: \.generalSignUp, action: \.generalSignUp) {
7876
GeneralSignUpView(store: store)
7977
}
78+
79+
case .appleLogin:
80+
if let store = store.scope(state: \.appleLogin, action: \.appleLogin) {
81+
AppleLoginView(store: store)
82+
}
8083
}
8184
}
8285
}
@@ -127,54 +130,14 @@ public extension LoginView {
127130
.padding(.horizontal, .md)
128131
}
129132

130-
var signInWithGeneralButton: some View {
131-
SolidButton(
132-
title: "일반 로그인",
133-
sizeType: .large,
134-
buttonType: .throttle,
135-
buttonApperance: .generalSignIn,
136-
action: { store.send(.signInGeneralButtonDidTapped) }
133+
var snsLoginButton: some View {
134+
WantedSansStyleText(
135+
"한국 전화번호가 없나요? SNS로 로그인하기",
136+
style: .caption,
137+
color: .enableQuaternary
137138
)
138-
.padding(.horizontal, .md)
139-
}
140-
141-
var termsGuides: some View {
142-
VStack(alignment: .center, spacing: .xxs) {
143-
HStack(spacing: 0.0) {
144-
WantedSansStyleText(
145-
"로그인 버튼을 누르면 ",
146-
style: .caption,
147-
color: .secondary
148-
)
149-
150-
WantedSansStyleText(
151-
"개인정보처리방침",
152-
style: .caption,
153-
color: .secondary
154-
)
155-
.underline(color: ColorToken.text(.secondary).color)
156-
.asThrottleButton {
157-
store.send(.personalInformationTermButtonDidTapped)
158-
}
159-
}
160-
161-
HStack(spacing: 0.0) {
162-
WantedSansStyleText(
163-
"보틀이용약관",
164-
style: .caption,
165-
color: .secondary
166-
)
167-
.underline(color: ColorToken.text(.secondary).color)
168-
.asThrottleButton {
169-
store.send(.utilizationTermButtonDidTapped)
170-
}
171-
172-
WantedSansStyleText(
173-
"에 동의한 것으로 간주합니다.",
174-
style: .caption,
175-
color: .secondary
176-
)
177-
}
139+
.asThrottleButton {
140+
store.send(.snsLoginButtonDidTapped)
178141
}
179142
}
180143
}

Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import ProjectDescription
1010
public extension InfoPlist {
1111
static var app: InfoPlist {
1212
return .extendingDefault(with: [
13-
"CFBundleShortVersionString": "1.0.1",
14-
"CFBundleVersion": "20",
13+
"CFBundleShortVersionString": "1.0.2",
14+
"CFBundleVersion": "21",
1515
"UIUserInterfaceStyle": "Light",
1616
"CFBundleName": "보틀",
1717
"UILaunchScreen": [
@@ -39,8 +39,8 @@ public extension InfoPlist {
3939

4040
static var example: InfoPlist {
4141
return .extendingDefault(with: [
42-
"CFBundleShortVersionString": "1.0.1",
43-
"CFBundleVersion": "20",
42+
"CFBundleShortVersionString": "1.0.2",
43+
"CFBundleVersion": "21",
4444
"UIUserInterfaceStyle": "Light",
4545
"UILaunchScreen": [:],
4646
"UISupportedInterfaceOrientations": [

0 commit comments

Comments
 (0)