We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ceb496c commit 1a6be7bCopy full SHA for 1a6be7b
Shared/Views/CommentsView.swift
@@ -44,6 +44,14 @@ struct CommentView: View {
44
let comment: Comment
45
let postAuthor: String
46
let nestLevel: Int
47
+
48
+ var authorText: some View {
49
+ if comment.author == postAuthor {
50
+ return Text(comment.author).foregroundColor(.accentColor)
51
+ } else {
52
+ return Text(comment.author)
53
+ }
54
55
56
var body: some View {
57
Group {
@@ -57,12 +65,7 @@ struct CommentView: View {
65
/// Content
58
66
VStack(alignment: .leading) {
59
67
HStack {
60
- if comment.author == postAuthor {
61
- Text(comment.author)
62
- .foregroundColor(.accentColor)
63
- } else {
64
- }
68
+ authorText
69
Image(systemName: "arrow.up")
70
Text("\(comment.score)")
71
}
0 commit comments