Skip to content

Commit

Permalink
[feat] DDD-Community#43 - 마이페이지 계정 관리 뷰 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
honghoker committed Jan 18, 2025
1 parent 70ddf95 commit 7dfa110
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 0 deletions.
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
}
}
}
}
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)
}
}

0 comments on commit 7dfa110

Please sign in to comment.