diff --git a/damus/Views/EventView.swift b/damus/Views/EventView.swift index c24421f8..841728bb 100644 --- a/damus/Views/EventView.swift +++ b/damus/Views/EventView.swift @@ -44,7 +44,7 @@ struct EventView: View { EmptyView() } } else if event.known_kind == .longform { - LongformPreview(state: damus, ev: event) + LongformPreview(state: damus, ev: event, options: options) } else { TextEvent(damus: damus, event: event, pubkey: pubkey, options: options) //.padding([.top], 6) diff --git a/damus/Views/Events/EventShell.swift b/damus/Views/Events/EventShell.swift index 762d2b7e..835eead5 100644 --- a/damus/Views/Events/EventShell.swift +++ b/damus/Views/Events/EventShell.swift @@ -57,7 +57,7 @@ struct EventShell: View { if has_action_bar { //EmptyRect EventActionBar(damus_state: state, event: event) - .padding(.horizontal) + .padding([.leading, .trailing, .top]) } } } diff --git a/damus/Views/Events/Longform/LongformPreview.swift b/damus/Views/Events/Longform/LongformPreview.swift index e01b0d75..5c96cdef 100644 --- a/damus/Views/Events/Longform/LongformPreview.swift +++ b/damus/Views/Events/Longform/LongformPreview.swift @@ -10,11 +10,14 @@ import SwiftUI struct LongformPreview: View { let state: DamusState let event: LongformEvent + let options: EventViewOptions @ObservedObject var artifacts: NoteArtifactsModel - init(state: DamusState, ev: NostrEvent) { + init(state: DamusState, ev: NostrEvent, options: EventViewOptions) { self.state = state self.event = LongformEvent.parse(from: ev) + self.options = options + self._artifacts = ObservedObject(wrappedValue: state.events.get_cache_data(ev.id).artifacts_model) } @@ -23,7 +26,7 @@ struct LongformPreview: View { } var body: some View { - EventShell(state: state, event: event.event, options: [.no_mentions]) { + EventShell(state: state, event: event.event, options: options.union(.no_mentions)) { VStack(alignment: .leading, spacing: 10) { Text(event.title ?? "Untitled") .font(.title) @@ -44,6 +47,6 @@ struct LongformPreview: View { struct LongformPreview_Previews: PreviewProvider { static var previews: some View { - LongformPreview(state: test_damus_state(), ev: test_longform_event.event) + LongformPreview(state: test_damus_state(), ev: test_longform_event.event, options: []) } }