49 lines
982 B
Swift
49 lines
982 B
Swift
import SwiftUI
|
|
|
|
public struct InfoView: View {
|
|
let headingText: String
|
|
let bodyText: String
|
|
|
|
|
|
public init(heading headingText: String, body bodyText: String) {
|
|
self.headingText = headingText
|
|
self.bodyText = bodyText
|
|
}
|
|
|
|
public var body: some View {
|
|
VStack(spacing: 40) {
|
|
|
|
ZStack {
|
|
Text(headingText)
|
|
.font(.headline)
|
|
.bold()
|
|
.foregroundStyle(Color.white)
|
|
.padding()
|
|
}
|
|
.background {
|
|
RoundedRectangle(cornerRadius: 10)
|
|
.foregroundStyle(Color.orange.opacity(0.6))
|
|
}
|
|
|
|
|
|
ZStack {
|
|
Text(bodyText)
|
|
.font(.callout)
|
|
.padding()
|
|
}
|
|
.background {
|
|
RoundedRectangle(cornerRadius: 10)
|
|
.foregroundStyle(Color.secondary.opacity(0.3))
|
|
}
|
|
.padding(.horizontal, 10)
|
|
|
|
Spacer()
|
|
}
|
|
.padding(.horizontal)
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
InfoView(heading: "Generic Info View", body: "Explain what this view does here...")
|
|
}
|