diff --git a/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListCard.swift b/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListCard.swift index aa067a6fa..fd4e3fd12 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListCard.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListCard.swift @@ -1,8 +1,11 @@ import Models import SwiftUI +import Views struct HighlightsListCard: View { @State var isContextMenuOpen = false + @State var annotation = String() + @State var showAnnotationModal = false let highlight: Highlight @@ -34,6 +37,10 @@ struct HighlightsListCard: View { Text(highlight.annotation ?? "") } + .onTapGesture { + annotation = highlight.annotation ?? "" + showAnnotationModal = true + } } var addNoteSection: some View { @@ -48,7 +55,8 @@ struct HighlightsListCard: View { Spacer() } .onTapGesture { - print("add a note") + annotation = highlight.annotation ?? "" + showAnnotationModal = true } } @@ -96,5 +104,18 @@ struct HighlightsListCard: View { } .padding(.bottom, 8) } + .sheet(isPresented: $showAnnotationModal) { + HighlightAnnotationSheet( + annotation: $annotation, + onSave: { + print("new annotation = \(annotation)") + showAnnotationModal = false + }, + onCancel: { + print("cancel annotation") + showAnnotationModal = false + } + ) + } } } diff --git a/apple/OmnivoreKit/Sources/Views/Article/HighlightAnnotationSheet.swift b/apple/OmnivoreKit/Sources/Views/Article/HighlightAnnotationSheet.swift index 30dc1def4..bf0a872c6 100644 --- a/apple/OmnivoreKit/Sources/Views/Article/HighlightAnnotationSheet.swift +++ b/apple/OmnivoreKit/Sources/Views/Article/HighlightAnnotationSheet.swift @@ -22,15 +22,13 @@ public struct HighlightAnnotationSheet: View { HStack { Button("Cancel", action: onCancel) Spacer() - HStack { - Image(systemName: "note.text") - Text("Note") - } + Label("Note", systemImage: "note.text") Spacer() Button("Save") { onSave() } } + .foregroundColor(.appGrayTextContrast) ScrollView { TextEditor(text: $annotation)