mirror of
https://github.com/yJason/ClashX-Dashboard.git
synced 2026-03-01 00:35:19 +08:00
refactor: ProgressButton
This commit is contained in:
@@ -42,24 +42,13 @@ struct RuleProvidersRowView: View {
|
||||
}
|
||||
}
|
||||
} header: {
|
||||
Button {
|
||||
updateAll()
|
||||
} label: {
|
||||
HStack {
|
||||
if isUpdating {
|
||||
ProgressView()
|
||||
.controlSize(.small)
|
||||
.frame(width: 12)
|
||||
} else {
|
||||
Image(systemName: "arrow.clockwise")
|
||||
.frame(width: 12)
|
||||
}
|
||||
Text(isUpdating ? "Updating" : "Update All")
|
||||
.frame(width: 80)
|
||||
ProgressButton(
|
||||
title: "Update All",
|
||||
title2: "Updating",
|
||||
iconName: "arrow.clockwise",
|
||||
inProgress: $isUpdating) {
|
||||
updateAll()
|
||||
}
|
||||
.foregroundColor(isUpdating ? .gray : .blue)
|
||||
}
|
||||
.disabled(isUpdating)
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user