summaryrefslogtreecommitdiff
path: root/Sora/Views/ContentView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Sora/Views/ContentView.swift')
-rw-r--r--Sora/Views/ContentView.swift25
1 files changed, 21 insertions, 4 deletions
diff --git a/Sora/Views/ContentView.swift b/Sora/Views/ContentView.swift
index 5878619..d6473ab 100644
--- a/Sora/Views/ContentView.swift
+++ b/Sora/Views/ContentView.swift
@@ -2,18 +2,35 @@ import SwiftUI
struct ContentView: View {
@EnvironmentObject var manager: BooruManager
+ @State private var selectedTabIndex: Int = 1
+ @State private var tabs = [
+ "Posts",
+ "Bookmarks",
+ ]
var body: some View {
#if os(macOS)
NavigationSplitView {
- PostGridView(
- manager: manager
- )
+ List(selection: $selectedTabIndex) {
+ ForEach(Array(tabs.enumerated()), id: \.offset) { index, element in
+ NavigationLink(value: index) {
+ Text(element)
+ }
+ }
+ }
+ } content: {
+ if selectedTabIndex == 1 {
+ BookmarksView(selectedTab: $selectedTabIndex)
+ } else {
+ PostGridView(
+ manager: manager
+ )
+ }
} detail: {
if let post = manager.selectedPost {
PostDetailsView(post: post)
} else {
- Text("Select a post.")
+ Text("Select a Post")
.foregroundColor(.secondary)
}
}