threads working

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2022-04-16 15:07:26 -07:00
parent 2676dea140
commit b6421bb5e4
10 changed files with 214 additions and 32 deletions

View File

@@ -14,6 +14,7 @@ let CORNER_RADIUS: CGFloat = 32
struct ProfilePicView: View {
let picture: String?
let size: CGFloat
let highlighted: Bool
var body: some View {
if let pic = picture.flatMap({ URL(string: $0) }) {
@@ -23,17 +24,21 @@ struct ProfilePicView: View {
Color.purple.opacity(0.1)
}
.frame(width: PFP_SIZE, height: PFP_SIZE)
.cornerRadius(CORNER_RADIUS)
.clipShape(Circle())
.overlay(Circle().stroke(highlighted ? Color.red : Color.black, lineWidth: highlighted ? 4 : 0))
.padding(2)
} else {
Color.purple.opacity(0.1)
.frame(width: PFP_SIZE, height: PFP_SIZE)
.cornerRadius(CORNER_RADIUS)
.overlay(Circle().stroke(highlighted ? Color.red : Color.black, lineWidth: highlighted ? 4 : 0))
.padding(2)
}
}
}
struct ProfilePicView_Previews: PreviewProvider {
static var previews: some View {
ProfilePicView(picture: "http://cdn.jb55.com/img/red-me.jpg", size: 64)
ProfilePicView(picture: "http://cdn.jb55.com/img/red-me.jpg", size: 64, highlighted: false)
}
}