mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
Update InstallButton with progress view and styling from list row
This commit is contained in:
parent
9cf10125ca
commit
13715930af
1 changed files with 15 additions and 5 deletions
|
|
@ -34,16 +34,26 @@ struct XcodeCommands: Commands {
|
|||
|
||||
struct InstallButton: View {
|
||||
@EnvironmentObject var appState: AppState
|
||||
@State private var isLoading = false
|
||||
|
||||
let xcode: Xcode?
|
||||
|
||||
|
||||
var body: some View {
|
||||
Button(action: install) {
|
||||
Text("Install")
|
||||
.help("Install")
|
||||
}
|
||||
if isLoading {
|
||||
ProgressView()
|
||||
.colorInvert()
|
||||
.controlSize(.small)
|
||||
} else {
|
||||
Text("Install")
|
||||
.textCase(.uppercase)
|
||||
.help("InstallDescription")
|
||||
}
|
||||
}.buttonStyle(AppStoreButtonStyle(primary: false, highlighted: false))
|
||||
}
|
||||
|
||||
|
||||
private func install() {
|
||||
isLoading = true
|
||||
guard let xcode = xcode else { return }
|
||||
appState.checkMinVersionAndInstall(id: xcode.id)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue