22 lines
633 B
Swift
22 lines
633 B
Swift
import SwiftUI
|
|
|
|
struct SettingsListView: View {
|
|
|
|
@EnvironmentObject
|
|
private var selection: SelectedContent
|
|
|
|
var body: some View {
|
|
List(SettingsSection.allCases) { section in
|
|
Label(section.rawValue, systemSymbol: section.icon)
|
|
.listRowBackground(RoundedRectangle(cornerRadius: 5)
|
|
.fill(selection.section == section ? Color.blue : Color.clear)
|
|
.padding(.horizontal, 10)
|
|
)
|
|
.contentShape(Rectangle())
|
|
.onTapGesture {
|
|
selection.section = section
|
|
}
|
|
}
|
|
}
|
|
}
|