Files
PlantGuide/PlantGuide/Presentation/Extensions/Enums+UI.swift
Trey t be0d298d9f Add dark mode support and design system foundation
- Create DesignSystem with ColorTokens, AppearanceManager, spacing, and typography
- Add appearance picker in Settings (System/Light/Dark modes)
- Replace hardcoded colors with design tokens in MainTabView and Enums+UI
- Inject AppearanceManager via environment in PlantGuideApp
- Add FEATURE_ROADMAP.md documenting 8 planned features

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 14:17:56 -06:00

106 lines
3.0 KiB
Swift

//
// Enums+UI.swift
// PlantGuide
//
// UI extensions for domain enums.
// Separated from domain layer to maintain clean architecture.
//
import SwiftUI
// MARK: - CareTaskType UI Extensions
extension CareTaskType {
/// The SF Symbol name for this care task type
var iconName: String {
switch self {
case .watering: return "drop.fill"
case .fertilizing: return "leaf.fill"
case .repotting: return "arrow.up.bin.fill"
case .pruning: return "scissors"
case .pestControl: return "ant.fill"
}
}
/// The color associated with this care task type
var iconColor: Color {
switch self {
case .watering: return DesignSystem.Colors.taskWatering
case .fertilizing: return DesignSystem.Colors.taskFertilizing
case .repotting: return DesignSystem.Colors.taskRepotting
case .pruning: return DesignSystem.Colors.taskPruning
case .pestControl: return DesignSystem.Colors.taskPestControl
}
}
/// Human-readable description of the care task type
var description: String {
switch self {
case .watering: return "Watering"
case .fertilizing: return "Fertilizing"
case .repotting: return "Repotting"
case .pruning: return "Pruning"
case .pestControl: return "Pest Control"
}
}
}
// MARK: - LightRequirement UI Extensions
extension LightRequirement {
/// Human-readable description of the light requirement
var description: String {
switch self {
case .fullSun: return "Full Sun"
case .partialShade: return "Partial Shade"
case .fullShade: return "Full Shade"
case .lowLight: return "Low Light"
}
}
}
// MARK: - WateringFrequency UI Extensions
extension WateringFrequency {
/// Human-readable description of the watering frequency
var description: String {
switch self {
case .daily: return "Daily"
case .everyOtherDay: return "Every Other Day"
case .twiceWeekly: return "Twice Weekly"
case .weekly: return "Weekly"
case .biweekly: return "Every Two Weeks"
case .monthly: return "Monthly"
}
}
}
// MARK: - FertilizerFrequency UI Extensions
extension FertilizerFrequency {
/// Human-readable description of the fertilizer frequency
var description: String {
switch self {
case .weekly: return "Weekly"
case .biweekly: return "Every Two Weeks"
case .monthly: return "Monthly"
case .quarterly: return "Every 3 Months"
case .biannually: return "Twice Yearly"
}
}
}
// MARK: - HumidityLevel UI Extensions
extension HumidityLevel {
/// Human-readable description of the humidity level
var description: String {
switch self {
case .low: return "Low (below 30%)"
case .moderate: return "Moderate (30-50%)"
case .high: return "High (50-70%)"
case .veryHigh: return "Very High (above 70%)"
}
}
}