Skip to content

Commit fd9cf06

Browse files
committed
Keep vote pill layout while disabled
1 parent dfde73b commit fd9cf06

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

DesignSystem/Sources/DesignSystem/Components/PostDisplayView.swift

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -356,18 +356,23 @@ public struct PostDisplayView: View {
356356
Capsule()
357357
.fill(backgroundColor)
358358
)
359-
return Button(action: action ?? {}) {
360-
ZStack {
361-
content
362-
if isLoading {
363-
Capsule()
364-
.fill(backgroundColor.opacity(0.6))
365-
ProgressView()
366-
.scaleEffect(0.6)
367-
.tint(textColor)
368-
}
359+
.overlay {
360+
if isLoading {
361+
Capsule()
362+
.fill(backgroundColor.opacity(0.6))
363+
}
364+
}
365+
.overlay {
366+
if isLoading {
367+
ProgressView()
368+
.scaleEffect(0.6)
369+
.tint(textColor)
369370
}
370371
}
372+
373+
return Button(action: action ?? {}) {
374+
content
375+
}
371376
.buttonStyle(.plain)
372377
.disabled(!isEnabled || isLoading || action == nil)
373378
.allowsHitTesting(isEnabled && !isLoading && action != nil)

0 commit comments

Comments
 (0)