Skip to content

Commit

Permalink
Merge pull request #704 from Infomaniak/prevent-useless-update
Browse files Browse the repository at this point in the history
fix(AppShadowModifier): Prevent breaking view identity
  • Loading branch information
Ambrdctr committed Apr 18, 2023
2 parents 1ad27d2 + acd1098 commit aa29cd1
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions Mail/Utils/AppShadowModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,11 @@ import MailResources
import SwiftUI

struct AppShadowModifier: ViewModifier {
@Environment(\.colorScheme) var colorScheme

func body(content: Content) -> some View {
if colorScheme == .light {
ZStack {
MailResourcesAsset.backgroundColor.swiftUIColor
.ignoresSafeArea()
.shadow(color: .primary.opacity(0.08), radius: 2.5, x: 0.5, y: 0.5)

content
}
} else {
ZStack {
MailResourcesAsset.backgroundColor.swiftUIColor
.ignoresSafeArea()
.shadow(color: .black.opacity(0.08), radius: 2.5, x: 0.5, y: 0.5)
content
}
}
Expand Down

0 comments on commit aa29cd1

Please sign in to comment.