Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Sep 27, 2024
1 parent 358146e commit 3aa3db6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions ElementX/Sources/Other/SwiftUI/Views/LoadableAvatarImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,23 @@ struct LoadableAvatarImage: View {
Button {
onTap(url)
} label: {
avatar
.frame(width: frameSize, height: frameSize)
.background(Color.compound.bgCanvasDefault)
.clipShape(Circle())
clippedAvatar
}
.buttonStyle(.borderless) // Add a button style to stop the whole row being tappable.
} else {
avatar
.frame(width: frameSize, height: frameSize)
.background(Color.compound.bgCanvasDefault)
.clipShape(Circle())
clippedAvatar
}
}

private var clippedAvatar: some View {
avatar
.frame(width: frameSize, height: frameSize)
.background(Color.compound.bgCanvasDefault)
.clipShape(Circle())
}

@ViewBuilder
var avatar: some View {
private var avatar: some View {
if let url {
LoadableImage(url: url,
mediaType: .avatar,
Expand Down

0 comments on commit 3aa3db6

Please sign in to comment.