change accesibility identifiers, remove single selection button style, use Picker instead,

This commit is contained in:
Flavio Alescio
2023-05-12 14:19:56 +02:00
committed by Flescio
parent 41094cb293
commit 372a2d5360
7 changed files with 27 additions and 71 deletions
@@ -21,7 +21,6 @@ enum FormRowAccessory: View {
case navigationLink
case progressView
case selection(isSelected: Bool)
case singleSelection(isSelected: Bool)
var body: some View {
switch self {
@@ -35,10 +34,6 @@ enum FormRowAccessory: View {
Image(systemName: isSelected ? "checkmark.circle.fill" : "circle")
.font(.compound.bodyLG)
.foregroundColor(isSelected ? .element.primaryContent : .element.tertiaryContent)
case .singleSelection(let isSelected):
Image(systemName: "checkmark")
.font(.compound.bodyLG)
.foregroundColor(isSelected ? .element.primaryContent : .clear)
}
}
}
@@ -140,19 +135,6 @@ struct FormButtonStyles_Previews: PreviewProvider {
Text("Selection")
}
.buttonStyle(FormButtonStyle(accessory: .selection(isSelected: false)))
Button { } label: {
Label {
VStack(alignment: .leading, spacing: 8) {
Text("Hello world")
Text("subtitle\nsubtitle")
.font(.compound.bodyMD)
.foregroundColor(.element.secondaryContent)
}
} icon: {
Image(systemName: "globe")
}
}
.buttonStyle(FormButtonStyle(iconAlignment: .top, accessory: .singleSelection(isSelected: true)))
}
.formSectionStyle()