mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Comments (fixes #4)
This commit is contained in:
@@ -3,13 +3,17 @@ import SwiftUI
|
||||
|
||||
struct NowPlayingView: View {
|
||||
enum ViewSection: CaseIterable {
|
||||
case nowPlaying, playingNext, playedPreviously, related
|
||||
case nowPlaying, playingNext, playedPreviously, related, comments
|
||||
}
|
||||
|
||||
var sections = ViewSection.allCases
|
||||
var sections = [ViewSection.nowPlaying, .playingNext, .playedPreviously, .related]
|
||||
var inInfoViewController = false
|
||||
|
||||
@State private var repliesID: Comment.ID?
|
||||
|
||||
@EnvironmentObject<CommentsModel> private var comments
|
||||
@EnvironmentObject<PlayerModel> private var player
|
||||
@EnvironmentObject<RecentsModel> private var recents
|
||||
|
||||
@Default(.saveHistory) private var saveHistory
|
||||
|
||||
@@ -111,6 +115,14 @@ struct NowPlayingView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if sections.contains(.comments) {
|
||||
Section {
|
||||
ForEach(comments.all) { comment in
|
||||
CommentView(comment: comment, repliesID: $repliesID)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 20))
|
||||
.padding(.vertical, 20)
|
||||
|
Reference in New Issue
Block a user