mirror of
https://github.com/kean/Pulse.git
synced 2026-04-30 21:02:27 +00:00
35 lines
735 B
Swift
35 lines
735 B
Swift
// The MIT License (MIT)
|
||
//
|
||
// Copyright (c) 2020–2022 Alexander Grebenyuk (github.com/kean).
|
||
|
||
import SwiftUI
|
||
|
||
#if os(iOS) || os(macOS)
|
||
|
||
struct LargeSectionHeader<Accessory: View>: View {
|
||
let title: String
|
||
var accessory: (() -> Accessory)?
|
||
|
||
var body: some View {
|
||
VStack(spacing: 10) {
|
||
HStack(alignment: .bottom) {
|
||
Text(title)
|
||
.bold()
|
||
.font(.title)
|
||
.padding(.top, 16)
|
||
Spacer()
|
||
accessory?()
|
||
}
|
||
Divider()
|
||
}.padding(.bottom, 8)
|
||
}
|
||
}
|
||
|
||
extension LargeSectionHeader where Accessory == EmptyView {
|
||
init(title: String) {
|
||
self.title = title
|
||
}
|
||
}
|
||
|
||
#endif
|