yattee/Shared/Player/Controls/VideoDetailsOverlay.swift

29 lines
835 B
Swift
Raw Normal View History

2022-07-10 17:51:46 +00:00
import Defaults
import SwiftUI
struct VideoDetailsOverlay: View {
@ObservedObject private var controls = PlayerControlsModel.shared
2022-07-10 17:51:46 +00:00
2022-12-17 23:08:30 +00:00
@State private var detailsPage = VideoDetails.DetailsPage.info
2022-11-18 21:22:57 +00:00
2022-07-10 17:51:46 +00:00
var body: some View {
2022-12-17 23:08:30 +00:00
VideoDetails(video: PlayerModel.shared.currentVideo, page: $detailsPage, sidebarQueue: .constant(false), fullScreen: fullScreenBinding)
.clipShape(RoundedRectangle(cornerRadius: 4))
2022-07-10 17:51:46 +00:00
}
var fullScreenBinding: Binding<Bool> {
.init(get: {
controls.presentingDetailsOverlay
}, set: { newValue in
controls.presentingDetailsOverlay = newValue
})
}
}
struct VideoDetailsOverlay_Previews: PreviewProvider {
static var previews: some View {
VideoDetailsOverlay()
.injectFixtureEnvironmentObjects()
}
}