create highlight list card

This commit is contained in:
Satindar Dhillon
2022-10-04 09:36:28 -07:00
parent 397fb5d9f7
commit 29d14b3e8d
2 changed files with 12 additions and 1 deletions

View File

@ -0,0 +1,10 @@
import Models
import SwiftUI
struct HighlightsListCard: View {
let highlight: Highlight
var body: some View {
Text(highlight.quote ?? "no quote")
}
}

View File

@ -14,11 +14,12 @@ struct HighlightsListView: View {
List {
Section {
ForEach(viewModel.highlights, id: \.self) { highlight in
Text(highlight.quote ?? "no quote")
HighlightsListCard(highlight: highlight)
}
}
}
.navigationTitle("Highlights")
.listStyle(PlainListStyle())
#if os(iOS)
.navigationBarTitleDisplayMode(.inline)
.toolbar {