Added date and byline to timeline
This commit is contained in:
parent
bacffbadbe
commit
0b36498ff8
|
@ -33,4 +33,12 @@ struct TimelineItem: Identifiable {
|
|||
return .showNone
|
||||
}
|
||||
|
||||
var byline: String {
|
||||
return article.byline()
|
||||
}
|
||||
|
||||
var dateTimeString: String {
|
||||
return ArticleStringFormatter.dateString(article.logicalDatePublished)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,8 +21,23 @@ struct TimelineItemView: View {
|
|||
IconImageView(iconImage: image)
|
||||
.frame(width: AppDefaults.timelineIconSize.size.width, height: AppDefaults.timelineIconSize.size.height, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
|
||||
}
|
||||
Text(verbatim: timelineItem.article.title ?? "N/A")
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
VStack {
|
||||
Text(verbatim: timelineItem.article.title ?? "N/A")
|
||||
.lineLimit(3)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.padding(.trailing, 4)
|
||||
Spacer()
|
||||
HStack {
|
||||
Text(verbatim: timelineItem.byline)
|
||||
.font(.footnote)
|
||||
.foregroundColor(.secondary)
|
||||
Spacer()
|
||||
Text(verbatim: timelineItem.dateTimeString)
|
||||
.font(.footnote)
|
||||
.foregroundColor(.secondary)
|
||||
.padding(.trailing, 4)
|
||||
}
|
||||
}
|
||||
}
|
||||
Divider()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue