Don't make previews full bleed
This commit is contained in:
@@ -58,8 +58,28 @@ struct NoteContentView: View {
|
|||||||
.font(eventviewsize_to_font(size))
|
.font(eventviewsize_to_font(size))
|
||||||
}
|
}
|
||||||
|
|
||||||
func MainContent() -> some View {
|
var invoicesView: some View {
|
||||||
return VStack(alignment: .leading) {
|
InvoicesView(our_pubkey: damus_state.keypair.pubkey, invoices: artifacts.invoices)
|
||||||
|
}
|
||||||
|
|
||||||
|
var previewView: some View {
|
||||||
|
Group {
|
||||||
|
if let preview = self.preview, show_images {
|
||||||
|
if let preview_height {
|
||||||
|
preview
|
||||||
|
.frame(height: preview_height)
|
||||||
|
} else {
|
||||||
|
preview
|
||||||
|
}
|
||||||
|
} else if let link = artifacts.links.first {
|
||||||
|
LinkViewRepresentable(meta: .url(link))
|
||||||
|
.frame(height: 50)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var MainContent: some View {
|
||||||
|
VStack(alignment: .leading) {
|
||||||
if size == .selected {
|
if size == .selected {
|
||||||
SelectableText(attributedString: artifacts.content)
|
SelectableText(attributedString: artifacts.content)
|
||||||
TranslateView(damus_state: damus_state, event: event)
|
TranslateView(damus_state: damus_state, event: event)
|
||||||
@@ -84,25 +104,25 @@ struct NoteContentView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if artifacts.invoices.count > 0 {
|
if artifacts.invoices.count > 0 {
|
||||||
InvoicesView(our_pubkey: damus_state.keypair.pubkey, invoices: artifacts.invoices)
|
if with_padding {
|
||||||
|
invoicesView
|
||||||
|
.padding(.horizontal)
|
||||||
|
} else {
|
||||||
|
invoicesView
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let preview = self.preview, show_images {
|
if with_padding {
|
||||||
if let preview_height {
|
previewView.padding(.horizontal)
|
||||||
preview
|
} else {
|
||||||
.frame(height: preview_height)
|
previewView
|
||||||
} else {
|
|
||||||
preview
|
|
||||||
}
|
|
||||||
} else if let link = artifacts.links.first {
|
|
||||||
LinkViewRepresentable(meta: .url(link))
|
|
||||||
.frame(height: 50)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
MainContent()
|
MainContent
|
||||||
.onReceive(handle_notify(.profile_updated)) { notif in
|
.onReceive(handle_notify(.profile_updated)) { notif in
|
||||||
let profile = notif.object as! ProfileUpdate
|
let profile = notif.object as! ProfileUpdate
|
||||||
let blocks = event.blocks(damus_state.keypair.privkey)
|
let blocks = event.blocks(damus_state.keypair.privkey)
|
||||||
|
|||||||
Reference in New Issue
Block a user