1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 13:50:32 +05:30
This commit is contained in:
Arkadiusz Fal 2023-05-22 23:07:14 +02:00
parent 02a29e5d07
commit b16eae3d88

View File

@ -7,16 +7,28 @@ struct ChannelPlaylistCell: View {
@Environment(\.navigationStyle) private var navigationStyle
var body: some View {
if navigationStyle == .tab {
NavigationLink(destination: ChannelPlaylistView(playlist: playlist)) { cell }
} else {
Button {
NavigationModel.shared.openChannelPlaylist(playlist, navigationStyle: navigationStyle)
} label: {
cell
#if os(tvOS)
button
#else
if navigationStyle == .tab {
navigationLink
} else {
button
}
.buttonStyle(.plain)
#endif
}
var navigationLink: some View {
NavigationLink(destination: ChannelPlaylistView(playlist: playlist)) { cell }
}
var button: some View {
Button {
NavigationModel.shared.openChannelPlaylist(playlist, navigationStyle: navigationStyle)
} label: {
cell
}
.buttonStyle(.plain)
}
var cell: some View {