CHResume/ResumeBuilder/Elements/CareerStationView.swift

60 lines
1.8 KiB
Swift
Raw Permalink Normal View History

2023-08-18 22:47:24 +02:00
import SwiftUI
import SFSafeSymbols
struct CareerStationView: View {
2023-09-19 14:50:20 +02:00
@Environment(\.colorScheme)
var colorScheme: ColorScheme
2023-08-18 22:47:24 +02:00
let info: CareerStation
let borderSpacing: CGFloat
let borderWidth: CGFloat
2023-08-23 16:17:34 +02:00
let accent: Color
2023-08-18 22:47:24 +02:00
var body: some View {
2023-08-23 16:17:34 +02:00
LeftBorderView(color: accent, spacing: borderSpacing, borderWidth: borderWidth) {
2023-08-18 22:47:24 +02:00
VStack(alignment: .leading) {
HStack {
RightImageLabel(info.time, systemSymbol: .calendar)
Spacer()
2023-08-23 16:17:34 +02:00
RightImageLabel(info.location, systemSymbol: .house)
2023-08-18 22:47:24 +02:00
}
.font(.caption)
2023-09-19 14:50:20 +02:00
.foregroundColor(colorScheme.secondaryColor)
2023-08-18 22:47:24 +02:00
Text(info.title)
.font(.headline)
.fontWeight(.regular)
if let subtitle = info.subtitle {
Text(subtitle)
.font(.subheadline)
2023-08-23 16:17:34 +02:00
.foregroundColor(accent)
2023-08-18 22:47:24 +02:00
}
if let text = info.text {
Text(text)
.font(.caption)
2023-09-19 14:50:20 +02:00
.foregroundColor(colorScheme.secondaryColor)
2023-08-18 22:47:24 +02:00
}
}
}
}
}
struct CareerStationView_Previews: PreviewProvider {
static var previews: some View {
2023-08-23 16:17:34 +02:00
CareerStationView(
info: .init(
time: "Jul 2020 - Jul 2023",
location: "Braunschweig, Germany",
title: "German Aerospace Center",
subtitle: "Systems engineer",
text: "Responsible for aircraft systems and avionics of a high-altitude solar drone, safety, and software."),
borderSpacing: 5,
borderWidth: 3,
accent: .orange)
2023-08-18 22:47:24 +02:00
.previewLayout(.fixed(width: 300, height: 100))
}
}