Minor image fixes

This commit is contained in:
Arkadiusz Fal 2023-07-25 13:20:20 +02:00
parent 19d11a3ad9
commit 1980e8a10e
2 changed files with 12 additions and 3 deletions

View File

@ -10,6 +10,7 @@ struct ChannelAvatarView: View {
@ObservedObject private var subscribedChannels = SubscribedChannelsModel.shared @ObservedObject private var subscribedChannels = SubscribedChannelsModel.shared
@State private var url: URL? @State private var url: URL?
@State private var loaded = false
var body: some View { var body: some View {
ZStack(alignment: .bottomTrailing) { ZStack(alignment: .bottomTrailing) {
@ -19,13 +20,20 @@ struct ChannelAvatarView: View {
ThumbnailView(url: url) ThumbnailView(url: url)
} else { } else {
ZStack { ZStack {
Color("PlaceholderColor") if loaded {
Image(systemName: "person.circle")
.imageScale(.large)
.foregroundColor(.accentColor)
} else {
Color("PlaceholderColor")
}
if let video, video.isLocal { if let video, video.isLocal {
Image(systemName: video.localStreamImageSystemName) Image(systemName: video.localStreamImageSystemName)
.foregroundColor(.accentColor) .foregroundColor(.accentColor)
.font(.system(size: 20)) .font(.system(size: 20))
.contentShape(Rectangle()) .contentShape(Rectangle())
.imageScale(.small)
} }
} }
.onAppear(perform: updateURL) .onAppear(perform: updateURL)
@ -47,10 +55,10 @@ struct ChannelAvatarView: View {
#endif #endif
.clipShape(Circle()) .clipShape(Circle())
.foregroundColor(.secondary) .foregroundColor(.secondary)
.imageScale(.small)
} }
} }
} }
.imageScale(.small)
} }
func updateURL() { func updateURL() {
@ -60,6 +68,7 @@ struct ChannelAvatarView: View {
self.url = url self.url = url
} }
} }
self.loaded = true
} }
} }
} }

View File

@ -41,7 +41,7 @@ struct VideoDetails: View {
) )
} else { } else {
Circle() Circle()
.foregroundColor(Color(white: 0.6).opacity(0.5)) .foregroundColor(Color("PlaceholderColor"))
} }
} }
.frame(width: 40, height: 40) .frame(width: 40, height: 40)