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:
@@ -1,5 +1,7 @@
|
||||
import SwiftUI
|
||||
|
||||
// HabitsView is now used by TrackerView (HabitListView).
|
||||
// This file kept for backward compat but MainTabView uses TrackerView.
|
||||
struct HabitsView: View {
|
||||
@EnvironmentObject var authManager: AuthManager
|
||||
@State private var habits: [Habit] = []
|
||||
@@ -19,43 +21,36 @@ struct HabitsView: View {
|
||||
}
|
||||
Spacer()
|
||||
Button(action: { showAddHabit = true }) {
|
||||
Image(systemName: "plus.circle.fill").font(.title2).foregroundColor(Color(hex: "00d4aa"))
|
||||
Image(systemName: "plus.circle.fill").font(.title2).foregroundColor(Color(hex: "0D9488"))
|
||||
}
|
||||
}.padding()
|
||||
|
||||
// Progress bar
|
||||
if !habits.isEmpty {
|
||||
GeometryReader { geo in
|
||||
ZStack(alignment: .leading) {
|
||||
RoundedRectangle(cornerRadius: 4).fill(Color.white.opacity(0.1))
|
||||
RoundedRectangle(cornerRadius: 4).fill(Color(hex: "00d4aa"))
|
||||
RoundedRectangle(cornerRadius: 4).fill(Color(hex: "0D9488"))
|
||||
.frame(width: geo.size.width * CGFloat(completedCount) / CGFloat(max(habits.count, 1)))
|
||||
}
|
||||
}
|
||||
.frame(height: 6)
|
||||
.padding(.horizontal)
|
||||
.padding(.bottom, 16)
|
||||
.frame(height: 6).padding(.horizontal).padding(.bottom, 16)
|
||||
}
|
||||
|
||||
if isLoading {
|
||||
ProgressView().tint(Color(hex: "00d4aa")).padding(.top, 40)
|
||||
Spacer()
|
||||
ProgressView().tint(Color(hex: "0D9488")).padding(.top, 40); Spacer()
|
||||
} else if habits.isEmpty {
|
||||
VStack(spacing: 12) {
|
||||
Text("🔥").font(.system(size: 50))
|
||||
Text("Нет привычек").foregroundColor(Color(hex: "8888aa"))
|
||||
}.padding(.top, 60)
|
||||
Spacer()
|
||||
}.padding(.top, 60); Spacer()
|
||||
} else {
|
||||
List {
|
||||
ForEach(habits) { habit in
|
||||
HabitRowView(habit: habit) { await logHabit(habit) }
|
||||
.listRowBackground(Color.clear)
|
||||
.listRowSeparator(.hidden)
|
||||
.listRowBackground(Color.clear).listRowSeparator(.hidden)
|
||||
}
|
||||
}
|
||||
.listStyle(.plain)
|
||||
.scrollContentBackground(.hidden)
|
||||
.listStyle(.plain).scrollContentBackground(.hidden)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,8 +58,7 @@ struct HabitsView: View {
|
||||
.refreshable { await loadHabits(refresh: true) }
|
||||
.sheet(isPresented: $showAddHabit) {
|
||||
AddHabitView(isPresented: $showAddHabit) { await loadHabits(refresh: true) }
|
||||
.presentationDetents([.large])
|
||||
.presentationDragIndicator(.visible)
|
||||
.presentationDetents([.large]).presentationDragIndicator(.visible)
|
||||
.presentationBackground(Color(hex: "0a0a1a"))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user