mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-24 20:39:31 -04:00
Simplify AsyncButton
This commit is contained in:
parent
6484f94037
commit
ecdbca4ceb
@ -71,16 +71,9 @@ struct AsyncButton<S: View>: View {
|
||||
} label: {
|
||||
if task != nil {
|
||||
label
|
||||
.opacity(0)
|
||||
.opacity(0.25)
|
||||
.overlay {
|
||||
if #available(iOS 17.0, macOS 14.0, *) {
|
||||
Image(systemName: "ellipsis")
|
||||
.symbolEffect(.variableColor.iterative.dimInactiveLayers, options: .repeating, value: true)
|
||||
.font(.title)
|
||||
} else {
|
||||
Image(systemName: "ellipsis")
|
||||
.font(.title)
|
||||
}
|
||||
ProgressView()
|
||||
}
|
||||
.animation(.default, value: true)
|
||||
} else {
|
||||
@ -125,8 +118,6 @@ extension EnvironmentValues {
|
||||
try? await Task.sleep(for: .seconds(3))
|
||||
} label: {
|
||||
Text("Try me!")
|
||||
.font(.system(size: 18))
|
||||
.padding(6)
|
||||
}
|
||||
.asyncButtonStyle(.ellipsis)
|
||||
}.frame(minWidth: 200, minHeight: 400)
|
||||
|
Loading…
x
Reference in New Issue
Block a user