NetNewsWire/Multiplatform/Shared/Timeline/TimelineItemView.swift

39 lines
949 B
Swift
Raw Normal View History

2020-07-01 18:13:11 +02:00
//
// TimelineItemView.swift
// NetNewsWire
//
// Created by Maurice Parker on 7/1/20.
// Copyright © 2020 Ranchero Software. All rights reserved.
//
import SwiftUI
struct TimelineItemView: View {
var timelineItem: TimelineItem
var body: some View {
2020-07-01 19:30:55 +02:00
VStack {
2020-07-01 23:33:07 +02:00
HStack(alignment: .top) {
TimelineItemStatusView(status: timelineItem.status)
Text(verbatim: timelineItem.article.title ?? "N/A")
.frame(maxWidth: .infinity, alignment: .leading)
}
2020-07-01 19:30:55 +02:00
Divider()
}
2020-07-01 18:13:11 +02:00
}
}
2020-07-01 23:33:07 +02:00
struct TimelineItemView_Previews: PreviewProvider {
static var previews: some View {
Group {
TimelineItemView(timelineItem: TimelineItem(article: PreviewArticles.basicRead))
.frame(maxWidth: 250)
TimelineItemView(timelineItem: TimelineItem(article: PreviewArticles.basicUnread))
.frame(maxWidth: 250)
TimelineItemView(timelineItem: TimelineItem(article: PreviewArticles.basicStarred))
.frame(maxWidth: 250)
}
}
}