mirror of
https://github.com/yattee/yattee.git
synced 2025-12-27 23:20:16 +00:00
Rename Apple TV folder to tvOS
This commit is contained in:
36
tvOS/ChannelView.swift
Normal file
36
tvOS/ChannelView.swift
Normal file
@@ -0,0 +1,36 @@
|
||||
import Siesta
|
||||
import SwiftUI
|
||||
|
||||
struct ChannelView: View {
|
||||
@ObservedObject private var store = Store<[Video]>()
|
||||
|
||||
var id: String
|
||||
|
||||
var resource: Resource {
|
||||
InvidiousAPI.shared.channelVideos(id)
|
||||
}
|
||||
|
||||
init(id: String) {
|
||||
self.id = id
|
||||
resource.addObserver(store)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
Spacer()
|
||||
|
||||
VStack {
|
||||
Spacer()
|
||||
VideosView(videos: store.collection)
|
||||
.onAppear {
|
||||
resource.loadIfNeeded()
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.edgesIgnoringSafeArea(.all)
|
||||
.background(.ultraThickMaterial)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user