damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit dc7b0004bccfb1a0ae2eefc0b7fd3a1862809ca5
parent 8e33d5f6b923cb726ef7fe5b2ce5845a9e8cc41a
Author: William Casarin <jb55@jb55.com>
Date:   Tue, 11 Jul 2023 10:26:29 -0700

Hide action bar in longform quote reposts

Changelog-Fixed: Fix action bar appearing on quoted longform previews

Diffstat:
Mdamus/Views/EventView.swift | 2+-
Mdamus/Views/Events/EventShell.swift | 2+-
Mdamus/Views/Events/Longform/LongformPreview.swift | 9++++++---
3 files changed, 8 insertions(+), 5 deletions(-)

diff --git 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 @@ -57,7 +57,7 @@ struct EventShell<Content: View>: 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 @@ -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: []) } }