mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Fix channel links
This commit is contained in:
parent
a156ef6a3f
commit
67e32f4da1
@ -13,7 +13,7 @@ struct ChannelAvatarView: View {
|
|||||||
ZStack(alignment: .bottomTrailing) {
|
ZStack(alignment: .bottomTrailing) {
|
||||||
Group {
|
Group {
|
||||||
Group {
|
Group {
|
||||||
if let url = channel?.thumbnailURL {
|
if let url = channel?.thumbnailURLOrCached {
|
||||||
ThumbnailView(url: url)
|
ThumbnailView(url: url)
|
||||||
} else {
|
} else {
|
||||||
ZStack {
|
ZStack {
|
||||||
|
@ -6,6 +6,7 @@ struct ChannelLinkView<ChannelLabel: View>: View {
|
|||||||
let channelLabel: ChannelLabel
|
let channelLabel: ChannelLabel
|
||||||
|
|
||||||
@Environment(\.inChannelView) private var inChannelView
|
@Environment(\.inChannelView) private var inChannelView
|
||||||
|
@Environment(\.inNavigationView) private var inNavigationView
|
||||||
@Environment(\.navigationStyle) private var navigationStyle
|
@Environment(\.navigationStyle) private var navigationStyle
|
||||||
|
|
||||||
init(
|
init(
|
||||||
@ -25,7 +26,7 @@ struct ChannelLinkView<ChannelLabel: View>: View {
|
|||||||
#if os(tvOS)
|
#if os(tvOS)
|
||||||
channelLabel
|
channelLabel
|
||||||
#else
|
#else
|
||||||
if navigationStyle == .tab {
|
if navigationStyle == .tab, inNavigationView {
|
||||||
channelNavigationLink
|
channelNavigationLink
|
||||||
} else {
|
} else {
|
||||||
channelButton
|
channelButton
|
||||||
|
@ -70,8 +70,18 @@ struct RecentNavigationLink<DestinationContent: View>: View {
|
|||||||
destination
|
destination
|
||||||
} label: {
|
} label: {
|
||||||
HStack {
|
HStack {
|
||||||
|
if recent.type == .channel,
|
||||||
|
let channel = recent.channel,
|
||||||
|
channel.thumbnailURLOrCached != nil
|
||||||
|
{
|
||||||
|
ChannelAvatarView(channel: channel, subscribedBadge: false)
|
||||||
|
.frame(width: 20, height: 20)
|
||||||
|
|
||||||
|
Text(channel.name)
|
||||||
|
} else {
|
||||||
Label(recent.title, systemImage: labelSystemImage)
|
Label(recent.title, systemImage: labelSystemImage)
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
|
}
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user