forked from DDD-Community/DDD11-SClass-iOS
-
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.
[feat] DDD-Community#43 - 마이페이지 계정 관리 뷰 추가
- Loading branch information
Showing
2 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
Projects/Feature/MyPage/Sources/AccountManagement/AccountManagementStore.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,39 @@ | ||
// | ||
// AccountManagementStore.swift | ||
// FeatureMyPage | ||
// | ||
// Created by 홍은표 on 1/7/25. | ||
// | ||
|
||
import CoreDomain | ||
import CoreNetwork | ||
|
||
import ComposableArchitecture | ||
|
||
|
||
@Reducer | ||
public struct AccountManagementStore { | ||
@ObservableState | ||
public struct State { | ||
@Shared(.userInfo) var userInfo: UserInfo? | ||
// TODO: - 연동된 SNS 추가 | ||
var linkedSocialPlatform: String = "Apple" | ||
} | ||
|
||
public enum Action { | ||
case didTapBackButton | ||
case didTapLogoutButton | ||
case didTapWithdrawButton | ||
} | ||
|
||
@Dependency(KeychainClient.self) var keychainClient | ||
|
||
public var body: some ReducerOf<Self> { | ||
Reduce { state, action in | ||
switch action { | ||
default: | ||
return .none | ||
} | ||
} | ||
} | ||
} |
103 changes: 103 additions & 0 deletions
103
Projects/Feature/MyPage/Sources/AccountManagement/AccountManagementView.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,103 @@ | ||
// | ||
// AccountManagementView.swift | ||
// FeatureMyPage | ||
// | ||
// Created by 홍은표 on 1/7/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
import SharedDesignSystem | ||
|
||
import ComposableArchitecture | ||
|
||
public struct AccountManagementView: View { | ||
@Bindable private var store: StoreOf<AccountManagementStore> | ||
|
||
public init(store: StoreOf<AccountManagementStore>) { | ||
self.store = store | ||
} | ||
|
||
public var body: some View { | ||
VStack(spacing: 0) { | ||
TopNavigation( | ||
leadingItem: ( | ||
Image.left, | ||
{ store.send(.didTapBackButton) } | ||
), | ||
centerTitle: "계정관리" | ||
) | ||
|
||
VStack(alignment: .leading, spacing: 4) { | ||
accountInformation | ||
logoutButton | ||
withdrawButton | ||
Spacer() | ||
} | ||
.background(Color(hex: "FAFAFA")) | ||
} | ||
} | ||
|
||
private var accountInformation: some View { | ||
HStack { | ||
Text("SNS 연동계정") | ||
.notoSans(.body_2) | ||
.foregroundStyle(.greyScale950) | ||
|
||
Spacer() | ||
|
||
// TODO: - 연동계정 표시 | ||
Text(store.linkedSocialPlatform) | ||
.notoSans(.body_2) | ||
.foregroundStyle(.greyScale500) | ||
} | ||
.padding(.leading, 16) | ||
.padding(.trailing, 14) | ||
.padding(.vertical, 16) | ||
.background(.greyScale0) | ||
} | ||
|
||
private var logoutButton: some View { | ||
Button(action: { | ||
store.send(.didTapLogoutButton) | ||
}) { | ||
HStack { | ||
Text("로그아웃") | ||
.notoSans(.body_2) | ||
.foregroundStyle(.greyScale950) | ||
|
||
Spacer() | ||
|
||
Image.right | ||
.resizable() | ||
.frame(width: 18, height: 18) | ||
} | ||
.padding(.leading, 16) | ||
.padding(.trailing, 19) | ||
.padding(.vertical, 16) | ||
} | ||
.background(.greyScale0) | ||
} | ||
|
||
private var withdrawButton: some View { | ||
Button(action: { | ||
store.send(.didTapWithdrawButton) | ||
}) { | ||
HStack { | ||
Text("회원탈퇴") | ||
.notoSans(.body_2) | ||
.foregroundStyle(.greyScale950) | ||
|
||
Spacer() | ||
|
||
Image.right | ||
.resizable() | ||
.frame(width: 18, height: 18) | ||
} | ||
.padding(.leading, 16) | ||
.padding(.trailing, 19) | ||
.padding(.vertical, 16) | ||
} | ||
.background(.greyScale0) | ||
} | ||
} |