perf: remove unused zstack on like button
This commit is contained in:
@@ -198,8 +198,18 @@ struct LikeButton: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack {
|
Group {
|
||||||
likeButton()
|
if let liked_emoji {
|
||||||
|
buildMaskView(for: liked_emoji)
|
||||||
|
.frame(width: 20, height: 20)
|
||||||
|
} else {
|
||||||
|
Image("shaka")
|
||||||
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fit)
|
||||||
|
.frame(width: 20, height: 20)
|
||||||
|
.foregroundColor(.gray)
|
||||||
|
}
|
||||||
|
}
|
||||||
.accessibilityLabel(NSLocalizedString("Like", comment: "Accessibility Label for Like button"))
|
.accessibilityLabel(NSLocalizedString("Like", comment: "Accessibility Label for Like button"))
|
||||||
.rotationEffect(Angle(degrees: shouldAnimate ? rotationAngle : 0))
|
.rotationEffect(Angle(degrees: shouldAnimate ? rotationAngle : 0))
|
||||||
.onReceive(self.timer) { _ in
|
.onReceive(self.timer) { _ in
|
||||||
@@ -216,22 +226,6 @@ struct LikeButton: View {
|
|||||||
})
|
})
|
||||||
.overlay(reactionsOverlay())
|
.overlay(reactionsOverlay())
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
func likeButton() -> some View {
|
|
||||||
Group {
|
|
||||||
if let liked_emoji {
|
|
||||||
buildMaskView(for: liked_emoji)
|
|
||||||
.frame(width: 20, height: 20)
|
|
||||||
} else {
|
|
||||||
Image("shaka")
|
|
||||||
.resizable()
|
|
||||||
.aspectRatio(contentMode: .fit)
|
|
||||||
.frame(width: 20, height: 20)
|
|
||||||
.foregroundColor(.gray)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func shakaAnimationLogic() {
|
func shakaAnimationLogic() {
|
||||||
rotationAngle = amountOfAngleIncrease
|
rotationAngle = amountOfAngleIncrease
|
||||||
|
|||||||
Reference in New Issue
Block a user