Fix image preview sheet

This commit is contained in:
Thomas Ricouard 2024-09-18 15:53:55 +02:00
parent b0846c9a3d
commit 4dd4968bb2
3 changed files with 13 additions and 3 deletions

View file

@ -26,12 +26,21 @@ extension IceCubesApp {
.environment(appIntentService)
.environment(\.isSupporter, isSupporter)
.sheet(item: $quickLook.selectedMediaAttachment) { selectedMediaAttachment in
if #available(iOS 18.0, *) {
MediaUIView(selectedAttachment: selectedMediaAttachment,
attachments: quickLook.mediaAttachments)
.presentationBackground(.ultraThinMaterial)
.presentationCornerRadius(16)
.presentationSizing(.page)
.withEnvironments()
} else {
MediaUIView(selectedAttachment: selectedMediaAttachment,
attachments: quickLook.mediaAttachments)
.presentationBackground(.ultraThinMaterial)
.presentationCornerRadius(16)
.withEnvironments()
}
}
.onChange(of: pushNotificationsService.handledNotification) { _, newValue in
if newValue != nil {
pushNotificationsService.handledNotification = nil

View file

@ -16,6 +16,8 @@ public struct MediaUIAttachmentImageView: View {
.clipShape(RoundedRectangle(cornerRadius: 8))
.scaledToFit()
.padding(.horizontal, 8)
.padding(.top, 44)
.padding(.bottom, 32)
.scaleEffect(zoom)
} else if state.isLoading {
ProgressView()

View file

@ -93,7 +93,6 @@ private struct DismissToolbarItem: ToolbarContent {
} label: {
Image(systemName: "xmark.circle")
}
.opacity(0)
.keyboardShortcut(.cancelAction)
}
}