1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-14 22:30:32 +05:30
yattee/Shared/Settings/SettingsHeader.swift

36 lines
851 B
Swift
Raw Normal View History

2021-11-05 03:31:27 +05:30
import SwiftUI
struct SettingsHeader: View {
var text: String
2022-01-06 20:32:53 +05:30
var secondary = false
2021-11-05 03:31:27 +05:30
var body: some View {
2022-01-06 20:32:53 +05:30
Group {
#if os(iOS)
if secondary {
EmptyView()
} else {
2023-05-25 21:56:34 +05:30
Text(text.localized())
2022-01-06 20:32:53 +05:30
}
#else
2023-05-25 21:56:34 +05:30
Text(text.localized())
2022-01-06 20:32:53 +05:30
#endif
}
#if os(tvOS)
.font(secondary ? .footnote : .title3)
.foregroundColor(.secondary)
.focusable(false)
#endif
#if os(macOS)
.font(secondary ? .system(size: 13) : .system(size: 15))
.foregroundColor(secondary ? Color.primary : .secondary)
2021-11-05 03:31:27 +05:30
#endif
}
}
struct SettingsHeader_Previews: PreviewProvider {
static var previews: some View {
SettingsHeader(text: "Header")
}
}