CHResume/ResumeBuilder/Elements/TopViewImage.swift

33 lines
696 B
Swift
Raw Normal View History

2023-08-18 22:47:24 +02:00
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))
}
}