Feat: Consilidates calculated at views.
This commit is contained in:
48
Sources/Styleguide/InfoView.swift
Normal file
48
Sources/Styleguide/InfoView.swift
Normal 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...")
|
||||
}
|
||||
Reference in New Issue
Block a user