mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Empty state for the Highlights View
This commit is contained in:
parent
9cc180d43b
commit
68a304664c
4 changed files with 31 additions and 19 deletions
|
|
@ -12,7 +12,35 @@ struct HighlightsListView: View {
|
|||
let itemObjectID: NSManagedObjectID
|
||||
@Binding var hasHighlightMutations: Bool
|
||||
|
||||
var emptyView: some View {
|
||||
Text("""
|
||||
You have not added any highlights to this page.
|
||||
""")
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(16)
|
||||
}
|
||||
|
||||
var innerBody: some View {
|
||||
(viewModel.highlightItems.count > 0 ? AnyView(listView) : AnyView(emptyView))
|
||||
.navigationTitle("Highlights & Notes")
|
||||
.listStyle(PlainListStyle())
|
||||
#if os(iOS)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
dismissButton
|
||||
}
|
||||
}
|
||||
#else
|
||||
.toolbar {
|
||||
ToolbarItemGroup {
|
||||
dismissButton
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
var listView: some View {
|
||||
List {
|
||||
Section {
|
||||
ForEach(viewModel.highlightItems) { highlightParams in
|
||||
|
|
@ -38,22 +66,6 @@ struct HighlightsListView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
.navigationTitle("Highlights")
|
||||
.listStyle(PlainListStyle())
|
||||
#if os(iOS)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
dismissButton
|
||||
}
|
||||
}
|
||||
#else
|
||||
.toolbar {
|
||||
ToolbarItemGroup {
|
||||
dismissButton
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
var dismissButton: some View {
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ import Views
|
|||
.contextMenu {
|
||||
Button(
|
||||
action: { viewModel.itemForHighlightsView = item },
|
||||
label: { Label("View Highlights", systemImage: "highlighter") }
|
||||
label: { Label("View Highlights & Notes", systemImage: "highlighter") }
|
||||
)
|
||||
Button(
|
||||
action: { viewModel.itemUnderTitleEdit = item },
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ struct WebReaderContainerView: View {
|
|||
Group {
|
||||
Button(
|
||||
action: { showHighlightsView = true },
|
||||
label: { Label("View Highlights", systemImage: "highlighter") }
|
||||
label: { Label("View Highlights & Notes", systemImage: "highlighter") }
|
||||
)
|
||||
Button(
|
||||
action: { showTitleEdit = true },
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public struct GridCard: View {
|
|||
Group {
|
||||
Button(
|
||||
action: { menuActionHandler(.viewHighlights) },
|
||||
label: { Label("View Highlights", systemImage: "highlighter") }
|
||||
label: { Label("View Highlights & Notes", systemImage: "highlighter") }
|
||||
)
|
||||
Button(
|
||||
action: { menuActionHandler(.editTitle) },
|
||||
|
|
|
|||
Loading…
Reference in a new issue