Skip to content

Commit 1371593

Browse files
committed
Update InstallButton with progress view and styling from list row
1 parent 9cf1012 commit 1371593

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

Xcodes/Backend/XcodeCommands.swift

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,26 @@ struct XcodeCommands: Commands {
3434

3535
struct InstallButton: View {
3636
@EnvironmentObject var appState: AppState
37+
@State private var isLoading = false
38+
3739
let xcode: Xcode?
38-
40+
3941
var body: some View {
4042
Button(action: install) {
41-
Text("Install")
42-
.help("Install")
43-
}
43+
if isLoading {
44+
ProgressView()
45+
.colorInvert()
46+
.controlSize(.small)
47+
} else {
48+
Text("Install")
49+
.textCase(.uppercase)
50+
.help("InstallDescription")
51+
}
52+
}.buttonStyle(AppStoreButtonStyle(primary: false, highlighted: false))
4453
}
45-
54+
4655
private func install() {
56+
isLoading = true
4757
guard let xcode = xcode else { return }
4858
appState.checkMinVersionAndInstall(id: xcode.id)
4959
}

0 commit comments

Comments
 (0)