mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Fix new splitview layout on iPad
This commit is contained in:
parent
b099d22115
commit
e7861b0747
4 changed files with 65 additions and 5 deletions
|
|
@ -35,11 +35,10 @@ enum PrimaryContentCategory: Identifiable, Hashable, Equatable {
|
|||
Label { Text(title) } icon: { image.renderingMode(.template) }
|
||||
}
|
||||
|
||||
@ViewBuilder var destinationView: some View {
|
||||
@MainActor @ViewBuilder var destinationView: some View {
|
||||
switch self {
|
||||
case .feed:
|
||||
// HomeView(viewModel: HomeFeedViewModel())
|
||||
EmptyView()
|
||||
LibraryListView()
|
||||
case .profile:
|
||||
ProfileView()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
//
|
||||
// File.swift
|
||||
//
|
||||
//
|
||||
// Created by Jackson Harper on 6/29/23.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Models
|
||||
import SwiftUI
|
||||
|
||||
struct LibraryListView: View {
|
||||
@StateObject private var subViewModel = HomeFeedViewModel(
|
||||
listConfig: LibraryListConfig(
|
||||
hasFeatureCards: false,
|
||||
leadingSwipeActions: [.moveToInbox],
|
||||
trailingSwipeActions: [.delete, .archive],
|
||||
cardStyle: .library
|
||||
)
|
||||
)
|
||||
|
||||
@StateObject private var libraryViewModel = HomeFeedViewModel(
|
||||
listConfig: LibraryListConfig(
|
||||
hasFeatureCards: true,
|
||||
leadingSwipeActions: [.pin],
|
||||
trailingSwipeActions: [.delete, .archive],
|
||||
cardStyle: .library
|
||||
)
|
||||
)
|
||||
|
||||
@StateObject private var highlightsViewModel = HomeFeedViewModel(
|
||||
listConfig: LibraryListConfig(
|
||||
hasFeatureCards: true,
|
||||
leadingSwipeActions: [.pin],
|
||||
trailingSwipeActions: [.delete, .archive],
|
||||
cardStyle: .highlights
|
||||
)
|
||||
)
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
NavigationLink(
|
||||
destination: LinkDestination(selectedItem: libraryViewModel.selectedItem),
|
||||
isActive: $libraryViewModel.linkIsActive
|
||||
) {
|
||||
EmptyView()
|
||||
}
|
||||
HomeView(viewModel: libraryViewModel)
|
||||
.tabItem {
|
||||
Label {
|
||||
Text("Library")
|
||||
} icon: {
|
||||
Image.tabLibrary
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationViewStyle(.stack)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
}
|
||||
}
|
||||
|
|
@ -75,5 +75,6 @@ struct LibraryTabView: View {
|
|||
}
|
||||
}
|
||||
.navigationViewStyle(.stack)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import Services
|
|||
import SwiftUI
|
||||
import Views
|
||||
|
||||
public struct PrimaryContentView: View {
|
||||
@MainActor public struct PrimaryContentView: View {
|
||||
let categories = [
|
||||
PrimaryContentCategory.feed,
|
||||
PrimaryContentCategory.profile
|
||||
|
|
@ -52,7 +52,7 @@ public struct PrimaryContentView: View {
|
|||
#endif
|
||||
}
|
||||
|
||||
struct PrimaryContentSidebar: View {
|
||||
@MainActor struct PrimaryContentSidebar: View {
|
||||
@State private var selectedCategory: PrimaryContentCategory?
|
||||
let categories: [PrimaryContentCategory]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue