Move settings + generation to sheets
This commit is contained in:
26
CHDataManagement/Views/Generic/SelectableListItem.swift
Normal file
26
CHDataManagement/Views/Generic/SelectableListItem.swift
Normal file
@ -0,0 +1,26 @@
|
||||
import SwiftUI
|
||||
|
||||
struct SelectableListItem<Content>: View where Content: View {
|
||||
|
||||
let content: Content
|
||||
|
||||
let selected: Bool
|
||||
|
||||
public init(selected: Bool, @ViewBuilder content: () -> Content) {
|
||||
self.selected = selected
|
||||
self.content = content()
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
content
|
||||
Spacer()
|
||||
}
|
||||
.foregroundStyle(selected ? Color.white : Color.primary)
|
||||
.listRowBackground(RoundedRectangle(cornerRadius: 5)
|
||||
.fill(selected ? Color.blue : Color.clear)
|
||||
.padding(.horizontal, 10)
|
||||
)
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user