further refactor on background

pull/874/head
Ryan ZHAO 1 year ago
parent 20db5a48a3
commit be5418dc4a

@ -20,14 +20,7 @@ struct MessageInfoView: View {
}
var body: some View {
NavigationView {
ZStack (alignment: .topLeading) {
if #available(iOS 14.0, *) {
ThemeManager.currentTheme.colorSwiftUI(for: .backgroundPrimary).ignoresSafeArea()
} else {
ThemeManager.currentTheme.colorSwiftUI(for: .backgroundPrimary)
}
ScrollView(.vertical, showsIndicators: false) {
VStack(
alignment: .leading,
@ -352,7 +345,7 @@ struct MessageInfoView: View {
}
}
}
}
.background(themeColor: .backgroundPrimary)
}
private func showMediaFullScreen(attachment: Attachment) {

@ -10,11 +10,17 @@ public extension View {
}
func background(themeColor: ThemeValue) -> some View {
if #available(iOSApplicationExtension 14.0, *) {
return self.background(
ThemeManager.currentTheme.colorSwiftUI(for: themeColor)?.ignoresSafeArea()
)
} else {
return self.background(
ThemeManager.currentTheme.colorSwiftUI(for: themeColor)
)
}
}
}
public extension Shape {
func fill(themeColor: ThemeValue) -> some View {

Loading…
Cancel
Save