From 743d551cf1f2bdc86ea6200da5ed8938bb96014d Mon Sep 17 00:00:00 2001 From: Deepak Kumar Date: Mon, 16 Mar 2026 15:13:45 +0530 Subject: [PATCH] create goals page --- frontend/src/pages/Goals.jsx | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/frontend/src/pages/Goals.jsx b/frontend/src/pages/Goals.jsx index e69de29..2b4c000 100644 --- a/frontend/src/pages/Goals.jsx +++ b/frontend/src/pages/Goals.jsx @@ -0,0 +1,56 @@ +import { useEffect, useState } from "react"; +import DashboardLayout from "../components/layout/DashboardLayout"; +import GoalProgressCircle from "../components/goals/GoalProgressCircle"; +import GoalHistory from "../components/goals/GoalHistory"; +import { getGoals } from "../services/goalsService"; + +function Goals() { + + const [today, setToday] = useState({ solved: 0, goal: 0 }); + const [history, setHistory] = useState([]); + + useEffect(() => { + + const fetchGoals = async () => { + + try { + + const data = await getGoals(); + + setToday(data.today || { solved: 0, goal: 0 }); + setHistory(data.history || []); + + } catch (err) { + + console.error("Goals fetch error:", err); + + } + + }; + + fetchGoals(); + + }, []); + + return ( + + + +
+ + + + + +
+ +
+ + ); + +} + +export default Goals; \ No newline at end of file