From d1e00fa470932d9369c7b80cfb6814cd1596a5a3 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Tue, 5 Jul 2022 19:21:13 +0200 Subject: [PATCH] Minor loading UI improvement --- Shared/Player/VideoDetails.swift | 56 ++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/Shared/Player/VideoDetails.swift b/Shared/Player/VideoDetails.swift index 8f629701..10f1c0e4 100644 --- a/Shared/Player/VideoDetails.swift +++ b/Shared/Player/VideoDetails.swift @@ -260,29 +260,51 @@ struct VideoDetails: View { } } - var videoProperties: some View { - HStack(spacing: 2) { - publishedDateSection - Spacer() + @ViewBuilder var videoProperties: some View { + Group { + if player.videoBeingOpened.isNil { + HStack(spacing: 2) { + publishedDateSection + Spacer() - HStack(spacing: 4) { - if let views = video?.viewsCount { - Image(systemName: "eye") + HStack(spacing: 4) { + if let views = video?.viewsCount { + Image(systemName: "eye") - Text(views) + Text(views) + } + + if let likes = video?.likesCount { + Image(systemName: "hand.thumbsup") + + Text(likes) + } + + if let likes = video?.dislikesCount { + Image(systemName: "hand.thumbsdown") + + Text(likes) + } + } } + } else { + HStack(spacing: 2) { + Text("Date placeholder") - if let likes = video?.likesCount { - Image(systemName: "hand.thumbsup") + Spacer() - Text(likes) - } - - if let likes = video?.dislikesCount { - Image(systemName: "hand.thumbsdown") - - Text(likes) + HStack(spacing: 4) { + Image(systemName: "eye") + Text("1000") + + Image(systemName: "eye") + Text("100") + + Image(systemName: "eye") + Text("10") + } } + .redacted(reason: .placeholder) } } .font(.system(size: 12))