forked from Dimillian/RedditOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathListingVoteView.swift
46 lines (38 loc) · 1.24 KB
/
ListingVoteView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// ListingVoteView.swift
// RedditOs
//
// Created by Thomas Ricouard on 09/07/2020.
//
import SwiftUI
import Backend
struct ListingVoteView: View {
let listing: Listing
var body: some View {
VStack(spacing: 2) {
Button(action: {
},
label: {
Image(systemName: "arrowtriangle.up.circle")
.resizable()
.frame(width: 16, height: 16)
.foregroundColor(listing.likes == true ? .accentColor : nil)
}).buttonStyle(BorderlessButtonStyle())
Text(listing.ups.toRoundedSuffixAsString())
.fontWeight(.bold)
Button(action: {
},
label: {
Image(systemName: "arrowtriangle.down.circle")
.resizable()
.frame(width: 16, height: 16)
.foregroundColor(listing.likes == false ? Color("RedditBlue") : nil)
}).buttonStyle(BorderlessButtonStyle())
}.frame(width: 40)
}
}
struct ListingVoteView_Previews: PreviewProvider {
static var previews: some View {
ListingVoteView(listing: static_listing)
}
}