feat: full Pulse Mobile implementation - all modules
- Phase 0: project.yml fixes (CODE_SIGN_ENTITLEMENTS confirmed) - Phase 1: Enhanced models (HabitModels, TaskModels, FinanceModels, SavingsModels, UserModels) - Phase 1: Enhanced APIService with all endpoints (habits/log/stats, tasks/uncomplete, finance/analytics, savings/*) - Phase 2: DashboardView rewrite - day progress bar, 4 stat cards, habit/task lists with Undo (3 sec) - Phase 3: TrackerView - HabitListView (streak badge, swipe delete, archive), TaskListView (priority, overdue), StatisticsView (heatmap 84 days, line chart, bar chart via Swift Charts) - Phase 4: FinanceView rewrite - month picker, summary card, top expenses progress bars, pie chart, line chart, transactions by day, analytics tab with bar chart + month comparison - Phase 5: SavingsView rewrite - overview with overdue block, categories tab with type icons, operations tab with category filter + add sheet - Phase 6: SettingsView - dark/light theme, profile edit, telegram chat id, notifications toggle + time, timezone picker, logout - Added: AddHabitView with weekly day selector + interval days - Added: AddTaskView with icon/color/due date picker - Haptic feedback on all toggle actions
This commit is contained in:
@@ -4,29 +4,25 @@ struct HabitRowView: View {
|
||||
let habit: Habit
|
||||
let onLog: () async -> Void
|
||||
|
||||
var accentColor: Color { Color(hex: habit.color ?? "00d4aa") }
|
||||
var accentColor: Color { Color(hex: habit.accentColorHex.replacingOccurrences(of: "#", with: "")) }
|
||||
var isDone: Bool { habit.completedToday == true }
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 14) {
|
||||
// Icon
|
||||
ZStack {
|
||||
Circle().fill(accentColor.opacity(isDone ? 0.3 : 0.1)).frame(width: 44, height: 44)
|
||||
Text(habit.icon ?? "🔥").font(.title3)
|
||||
Text(habit.displayIcon).font(.title3)
|
||||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(habit.name).font(.callout.weight(.medium)).foregroundColor(.white)
|
||||
HStack(spacing: 8) {
|
||||
Text(habit.frequency.displayName).font(.caption).foregroundColor(Color(hex: "8888aa"))
|
||||
Text(habit.frequencyLabel).font(.caption).foregroundColor(Color(hex: "8888aa"))
|
||||
if let streak = habit.currentStreak, streak > 0 {
|
||||
Text("🔥 \(streak)").font(.caption).foregroundColor(Color(hex: "ffa502"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
Button(action: { guard !isDone else { return }; Task { await onLog() } }) {
|
||||
Image(systemName: isDone ? "checkmark.circle.fill" : "circle")
|
||||
.font(.title2)
|
||||
|
||||
Reference in New Issue
Block a user