summaryrefslogtreecommitdiff
path: root/Sora/Views/ContentView.swift
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-02-21 01:53:31 -0800
committerFuwn <[email protected]>2025-02-21 01:53:35 -0800
commit617370e834db97c2c6ce5c5bbd3825fcad013b7f (patch)
tree8d20d45c0cb1169d8c08509e106d0d57b0d71c72 /Sora/Views/ContentView.swift
parentfeat: Development commit (diff)
downloadsora-testing-617370e834db97c2c6ce5c5bbd3825fcad013b7f.tar.xz
sora-testing-617370e834db97c2c6ce5c5bbd3825fcad013b7f.zip
feat: Development commit
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)
}
}