mirror of
https://github.com/yattee/yattee.git
synced 2025-04-25 08:06:31 +00:00
Show channel avatars in sidebar
This commit is contained in:
parent
bc42a2fa88
commit
38593ed488
@ -11,7 +11,16 @@ struct AppSidebarSubscriptions: View {
|
||||
NavigationLink(tag: TabSelection.channel(channel.id), selection: $navigation.tabSelection) {
|
||||
LazyView(ChannelVideosView(channel: channel).modifier(PlayerOverlayModifier()))
|
||||
} label: {
|
||||
Label(channel.name, systemImage: RecentsModel.symbolSystemImage(channel.name))
|
||||
if channel.thumbnailURL != nil {
|
||||
HStack {
|
||||
ChannelAvatarView(channel: channel, subscribedBadge: false)
|
||||
.frame(width: 20, height: 20)
|
||||
|
||||
Text(channel.name)
|
||||
}
|
||||
} else {
|
||||
Label(channel.name, systemImage: RecentsModel.symbolSystemImage(channel.name))
|
||||
}
|
||||
}
|
||||
.contextMenu {
|
||||
Button("Unsubscribe") {
|
||||
|
@ -4,6 +4,8 @@ struct ChannelAvatarView: View {
|
||||
var channel: Channel?
|
||||
var video: Video?
|
||||
|
||||
var subscribedBadge = true
|
||||
|
||||
@ObservedObject private var accounts = AccountsModel.shared
|
||||
@ObservedObject private var subscribedChannels = SubscribedChannelsModel.shared
|
||||
|
||||
@ -33,13 +35,18 @@ struct ChannelAvatarView: View {
|
||||
}
|
||||
.clipShape(Circle())
|
||||
|
||||
if accounts.app.supportsSubscriptions,
|
||||
if subscribedBadge,
|
||||
accounts.app.supportsSubscriptions,
|
||||
accounts.signedIn,
|
||||
let channel,
|
||||
subscribedChannels.isSubscribing(channel.id)
|
||||
{
|
||||
Image(systemName: "star.circle.fill")
|
||||
#if os(tvOS)
|
||||
.background(Color.black)
|
||||
#else
|
||||
.background(Color.background)
|
||||
#endif
|
||||
.clipShape(Circle())
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user