More uniform comments UI

This commit is contained in:
Arkadiusz Fal
2021-12-17 20:46:49 +01:00
parent 008cd1553d
commit 923f0c0356
4 changed files with 117 additions and 67 deletions

View File

@@ -117,9 +117,18 @@ struct NowPlayingView: View {
}
if sections.contains(.comments) {
Section {
ForEach(comments.all) { comment in
CommentView(comment: comment, repliesID: $repliesID)
if !comments.loaded {
VStack(alignment: .center) {
progressView
.onAppear {
comments.load()
}
}
} else {
Section {
ForEach(comments.all) { comment in
CommentView(comment: comment, repliesID: $repliesID)
}
}
}
}
@@ -137,6 +146,19 @@ struct NowPlayingView: View {
.font((inInfoViewController ? Font.system(size: 40) : .title3).bold())
.foregroundColor(.secondary)
}
private var progressView: some View {
VStack {
Spacer()
HStack {
Spacer()
ProgressView()
Spacer()
}
Spacer()
}
}
}
struct NowPlayingView_Previews: PreviewProvider {