54 lines
1.5 KiB
Swift
54 lines
1.5 KiB
Swift
// ── Main Content View with Tab Navigation ─────────────────────
|
|
|
|
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
@EnvironmentObject var timerStore: TimerStore
|
|
@State private var selectedTab: Tab = .timeline
|
|
|
|
enum Tab: String, CaseIterable {
|
|
case timeline = "Timeline"
|
|
case focus = "Focus"
|
|
case history = "History"
|
|
case settings = "Settings"
|
|
|
|
var icon: String {
|
|
switch self {
|
|
case .timeline: return "clock.fill"
|
|
case .focus: return "target"
|
|
case .history: return "chart.bar.fill"
|
|
case .settings: return "gearshape.fill"
|
|
}
|
|
}
|
|
}
|
|
|
|
var body: some View {
|
|
TabView(selection: $selectedTab) {
|
|
TimelineView()
|
|
.tabItem {
|
|
Label(Tab.timeline.rawValue, systemImage: Tab.timeline.icon)
|
|
}
|
|
.tag(Tab.timeline)
|
|
|
|
PomodoroView()
|
|
.tabItem {
|
|
Label(Tab.focus.rawValue, systemImage: Tab.focus.icon)
|
|
}
|
|
.tag(Tab.focus)
|
|
|
|
HistoryView()
|
|
.tabItem {
|
|
Label(Tab.history.rawValue, systemImage: Tab.history.icon)
|
|
}
|
|
.tag(Tab.history)
|
|
|
|
SettingsView()
|
|
.tabItem {
|
|
Label(Tab.settings.rawValue, systemImage: Tab.settings.icon)
|
|
}
|
|
.tag(Tab.settings)
|
|
}
|
|
.tint(CMColors.accent)
|
|
}
|
|
}
|