CHResume/ResumeBuilder/Elements/PublicationView.swift

41 lines
1.0 KiB
Swift
Raw Normal View History

2023-08-18 22:47:24 +02:00
import SwiftUI
struct PublicationView: View {
2023-09-19 14:50:20 +02:00
@Environment(\.colorScheme)
var colorScheme: ColorScheme
2023-08-18 22:47:24 +02:00
let info: Publication
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) {
Text(info.venue)
.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(.subheadline)
.fontWeight(.regular)
2023-09-19 14:50:20 +02:00
.foregroundColor(colorScheme.primaryColor)
2023-08-18 22:47:24 +02:00
}
}
}
}
struct PublicationView_Previews: PreviewProvider {
static var previews: some View {
PublicationView(info: .init(
venue: "My venue",
title: "The publication title"),
borderSpacing: 5,
2023-08-23 16:17:34 +02:00
borderWidth: 3,
accent: .orange)
2023-08-18 22:47:24 +02:00
}
}