Add Periphery configuration, remove unused code

This commit is contained in:
Arkadiusz Fal
2021-09-29 16:29:17 +02:00
parent 1b1be1aefe
commit e270b7b213
28 changed files with 400 additions and 242 deletions

View File

@@ -5,18 +5,12 @@ import SwiftUI
struct PlaylistsView: View {
@EnvironmentObject<PlaylistsModel> private var model
@EnvironmentObject<InvidiousAPI> private var api
@EnvironmentObject<NavigationModel> private var navigation
@State private var showingNewPlaylist = false
@State private var createdPlaylist: Playlist?
@State private var showingEditPlaylist = false
@State private var editedPlaylist: Playlist?
@State private var showingAddToPlaylist = false
@State private var videoIDToAddToPlaylist = ""
@Namespace private var focusNamespace
var videos: [Video] {
@@ -98,34 +92,38 @@ struct PlaylistsView: View {
}
#endif
}
.focusScope(focusNamespace)
#if os(tvOS)
.focusScope(focusNamespace)
#endif
.onAppear {
model.load()
}
}
var toolbar: some View {
HStack {
if model.isEmpty {
Text("No Playlists")
.foregroundColor(.secondary)
} else {
Text("Current Playlist")
.foregroundColor(.secondary)
#if os(tvOS)
var toolbar: some View {
HStack {
if model.isEmpty {
Text("No Playlists")
.foregroundColor(.secondary)
} else {
Text("Current Playlist")
.foregroundColor(.secondary)
selectPlaylistButton
selectPlaylistButton
}
if model.currentPlaylist != nil {
editPlaylistButton
}
Spacer()
newPlaylistButton
.padding(.leading, 40)
}
if model.currentPlaylist != nil {
editPlaylistButton
}
Spacer()
newPlaylistButton
.padding(.leading, 40)
}
}
#endif
func hintText(_ text: String) -> some View {
VStack {