Improve Start/Stop button
This commit is contained in:
@@ -2,6 +2,7 @@ import Library
|
||||
import SwiftUI
|
||||
|
||||
@MainActor public struct CardManagementSheet: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@StateObject private var configuration = DashboardCardConfiguration()
|
||||
@Binding private var configurationVersion: Int
|
||||
|
||||
@@ -33,7 +34,7 @@ import SwiftUI
|
||||
}
|
||||
}
|
||||
#else
|
||||
ToolbarItem(placement: .automatic) {
|
||||
ToolbarItem(placement: .cancellationAction) {
|
||||
Button("Reset", role: .destructive) {
|
||||
Task {
|
||||
await configuration.resetToDefault()
|
||||
@@ -41,6 +42,11 @@ import SwiftUI
|
||||
}
|
||||
}
|
||||
}
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button("Done") {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -78,18 +84,11 @@ private struct CardRow: View {
|
||||
.foregroundColor(.secondary)
|
||||
.imageScale(.small)
|
||||
|
||||
if isProfileCard {
|
||||
Toggle(isOn: isToggleEnabled) {
|
||||
Label(card.title, systemImage: card.systemImage)
|
||||
Spacer()
|
||||
Text("Required")
|
||||
.font(.footnote)
|
||||
.foregroundColor(.secondary)
|
||||
} else {
|
||||
Toggle(isOn: isToggleEnabled) {
|
||||
Label(card.title, systemImage: card.systemImage)
|
||||
}
|
||||
.opacity(isEnabled ? 1.0 : 0.5)
|
||||
}
|
||||
.disabled(isProfileCard)
|
||||
.opacity(isEnabled ? 1.0 : 0.5)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user