mirror of
https://github.com/yattee/yattee.git
synced 2024-09-20 01:11:31 +00:00
28 lines
660 B
Swift
28 lines
660 B
Swift
|
import Foundation
|
||
|
import SwiftUI
|
||
|
|
||
|
struct PopularVideosView: View {
|
||
|
@ObservedObject private var popular = PopluarVideosProvider()
|
||
|
|
||
|
var body: some View {
|
||
|
Group {
|
||
|
List {
|
||
|
ForEach(popular.videos) { video in
|
||
|
VideoThumbnailView(video: video)
|
||
|
.listRowInsets(listRowInsets)
|
||
|
}
|
||
|
}
|
||
|
.listStyle(GroupedListStyle())
|
||
|
}
|
||
|
.task {
|
||
|
async {
|
||
|
popular.load()
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var listRowInsets: EdgeInsets {
|
||
|
EdgeInsets(top: .zero, leading: .zero, bottom: .zero, trailing: 30)
|
||
|
}
|
||
|
}
|