notification system implemented
need refinements
This commit is contained in:
1 parent
612259f020
commit
1143f8ca02
33 files changed
+2221
-222
No files matched your search
@@ -5,6 +5,7 @@ import { Ionicons } from "@expo/vector-icons";
|
||||
import { theme } from "../styles/theme";
|
||||
import { useStatistics } from "../contexts/StatisticsContext";
|
||||
import type { WeeklyTrendData } from "../api/types";
|
||||
import log from "../utils/logger";
|
||||
|
||||
export function WeeklyProgressWidget() {
|
||||
const { statistics, loading, refetchStatistics } = useStatistics();
|
||||
@@ -16,9 +17,24 @@ export function WeeklyProgressWidget() {
|
||||
|
||||
useEffect(() => {
|
||||
if (statistics?.weeklyTrend) {
|
||||
log.debug("WeeklyProgressWidget - Processing weekly trend", {
|
||||
weeklyTrendLength: statistics.weeklyTrend.length,
|
||||
weeklyTrend: statistics.weeklyTrend,
|
||||
statisticsKeys: Object.keys(statistics),
|
||||
});
|
||||
|
||||
// Get last 4 weeks for compact display
|
||||
const last4Weeks = statistics.weeklyTrend.slice(-4);
|
||||
setWeeklyData(last4Weeks);
|
||||
|
||||
log.debug("WeeklyProgressWidget - Set weekly data", {
|
||||
last4Weeks,
|
||||
});
|
||||
} else {
|
||||
log.debug("WeeklyProgressWidget - No weekly trend data", {
|
||||
hasStatistics: !!statistics,
|
||||
statistics,
|
||||
});
|
||||
}
|
||||
}, [statistics]);
|
||||
|
||||
|
||||
Reference in new issue
Block a user