Feat: Consilidates calculated at views.

This commit is contained in:
2024-06-03 12:38:42 -04:00
parent b7edf38e72
commit 4311ae9e22
6 changed files with 424 additions and 276 deletions

View File

@@ -0,0 +1,48 @@
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...")
}