mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Minor image fixes
This commit is contained in:
parent
19d11a3ad9
commit
1980e8a10e
@ -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 {
|
||||||
|
if loaded {
|
||||||
|
Image(systemName: "person.circle")
|
||||||
|
.imageScale(.large)
|
||||||
|
.foregroundColor(.accentColor)
|
||||||
|
} else {
|
||||||
Color("PlaceholderColor")
|
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,11 +55,11 @@ struct ChannelAvatarView: View {
|
|||||||
#endif
|
#endif
|
||||||
.clipShape(Circle())
|
.clipShape(Circle())
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.imageScale(.small)
|
.imageScale(.small)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func updateURL() {
|
func updateURL() {
|
||||||
DispatchQueue.global(qos: .userInitiated).async {
|
DispatchQueue.global(qos: .userInitiated).async {
|
||||||
@ -60,6 +68,7 @@ struct ChannelAvatarView: View {
|
|||||||
self.url = url
|
self.url = url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
self.loaded = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user