Rename HighlightsList to Notebook
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
@State var annotation = String()
|
||||
@State var showAnnotationModal = false
|
||||
|
||||
let viewModel: HighlightsListViewModel
|
||||
let viewModel: NotebookViewModel
|
||||
let highlightParams: HighlightListItemParams
|
||||
@Binding var hasHighlightMutations: Bool
|
||||
let onSaveAnnotation: (String) -> Void
|
||||
|
||||
@ -5,10 +5,10 @@
|
||||
import SwiftUI
|
||||
import Views
|
||||
|
||||
struct HighlightsListView: View {
|
||||
struct NotebookView: View {
|
||||
@EnvironmentObject var dataService: DataService
|
||||
@Environment(\.presentationMode) private var presentationMode
|
||||
@StateObject var viewModel = HighlightsListViewModel()
|
||||
@StateObject var viewModel = NotebookViewModel()
|
||||
|
||||
let itemObjectID: NSManagedObjectID
|
||||
@Binding var hasHighlightMutations: Bool
|
||||
@ -14,7 +14,7 @@ struct HighlightListItemParams: Identifiable {
|
||||
let createdBy: InternalUserProfile?
|
||||
}
|
||||
|
||||
@MainActor final class HighlightsListViewModel: ObservableObject {
|
||||
@MainActor final class NotebookViewModel: ObservableObject {
|
||||
@Published var highlightItems = [HighlightListItemParams]()
|
||||
|
||||
func load(itemObjectID: NSManagedObjectID, dataService: DataService) {
|
||||
@ -81,7 +81,7 @@ struct AnimatingCellHeight: AnimatableModifier {
|
||||
LinkedItemMetadataEditView(item: item)
|
||||
}
|
||||
.sheet(item: $viewModel.itemForHighlightsView) { item in
|
||||
HighlightsListView(itemObjectID: item.objectID, hasHighlightMutations: $hasHighlightMutations)
|
||||
NotebookView(itemObjectID: item.objectID, hasHighlightMutations: $hasHighlightMutations)
|
||||
}
|
||||
.sheet(isPresented: $viewModel.showCommunityModal) {
|
||||
CommunityModal()
|
||||
|
||||
@ -345,7 +345,7 @@ struct WebReaderContainerView: View {
|
||||
}
|
||||
#if os(iOS)
|
||||
.sheet(isPresented: $showHighlightsView, onDismiss: onHighlightListViewDismissal) {
|
||||
HighlightsListView(
|
||||
NotebookView(
|
||||
itemObjectID: item.objectID,
|
||||
hasHighlightMutations: $hasPerformedHighlightMutations
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user