mirror of
https://github.com/yattee/yattee.git
synced 2026-02-20 09:49:46 +00:00
Yattee v2 rewrite
This commit is contained in:
53
Yattee/Models/Navigation/AppTab.swift
Normal file
53
Yattee/Models/Navigation/AppTab.swift
Normal file
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// AppTab.swift
|
||||
// Yattee
|
||||
//
|
||||
// Main app tab definitions.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum AppTab: String, CaseIterable, Identifiable {
|
||||
case home
|
||||
case subscriptions
|
||||
case search
|
||||
#if os(tvOS)
|
||||
case settings
|
||||
#endif
|
||||
|
||||
var id: String { rawValue }
|
||||
|
||||
var title: String {
|
||||
switch self {
|
||||
case .home: return String(localized: "tabs.home")
|
||||
case .subscriptions: return String(localized: "tabs.subscriptions")
|
||||
case .search: return String(localized: "tabs.search")
|
||||
#if os(tvOS)
|
||||
case .settings: return String(localized: "tabs.settings")
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
var systemImage: String {
|
||||
switch self {
|
||||
case .home: return "house.fill"
|
||||
case .subscriptions: return "play.square.stack.fill"
|
||||
case .search: return "magnifyingglass"
|
||||
#if os(tvOS)
|
||||
case .settings: return "gearshape"
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// SidebarItem equivalent for UnifiedTabView navigation.
|
||||
var sidebarItem: SidebarItem {
|
||||
switch self {
|
||||
case .home: return .home
|
||||
case .subscriptions: return .subscriptionsFeed
|
||||
case .search: return .search
|
||||
#if os(tvOS)
|
||||
case .settings: return .settings
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user