Impressia/Vernissage/Widgets/InteractionRow.swift

75 lines
2.0 KiB
Swift
Raw Normal View History

2023-01-03 14:09:22 +01:00
//
// https://mczachurski.dev
// Copyright © 2023 Marcin Czachurski and the repository contributors.
// Licensed under the MIT License.
//
import SwiftUI
struct InteractionRow: View {
2023-01-04 17:56:01 +01:00
@ObservedObject public var statusData: StatusData
2023-01-03 14:09:22 +01:00
var body: some View {
HStack (alignment: .top) {
2023-01-04 17:56:01 +01:00
Button {
// Reply
} label: {
HStack(alignment: .center) {
Image(systemName: "message")
Text("\(statusData.repliesCount)")
.font(.caption)
2023-01-03 14:09:22 +01:00
}
}
2023-01-04 17:56:01 +01:00
Spacer()
Button {
2023-01-03 14:09:22 +01:00
// Reboost
2023-01-04 17:56:01 +01:00
} label: {
HStack(alignment: .center) {
2023-01-03 14:09:22 +01:00
Image(systemName: statusData.reblogged ? "arrowshape.turn.up.forward.fill" : "arrowshape.turn.up.forward")
2023-01-04 17:56:01 +01:00
Text("\(statusData.reblogsCount)")
.font(.caption)
2023-01-03 14:09:22 +01:00
}
}
Spacer()
2023-01-04 17:56:01 +01:00
Button {
// Favorite
} label: {
HStack(alignment: .center) {
Image(systemName: statusData.favourited ? "hand.thumbsup.fill" : "hand.thumbsup")
Text("\(statusData.favouritesCount)")
.font(.caption)
}
}
Spacer()
Button {
2023-01-03 14:09:22 +01:00
// Bookmark
2023-01-04 17:56:01 +01:00
} label: {
2023-01-03 14:09:22 +01:00
Image(systemName: statusData.bookmarked ? "bookmark.fill" : "bookmark")
}
2023-01-04 17:56:01 +01:00
Spacer()
Button {
// Share
} label: {
Image(systemName: "square.and.arrow.up")
}
2023-01-03 14:09:22 +01:00
}
2023-01-04 17:56:01 +01:00
.font(.title3)
.fontWeight(.semibold)
.foregroundColor(Color.accentColor)
2023-01-03 14:09:22 +01:00
}
}
struct InteractionRow_Previews: PreviewProvider {
static var previews: some View {
InteractionRow(statusData: StatusData())
}
}