From 0ab7153d2423d810a77e2e406c32c0806b9afbc3 Mon Sep 17 00:00:00 2001 From: Lumaa Date: Tue, 16 Jul 2024 16:55:33 +0200 Subject: [PATCH] blur + quote test --- .../Components/Post/CompactPostView.swift | 55 ++++++++++--------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/Threaded/Components/Post/CompactPostView.swift b/Threaded/Components/Post/CompactPostView.swift index 191feb0..fb3bac8 100644 --- a/Threaded/Components/Post/CompactPostView.swift +++ b/Threaded/Components/Post/CompactPostView.swift @@ -46,7 +46,7 @@ struct CompactPostView: View { initialLike = isLiked } .task { -// await loadEmbeddedStatus(status: status) + await loadEmbeddedStatus(status: status) if let client = accountManager.getClient() { if let newStatus: Status = try? await client.get(endpoint: Statuses.status(id: status.id)) { @@ -127,36 +127,39 @@ struct CompactPostView: View { } } - if status.poll != nil { - PostPoll(poll: status.poll!) - } - - if status.card != nil && status.mediaAttachments.isEmpty && !hasQuote { - PostCardView(card: status.card!) - } - - if !status.mediaAttachments.isEmpty { - if status.mediaAttachments.count > 1 { - ScrollView(.horizontal, showsIndicators: false) { - HStack(alignment: .firstTextBaseline, spacing: 5) { - ForEach(status.mediaAttachments) { attachment in - PostAttachment(attachment: attachment, isFeatured: false, isImaging: imaging) - .onTapGesture { - navigator.presentedCover = .media(attachments: status.mediaAttachments, selected: attachment) - } +// if !quoted { + if status.poll != nil { + PostPoll(poll: status.poll!) + } + + if status.card != nil && status.mediaAttachments.isEmpty && !hasQuote { + PostCardView(card: status.card!) + } + + if !status.mediaAttachments.isEmpty { + if status.mediaAttachments.count > 1 { + ScrollView(.horizontal, showsIndicators: false) { + HStack(alignment: .firstTextBaseline, spacing: 5) { + ForEach(status.mediaAttachments) { attachment in + PostAttachment(attachment: attachment, isFeatured: false, isImaging: imaging) + .blur(radius: status.sensitive ? 15.0 : 0) + .onTapGesture { + navigator.presentedCover = .media(attachments: status.mediaAttachments, selected: attachment) + } + } } } + .scrollClipDisabled() + } else { + PostAttachment(attachment: status.mediaAttachments.first!, isImaging: imaging) + .onTapGesture { + navigator.presentedCover = .media(attachments: status.mediaAttachments, selected: status.mediaAttachments[0]) + } } - .scrollClipDisabled() - } else { - PostAttachment(attachment: status.mediaAttachments.first!, isImaging: imaging) - .onTapGesture { - navigator.presentedCover = .media(attachments: status.mediaAttachments, selected: status.mediaAttachments[0]) - } } - } +// } - if hasQuote { + if hasQuote && !quoted { if quoteStatus != nil { QuotePostView(status: quoteStatus!) } else {