From fbdbf37c2cd28486e4c38563469ce6ce4c70640a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:33:26 +0900 Subject: [PATCH] =?UTF-8?q?[design]=20#154=20ContentSetting=20=EC=82=AC?= =?UTF-8?q?=EC=9D=B4=EB=93=9C=EB=B0=94=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pokit/PokitSplitFeature.swift | 13 +++++- .../MainTabSplit/Pokit/PokitSplitView.swift | 44 ++++++++++++++----- 2 files changed, 44 insertions(+), 13 deletions(-) diff --git a/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitFeature.swift b/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitFeature.swift index d2d55403..f90b4739 100644 --- a/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitFeature.swift +++ b/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitFeature.swift @@ -4,6 +4,8 @@ // // Created by 김도형 on 10/24/24. +import SwiftUI + import ComposableArchitecture import FeaturePokit import FeatureCategoryDetail @@ -24,6 +26,8 @@ public struct PokitSplitFeature { /// - State @ObservableState public struct State: Equatable { + var columnVisibility: NavigationSplitViewVisibility = .doubleColumn + var 포킷: PokitRootFeature.State = .init() var 카테고리상세: CategoryDetailFeature.State? var 링크추가및수정: ContentSettingFeature.State = .init() @@ -61,8 +65,13 @@ public struct PokitSplitFeature { case 링크상세(ContentDetailFeature.Action) @CasePathable - public enum View: Equatable { + public enum View: Equatable, BindableAction { + case binding(BindingAction) + case 뷰가_나타났을때 + case 검색_버튼_눌렀을때 + case 알람_버튼_눌렀을때 + case 설정_버튼_눌렀을때 } public enum InnerAction: Equatable { @@ -128,6 +137,8 @@ public struct PokitSplitFeature { /// - Reducer body public var body: some ReducerOf { + BindingReducer(action: \.view) + Scope(state: \.포킷, action: \.포킷) { PokitRootFeature() } diff --git a/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitView.swift b/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitView.swift index 77017f81..533147ca 100644 --- a/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitView.swift +++ b/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitView.swift @@ -16,10 +16,12 @@ import FeatureContentSetting import FeatureCategoryDetail import FeatureContentList import FeatureCategorySharing +import DSKit @ViewAction(for: PokitSplitFeature.self) public struct PokitSplitView: View { /// - Properties + @Perception.Bindable public var store: StoreOf /// - Initializer @@ -31,29 +33,47 @@ public struct PokitSplitView: View { public extension PokitSplitView { var body: some View { WithPerceptionTracking { - NavigationSplitView(columnVisibility: .constant(.all)) { + NavigationSplitView(columnVisibility: $store.columnVisibility) { + ContentSettingView(store: store.scope(state: \.링크추가및수정, action: \.링크추가및수정)) + } content: { PokitRootView(store: store.scope(state: \.포킷, action: \.포킷)) - .toolbar(.hidden, for: .navigationBar) + .pokitNavigationBar { pokitNavigationBar } } detail: { - detail - .toolbar(.hidden, for: .navigationBar) + if let store = store.scope(state: \.카테고리상세, action: \.카테고리상세) { + CategoryDetailView(store: store) + } } + } } } //MARK: - Configure View private extension PokitSplitView { - var detail: some View { - HStack(spacing: 0) { - if let store = store.scope(state: \.카테고리상세, action: \.카테고리상세) { - CategoryDetailView(store: store) - } else { - Spacer() + var pokitNavigationBar: some View { + PokitHeader { + PokitHeaderItems(placement: .leading) { + Image(.logo(.pokit)) + .resizable() + .frame(width: 104, height: 32) + .foregroundStyle(.pokit(.icon(.brand))) } - ContentSettingView(store: store.scope(state: \.링크추가및수정, action: \.링크추가및수정)) - .frame(width: 375) + PokitHeaderItems(placement: .trailing) { + PokitToolbarButton( + .icon(.search), + action: { send(.검색_버튼_눌렀을때) } + ) + PokitToolbarButton( + .icon(.bell), + action: { send(.알람_버튼_눌렀을때) } + ) + PokitToolbarButton( + .icon(.setup), + action: { send(.설정_버튼_눌렀을때) } + ) + } } + .padding(.vertical, 8) } } //MARK: - Preview