1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-15 23:00:32 +05:30
yattee/Apple TV/PopularVideosView.swift

23 lines
447 B
Swift
Raw Normal View History

2021-06-28 16:13:07 +05:30
import Siesta
2021-06-11 18:06:26 +05:30
import SwiftUI
struct PopularVideosView: View {
2021-06-28 16:13:07 +05:30
@ObservedObject private var store = Store<[Video]>()
2021-06-12 03:24:00 +05:30
2021-06-28 16:13:07 +05:30
var resource = InvidiousAPI.shared.popular
2021-06-12 02:41:59 +05:30
2021-06-28 16:13:07 +05:30
init() {
resource.addObserver(store)
}
2021-06-14 23:35:02 +05:30
2021-06-28 16:13:07 +05:30
var body: some View {
VideosView(videos: store.collection)
2021-07-12 02:22:49 +05:30
#if !os(tvOS)
.navigationTitle("Popular")
#endif
.onAppear {
resource.loadIfNeeded()
}
2021-06-11 18:06:26 +05:30
}
}