Ferrite-backup/Ferrite/Views/ComponentViews/Library/LibraryPickerView.swift
kingbri b80f8900b7 Debrid: Allow for UI updates
Mark as an ObservableObject so the UI can see parameters that are
being updated in the class.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00

31 lines
972 B
Swift

//
// LibraryPickerView.swift
// Ferrite
//
// Created by Brian Dashore on 2/13/23.
//
import SwiftUI
struct LibraryPickerView: View {
@Environment(\.verticalSizeClass) var verticalSizeClass
@EnvironmentObject var debridManager: DebridManager
@EnvironmentObject var navModel: NavigationViewModel
var body: some View {
HStack {
Picker("Segments", selection: $navModel.libraryPickerSelection) {
Text("Bookmarks").tag(NavigationViewModel.LibraryPickerSegment.bookmarks)
Text("History").tag(NavigationViewModel.LibraryPickerSegment.history)
if debridManager.hasEnabledDebrids {
Text("Cloud").tag(NavigationViewModel.LibraryPickerSegment.debridCloud)
}
}
}
.pickerStyle(.segmented)
.padding(.horizontal, verticalSizeClass == .compact && UIDevice.current.hasNotch ? 65 : 18)
.padding(.vertical, 5)
}
}