CHResume/ResumeBuilder/Elements/TopViewImage.swift
Christoph Hagen bd87a4fb6f First version
2023-08-18 22:47:24 +02:00

33 lines
696 B
Swift

import SwiftUI
struct TopViewImage: View {
let image: String
let shadow: CGFloat
let lineWidth: CGFloat
var body: some View {
Image(image)
.resizable()
.aspectRatio(1, contentMode: .fit)
.clipShape(Circle())
.overlay {
Circle().stroke(.gray, lineWidth: lineWidth)
}
.shadow(radius: shadow)
.padding(lineWidth)
}
}
struct TopViewImage_Previews: PreviewProvider {
static var previews: some View {
TopViewImage(
image: "Cover",
shadow: 5,
lineWidth: 2)
.previewLayout(.fixed(width: 150, height: 150))
}
}