Skip to content

Commit

Permalink
Merge pull request #200 from Nexters/release/1.0.2
Browse files Browse the repository at this point in the history
v1.0.2 Release -> Main
  • Loading branch information
leemhyungyu authored Aug 23, 2024
2 parents 43a24e3 + 1249515 commit d321de7
Show file tree
Hide file tree
Showing 7 changed files with 176 additions and 56 deletions.
Original file line number Diff line number Diff line change
@@ -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> { 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)
}
}
Original file line number Diff line number Diff line change
@@ -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<State, Action>

public init(reducer: Reduce<State, Action>) {
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<Self> {
reducer
}
}
Original file line number Diff line number Diff line change
@@ -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<AppleLoginFeature>

public init(store: StoreOf<AppleLoginFeature>) {
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)
}
}
13 changes: 13 additions & 0 deletions Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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
}
Expand All @@ -133,6 +144,7 @@ extension LoginFeature {

Log.error(token)

state.path.removeAll()
if let userName = userInfo.userName, !isSignUp {
return .send(.userProfileFetchRequired(userName: userName))
}
Expand All @@ -155,6 +167,7 @@ extension LoginFeature {
case generalLogin(GeneralLogInFeature)
case generalSignUp(GeneralSignUpFeature)
case onBoarding(OnboardingFeature)
case appleLogin(AppleLoginFeature)
}

// MARK: - Destination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
67 changes: 15 additions & 52 deletions Projects/Feature/Login/Interface/Sources/Login/LoginView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
}
}
}
Expand Down Expand Up @@ -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)
}
}
}
8 changes: 4 additions & 4 deletions Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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": [
Expand Down

0 comments on commit d321de7

Please sign in to comment.