Hide action bar in longform quote reposts

Changelog-Fixed: Fix action bar appearing on quoted longform previews
This commit is contained in:
William Casarin
2023-07-11 10:26:29 -07:00
parent 8e33d5f6b9
commit dc7b0004bc
3 changed files with 8 additions and 5 deletions

View File

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

View File

@@ -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])
}
}
}

View File

@@ -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: [])
}
}