mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 05:23:41 +00:00
Fix tvOS comments
This commit is contained in:
parent
c7365a7dc1
commit
dc3492fd96
@ -131,7 +131,9 @@ struct CommentView: View {
|
|||||||
|
|
||||||
Text(comment.time)
|
Text(comment.time)
|
||||||
.font(.caption2)
|
.font(.caption2)
|
||||||
|
#if !os(tvOS)
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
}
|
}
|
||||||
@ -159,11 +161,11 @@ struct CommentView: View {
|
|||||||
Text("\(comment.likeCount.formattedAsAbbreviation())")
|
Text("\(comment.likeCount.formattedAsAbbreviation())")
|
||||||
}
|
}
|
||||||
#if !os(tvOS)
|
#if !os(tvOS)
|
||||||
|
.foregroundColor(.secondary)
|
||||||
.font(.system(size: 12))
|
.font(.system(size: 12))
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.foregroundColor(.secondary)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var repliesButton: some View {
|
private var repliesButton: some View {
|
||||||
@ -181,7 +183,8 @@ struct CommentView: View {
|
|||||||
Text("Replies")
|
Text("Replies")
|
||||||
}
|
}
|
||||||
#if os(tvOS)
|
#if os(tvOS)
|
||||||
.padding(10)
|
.font(.system(size: 26))
|
||||||
|
.padding(.vertical, 3)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
.buttonStyle(.plain)
|
.buttonStyle(.plain)
|
||||||
@ -237,6 +240,8 @@ struct CommentView: View {
|
|||||||
.lineSpacing(3)
|
.lineSpacing(3)
|
||||||
.fixedSize(horizontal: false, vertical: true)
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
.textSelection(.enabled)
|
.textSelection(.enabled)
|
||||||
|
#else
|
||||||
|
Text(comment.text)
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
Text(rawText)
|
Text(rawText)
|
||||||
|
@ -11,6 +11,7 @@ struct NowPlayingView: View {
|
|||||||
var inInfoViewController = false
|
var inInfoViewController = false
|
||||||
|
|
||||||
@State private var repliesID: Comment.ID?
|
@State private var repliesID: Comment.ID?
|
||||||
|
@State private var availableWidth = 0.0
|
||||||
|
|
||||||
@FetchRequest(sortDescriptors: [.init(key: "watchedAt", ascending: false)])
|
@FetchRequest(sortDescriptors: [.init(key: "watchedAt", ascending: false)])
|
||||||
var watches: FetchedResults<Watch>
|
var watches: FetchedResults<Watch>
|
||||||
@ -109,7 +110,7 @@ struct NowPlayingView: View {
|
|||||||
} else {
|
} else {
|
||||||
Section {
|
Section {
|
||||||
ForEach(comments.all) { comment in
|
ForEach(comments.all) { comment in
|
||||||
CommentView(comment: comment, repliesID: $repliesID)
|
CommentView(comment: comment, repliesID: $repliesID, availableWidth: availableWidth)
|
||||||
}
|
}
|
||||||
if comments.nextPageAvailable {
|
if comments.nextPageAvailable {
|
||||||
Text("Scroll to load more...")
|
Text("Scroll to load more...")
|
||||||
@ -120,6 +121,12 @@ struct NowPlayingView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.background(GeometryReader { geometry in
|
||||||
|
Color.clear
|
||||||
|
.onAppear {
|
||||||
|
self.availableWidth = Double(geometry.size.width)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user