blur + quote test

This commit is contained in:
Lumaa 2024-07-16 16:55:33 +02:00
parent 3d392fd99e
commit 0ab7153d24
1 changed files with 29 additions and 26 deletions

View File

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