Hide action bar in longform quote reposts
Changelog-Fixed: Fix action bar appearing on quoted longform previews
This commit is contained in:
@@ -44,7 +44,7 @@ struct EventView: View {
|
|||||||
EmptyView()
|
EmptyView()
|
||||||
}
|
}
|
||||||
} else if event.known_kind == .longform {
|
} else if event.known_kind == .longform {
|
||||||
LongformPreview(state: damus, ev: event)
|
LongformPreview(state: damus, ev: event, options: options)
|
||||||
} else {
|
} else {
|
||||||
TextEvent(damus: damus, event: event, pubkey: pubkey, options: options)
|
TextEvent(damus: damus, event: event, pubkey: pubkey, options: options)
|
||||||
//.padding([.top], 6)
|
//.padding([.top], 6)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ struct EventShell<Content: View>: View {
|
|||||||
if has_action_bar {
|
if has_action_bar {
|
||||||
//EmptyRect
|
//EmptyRect
|
||||||
EventActionBar(damus_state: state, event: event)
|
EventActionBar(damus_state: state, event: event)
|
||||||
.padding(.horizontal)
|
.padding([.leading, .trailing, .top])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,11 +10,14 @@ import SwiftUI
|
|||||||
struct LongformPreview: View {
|
struct LongformPreview: View {
|
||||||
let state: DamusState
|
let state: DamusState
|
||||||
let event: LongformEvent
|
let event: LongformEvent
|
||||||
|
let options: EventViewOptions
|
||||||
@ObservedObject var artifacts: NoteArtifactsModel
|
@ObservedObject var artifacts: NoteArtifactsModel
|
||||||
|
|
||||||
init(state: DamusState, ev: NostrEvent) {
|
init(state: DamusState, ev: NostrEvent, options: EventViewOptions) {
|
||||||
self.state = state
|
self.state = state
|
||||||
self.event = LongformEvent.parse(from: ev)
|
self.event = LongformEvent.parse(from: ev)
|
||||||
|
self.options = options
|
||||||
|
|
||||||
self._artifacts = ObservedObject(wrappedValue: state.events.get_cache_data(ev.id).artifacts_model)
|
self._artifacts = ObservedObject(wrappedValue: state.events.get_cache_data(ev.id).artifacts_model)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,7 +26,7 @@ struct LongformPreview: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body: some 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) {
|
VStack(alignment: .leading, spacing: 10) {
|
||||||
Text(event.title ?? "Untitled")
|
Text(event.title ?? "Untitled")
|
||||||
.font(.title)
|
.font(.title)
|
||||||
@@ -44,6 +47,6 @@ struct LongformPreview: View {
|
|||||||
|
|
||||||
struct LongformPreview_Previews: PreviewProvider {
|
struct LongformPreview_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
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: [])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user