-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from Nexters/release/1.0.2
v1.0.2 Release -> Main
- Loading branch information
Showing
7 changed files
with
176 additions
and
56 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
Projects/Feature/Login/Interface/Sources/Login/AppleLoginFeature.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
Projects/Feature/Login/Interface/Sources/Login/AppleLoginFeatureInterface.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
Projects/Feature/Login/Interface/Sources/Login/AppleLoginView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters