2021-06-28 16:13:07 +05:30
|
|
|
import Siesta
|
2021-06-11 18:06:26 +05:30
|
|
|
import SwiftUI
|
|
|
|
|
2021-07-28 04:10:04 +05:30
|
|
|
struct PopularView: View {
|
2021-09-25 13:48:22 +05:30
|
|
|
@StateObject private var store = Store<[Video]>()
|
2021-06-12 03:24:00 +05:30
|
|
|
|
2021-10-17 04:18:58 +05:30
|
|
|
@EnvironmentObject<AccountsModel> private var accounts
|
2021-06-12 02:41:59 +05:30
|
|
|
|
2021-09-25 13:48:22 +05:30
|
|
|
var resource: Resource {
|
2021-10-17 04:18:58 +05:30
|
|
|
accounts.invidious.popular
|
2021-06-28 16:13:07 +05:30
|
|
|
}
|
2021-06-14 23:35:02 +05:30
|
|
|
|
2021-06-28 16:13:07 +05:30
|
|
|
var body: some View {
|
2021-10-06 01:50:09 +05:30
|
|
|
PlayerControlsView {
|
|
|
|
VideosCellsVertical(videos: store.collection)
|
|
|
|
.onAppear {
|
|
|
|
resource.addObserver(store)
|
|
|
|
resource.loadIfNeeded()
|
|
|
|
}
|
|
|
|
#if !os(tvOS)
|
|
|
|
.navigationTitle("Popular")
|
|
|
|
#endif
|
|
|
|
}
|
2021-06-11 18:06:26 +05:30
|
|
|
}
|
|
|
|
}
|