Specify accent color in style
This commit is contained in:
@@ -9,14 +9,15 @@ struct CareerStationView: View {
|
||||
|
||||
let borderWidth: CGFloat
|
||||
|
||||
let accent: Color
|
||||
|
||||
var body: some View {
|
||||
LeftBorderView(color: .accentColor, spacing: borderSpacing, borderWidth: borderWidth) {
|
||||
LeftBorderView(color: accent, spacing: borderSpacing, borderWidth: borderWidth) {
|
||||
VStack(alignment: .leading) {
|
||||
HStack {
|
||||
RightImageLabel(info.time, systemSymbol: .calendar)
|
||||
.padding(.leading, -4)
|
||||
Spacer()
|
||||
RightImageLabel(info.location, systemSymbol: .pin)
|
||||
RightImageLabel(info.location, systemSymbol: .house)
|
||||
}
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
@@ -26,7 +27,7 @@ struct CareerStationView: View {
|
||||
if let subtitle = info.subtitle {
|
||||
Text(subtitle)
|
||||
.font(.subheadline)
|
||||
.foregroundColor(.accentColor)
|
||||
.foregroundColor(accent)
|
||||
}
|
||||
if let text = info.text {
|
||||
Text(text)
|
||||
@@ -40,14 +41,16 @@ struct CareerStationView: View {
|
||||
|
||||
struct CareerStationView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
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)
|
||||
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)
|
||||
.previewLayout(.fixed(width: 300, height: 100))
|
||||
}
|
||||
}
|
||||
|
@@ -8,8 +8,10 @@ struct PublicationView: View {
|
||||
|
||||
let borderWidth: CGFloat
|
||||
|
||||
let accent: Color
|
||||
|
||||
var body: some View {
|
||||
LeftBorderView(color: .accentColor, spacing: borderSpacing, borderWidth: borderWidth) {
|
||||
LeftBorderView(color: accent, spacing: borderSpacing, borderWidth: borderWidth) {
|
||||
VStack(alignment: .leading) {
|
||||
Text(info.venue)
|
||||
.font(.caption)
|
||||
@@ -28,6 +30,7 @@ struct PublicationView_Previews: PreviewProvider {
|
||||
venue: "My venue",
|
||||
title: "The publication title"),
|
||||
borderSpacing: 5,
|
||||
borderWidth: 3)
|
||||
borderWidth: 3,
|
||||
accent: .orange)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user