Rename HighlightsList to Notebook

This commit is contained in:
Jackson Harper
2023-04-07 11:29:18 +08:00
parent 522ea0a3c3
commit fd853e65ee
5 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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) {

View File

@ -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()

View File

@ -345,7 +345,7 @@ struct WebReaderContainerView: View {
}
#if os(iOS)
.sheet(isPresented: $showHighlightsView, onDismiss: onHighlightListViewDismissal) {
HighlightsListView(
NotebookView(
itemObjectID: item.objectID,
hasHighlightMutations: $hasPerformedHighlightMutations
)