mirror of
https://github.com/yattee/yattee.git
synced 2025-04-29 18:16:30 +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) {
|
NavigationLink(tag: TabSelection.channel(channel.id), selection: $navigation.tabSelection) {
|
||||||
LazyView(ChannelVideosView(channel: channel).modifier(PlayerOverlayModifier()))
|
LazyView(ChannelVideosView(channel: channel).modifier(PlayerOverlayModifier()))
|
||||||
} label: {
|
} 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 {
|
.contextMenu {
|
||||||
Button("Unsubscribe") {
|
Button("Unsubscribe") {
|
||||||
|
@ -4,6 +4,8 @@ struct ChannelAvatarView: View {
|
|||||||
var channel: Channel?
|
var channel: Channel?
|
||||||
var video: Video?
|
var video: Video?
|
||||||
|
|
||||||
|
var subscribedBadge = true
|
||||||
|
|
||||||
@ObservedObject private var accounts = AccountsModel.shared
|
@ObservedObject private var accounts = AccountsModel.shared
|
||||||
@ObservedObject private var subscribedChannels = SubscribedChannelsModel.shared
|
@ObservedObject private var subscribedChannels = SubscribedChannelsModel.shared
|
||||||
|
|
||||||
@ -33,13 +35,18 @@ struct ChannelAvatarView: View {
|
|||||||
}
|
}
|
||||||
.clipShape(Circle())
|
.clipShape(Circle())
|
||||||
|
|
||||||
if accounts.app.supportsSubscriptions,
|
if subscribedBadge,
|
||||||
|
accounts.app.supportsSubscriptions,
|
||||||
accounts.signedIn,
|
accounts.signedIn,
|
||||||
let channel,
|
let channel,
|
||||||
subscribedChannels.isSubscribing(channel.id)
|
subscribedChannels.isSubscribing(channel.id)
|
||||||
{
|
{
|
||||||
Image(systemName: "star.circle.fill")
|
Image(systemName: "star.circle.fill")
|
||||||
|
#if os(tvOS)
|
||||||
.background(Color.black)
|
.background(Color.black)
|
||||||
|
#else
|
||||||
|
.background(Color.background)
|
||||||
|
#endif
|
||||||
.clipShape(Circle())
|
.clipShape(Circle())
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user