1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 13:50:32 +05:30
yattee/Shared/Views/PopularView.swift
2021-09-25 11:34:46 +02:00

24 lines
500 B
Swift

import Siesta
import SwiftUI
struct PopularView: View {
@StateObject private var store = Store<[Video]>()
@EnvironmentObject<InvidiousAPI> private var api
var resource: Resource {
api.popular
}
var body: some View {
VideosView(videos: store.collection)
.onAppear {
resource.addObserver(store)
resource.loadIfNeeded()
}
#if !os(tvOS)
.navigationTitle("Popular")
#endif
}
}