2020-07-01 23:33:07 +02:00
|
|
|
//
|
|
|
|
// TimelineItemStatusView.swift
|
|
|
|
// NetNewsWire
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 7/1/20.
|
|
|
|
// Copyright © 2020 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct TimelineItemStatusView: View {
|
|
|
|
|
2020-07-20 01:20:05 +02:00
|
|
|
var selected: Bool
|
2020-07-01 23:33:07 +02:00
|
|
|
var status: TimelineItemStatus
|
|
|
|
|
2020-08-13 16:25:34 +02:00
|
|
|
var statusView: some View {
|
2020-07-10 17:13:18 +02:00
|
|
|
ZStack {
|
|
|
|
Spacer().frame(width: 12)
|
|
|
|
switch status {
|
|
|
|
case .showUnread:
|
2020-07-20 01:20:05 +02:00
|
|
|
if selected {
|
|
|
|
AppAssets.timelineUnreadSelected
|
|
|
|
.resizable()
|
|
|
|
.frame(width: 8, height: 8, alignment: .center)
|
|
|
|
.padding(.all, 2)
|
|
|
|
} else {
|
|
|
|
AppAssets.timelineUnread
|
|
|
|
.resizable()
|
|
|
|
.frame(width: 8, height: 8, alignment: .center)
|
|
|
|
.padding(.all, 2)
|
|
|
|
}
|
2020-07-10 17:13:18 +02:00
|
|
|
case .showStar:
|
|
|
|
AppAssets.timelineStarred
|
|
|
|
.resizable()
|
|
|
|
.frame(width: 10, height: 10, alignment: .center)
|
|
|
|
case .showNone:
|
|
|
|
AppAssets.timelineUnread
|
|
|
|
.resizable()
|
|
|
|
.frame(width: 8, height: 8, alignment: .center)
|
|
|
|
.padding(.all, 2)
|
|
|
|
.opacity(0)
|
|
|
|
}
|
2020-07-01 23:33:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
statusView
|
|
|
|
.padding(.top, 4)
|
|
|
|
.padding(.leading, 4)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|