Skip to content

Commit 4649ba0

Browse files
committed
Reuse ProgressButton
1 parent 5b1cc4a commit 4649ba0

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

Xcodes/Backend/XcodeCommands.swift

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,12 @@ struct InstallButton: View {
3939
let xcode: Xcode?
4040

4141
var body: some View {
42-
Button(action: install) {
43-
if isLoading {
44-
ProgressView()
45-
.colorInvert()
46-
.controlSize(.small)
47-
} else {
48-
Text("Install")
49-
.textCase(.uppercase)
50-
.help("InstallDescription")
51-
}
42+
ProgressButton(isInProgress: isLoading) {
43+
install()
44+
} label: {
45+
Text("Install")
46+
.textCase(.uppercase)
47+
.help("InstallDescription")
5248
}.buttonStyle(AppStoreButtonStyle(primary: false, highlighted: false))
5349
}
5450

0 commit comments

Comments
 (0)