From 4649ba0c8a9cf36fe89933782afa6500c5f9f7f6 Mon Sep 17 00:00:00 2001 From: Daniel Chick Date: Sat, 25 Nov 2023 19:19:59 -0600 Subject: [PATCH] Reuse ProgressButton --- Xcodes/Backend/XcodeCommands.swift | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Xcodes/Backend/XcodeCommands.swift b/Xcodes/Backend/XcodeCommands.swift index 9967abb..5071f30 100644 --- a/Xcodes/Backend/XcodeCommands.swift +++ b/Xcodes/Backend/XcodeCommands.swift @@ -39,16 +39,12 @@ struct InstallButton: View { let xcode: Xcode? var body: some View { - Button(action: install) { - if isLoading { - ProgressView() - .colorInvert() - .controlSize(.small) - } else { - Text("Install") - .textCase(.uppercase) - .help("InstallDescription") - } + ProgressButton(isInProgress: isLoading) { + install() + } label: { + Text("Install") + .textCase(.uppercase) + .help("InstallDescription") }.buttonStyle(AppStoreButtonStyle(primary: false, highlighted: false)) }