Skip to content

Commit

Permalink
Fix the media upload preview screen on macOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave authored and stefanceriu committed Nov 20, 2024
1 parent 1c62792 commit 19ed65b
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import QuickLook
import SwiftUI

struct MediaUploadPreviewScreen: View {
@Environment(\.colorScheme) private var colorScheme

@ObservedObject var context: MediaUploadPreviewScreenViewModel.Context

var title: String {
ProcessInfo.processInfo.isiOSAppOnMac ? context.viewState.title ?? "" : ""
}
var title: String { ProcessInfo.processInfo.isiOSAppOnMac ? context.viewState.title ?? "" : "" }
var colorSchemeOverride: ColorScheme { ProcessInfo.processInfo.isiOSAppOnMac ? colorScheme : .dark }

var body: some View {
mainContent
Expand All @@ -31,7 +32,7 @@ struct MediaUploadPreviewScreen: View {
.toolbar { toolbar }
.disabled(context.viewState.shouldDisableInteraction)
.interactiveDismissDisabled()
.preferredColorScheme(.dark)
.preferredColorScheme(colorSchemeOverride)
}

@ViewBuilder
Expand All @@ -40,6 +41,7 @@ struct MediaUploadPreviewScreen: View {
Text(title)
.font(.compound.headingMD)
.foregroundColor(.compound.textSecondary)
.frame(maxWidth: .infinity, maxHeight: .infinity)
} else {
PreviewView(fileURL: context.viewState.url,
title: context.viewState.title)
Expand Down

0 comments on commit 19ed65b

Please sign in to comment.