diff --git a/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitFeature.swift b/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitFeature.swift index 5217b340..47cbc2be 100644 --- a/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitFeature.swift +++ b/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitFeature.swift @@ -26,7 +26,7 @@ public struct PokitSplitFeature { /// - State @ObservableState public struct State: Equatable { - var columnVisibility: NavigationSplitViewVisibility = .doubleColumn + var columnVisibility: NavigationSplitViewVisibility = UIDevice.current.orientation == .portrait ? .detailOnly : .all var 포킷: PokitRootFeature.State = .init() var 카테고리상세: CategoryDetailFeature.State? @@ -69,6 +69,7 @@ public struct PokitSplitFeature { case binding(BindingAction) case 뷰가_나타났을때 + case 링크추가_버튼_눌렀을때 case 검색_버튼_눌렀을때 case 알람_버튼_눌렀을때 case 설정_버튼_눌렀을때 @@ -168,7 +169,21 @@ public struct PokitSplitFeature { private extension PokitSplitFeature { /// - View Effect func handleViewAction(_ action: Action.View, state: inout State) -> Effect { - return .none + switch action { + case .binding: + return .none + case .뷰가_나타났을때: + return .none + case .링크추가_버튼_눌렀을때: + state.columnVisibility = .all + return .none + case .검색_버튼_눌렀을때: + return .none + case .알람_버튼_눌렀을때: + return .none + case .설정_버튼_눌렀을때: + return .none + } } /// - Inner Effect @@ -200,6 +215,9 @@ private extension PokitSplitFeature { case .카테고리상세: return .none + case .링크추가및수정(.delegate(.dismiss)): + state.columnVisibility = .detailOnly + return .none case .링크추가및수정: return .none diff --git a/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitView.swift b/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitView.swift index 533147ca..dd592cb3 100644 --- a/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitView.swift +++ b/Projects/App/Sources/MainTabSplit/Pokit/PokitSplitView.swift @@ -35,20 +35,30 @@ public extension PokitSplitView { WithPerceptionTracking { NavigationSplitView(columnVisibility: $store.columnVisibility) { ContentSettingView(store: store.scope(state: \.링크추가및수정, action: \.링크추가및수정)) - } content: { - PokitRootView(store: store.scope(state: \.포킷, action: \.포킷)) - .pokitNavigationBar { pokitNavigationBar } + .toolbar(.hidden, for: .navigationBar) } detail: { - if let store = store.scope(state: \.카테고리상세, action: \.카테고리상세) { - CategoryDetailView(store: store) - } + detail + .toolbar(.hidden, for: .navigationBar) } - } } } //MARK: - Configure View private extension PokitSplitView { + var detail: some View { + HStack(spacing: 0) { + PokitRootView(store: store.scope(state: \.포킷, action: \.포킷)) + .pokitNavigationBar { pokitNavigationBar } + .frame(width: 400) + + if let store = store.scope(state: \.카테고리상세, action: \.카테고리상세) { + CategoryDetailView(store: store) + } else { + Spacer() + } + } + } + var pokitNavigationBar: some View { PokitHeader { PokitHeaderItems(placement: .leading) { @@ -59,6 +69,13 @@ private extension PokitSplitView { } PokitHeaderItems(placement: .trailing) { + if store.columnVisibility == .detailOnly { + PokitToolbarButton( + .icon(.edit), + action: { send(.링크추가_버튼_눌렀을때) } + ) + } + PokitToolbarButton( .icon(.search), action: { send(.검색_버튼_눌렀을때) } diff --git a/Projects/Feature/FeatureContentSetting/Sources/ContentSetting/ContentSettingFeature.swift b/Projects/Feature/FeatureContentSetting/Sources/ContentSetting/ContentSettingFeature.swift index 8fe7fa4b..d532fdf4 100644 --- a/Projects/Feature/FeatureContentSetting/Sources/ContentSetting/ContentSettingFeature.swift +++ b/Projects/Feature/FeatureContentSetting/Sources/ContentSetting/ContentSettingFeature.swift @@ -212,6 +212,9 @@ private extension ContentSettingFeature { return .send(.delegate(.포킷추가하기)) case .뒤로가기_버튼_눌렀을때: + guard UIDevice.isPhone else { + return .send(.delegate(.dismiss)) + } return state.isShareExtension ? .send(.delegate(.dismiss)) : .run { _ in await dismiss() }