diff --git a/Projects/Feature/MyPage/Sources/AccountManagement/AccountManagementStore.swift b/Projects/Feature/MyPage/Sources/AccountManagement/AccountManagementStore.swift new file mode 100644 index 0000000..8a5807b --- /dev/null +++ b/Projects/Feature/MyPage/Sources/AccountManagement/AccountManagementStore.swift @@ -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 { + Reduce { state, action in + switch action { + default: + return .none + } + } + } +} diff --git a/Projects/Feature/MyPage/Sources/AccountManagement/AccountManagementView.swift b/Projects/Feature/MyPage/Sources/AccountManagement/AccountManagementView.swift new file mode 100644 index 0000000..3dc740c --- /dev/null +++ b/Projects/Feature/MyPage/Sources/AccountManagement/AccountManagementView.swift @@ -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 + + public init(store: StoreOf) { + 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) + } +}