From fd853e65eead263f06d870d83f55ec2e0231fb4f Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 7 Apr 2023 11:29:18 +0800 Subject: [PATCH] Rename HighlightsList to Notebook --- .../Sources/App/Views/Highlights/HighlightsListCard.swift | 2 +- .../{HighlightsListView.swift => NotebookView.swift} | 4 ++-- ...{HighlightsListViewModel.swift => NotebookViewModel.swift} | 2 +- .../OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift | 2 +- .../Sources/App/Views/WebReader/WebReaderContainer.swift | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename apple/OmnivoreKit/Sources/App/Views/Highlights/{HighlightsListView.swift => NotebookView.swift} (97%) rename apple/OmnivoreKit/Sources/App/Views/Highlights/{HighlightsListViewModel.swift => NotebookViewModel.swift} (97%) diff --git a/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListCard.swift b/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListCard.swift index 674680562..d22fcd593 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListCard.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListCard.swift @@ -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 diff --git a/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListView.swift b/apple/OmnivoreKit/Sources/App/Views/Highlights/NotebookView.swift similarity index 97% rename from apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListView.swift rename to apple/OmnivoreKit/Sources/App/Views/Highlights/NotebookView.swift index 25a88b2fd..76904f3e3 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Highlights/NotebookView.swift @@ -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 diff --git a/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListViewModel.swift b/apple/OmnivoreKit/Sources/App/Views/Highlights/NotebookViewModel.swift similarity index 97% rename from apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListViewModel.swift rename to apple/OmnivoreKit/Sources/App/Views/Highlights/NotebookViewModel.swift index 77e8c6320..406b1c909 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListViewModel.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Highlights/NotebookViewModel.swift @@ -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) { diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift index a3e3d1aba..1e17887b7 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift @@ -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() diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift index dadf04dba..44f4b27e6 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift @@ -345,7 +345,7 @@ struct WebReaderContainerView: View { } #if os(iOS) .sheet(isPresented: $showHighlightsView, onDismiss: onHighlightListViewDismissal) { - HighlightsListView( + NotebookView( itemObjectID: item.objectID, hasHighlightMutations: $hasPerformedHighlightMutations )