further refactor on background

pull/874/head
Ryan ZHAO 2 years ago
parent 20db5a48a3
commit be5418dc4a

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

@ -10,11 +10,17 @@ public extension View {
} }
func background(themeColor: ThemeValue) -> some 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( return self.background(
ThemeManager.currentTheme.colorSwiftUI(for: themeColor) ThemeManager.currentTheme.colorSwiftUI(for: themeColor)
) )
} }
} }
}
public extension Shape { public extension Shape {
func fill(themeColor: ThemeValue) -> some View { func fill(themeColor: ThemeValue) -> some View {

Loading…
Cancel
Save