From ff2d358b83d1af49f5fd6e26eb56b6eab1727a37 Mon Sep 17 00:00:00 2001 From: ZL Asica <40444637+ZL-Asica@users.noreply.github.com> Date: Wed, 6 Nov 2024 20:05:10 -0600 Subject: [PATCH] refactor: Move all GoalTracker into Home. --- src/components/Home/GoalTracker.jsx | 32 ----------------------------- src/pages/Home.jsx | 28 ++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 35 deletions(-) delete mode 100644 src/components/Home/GoalTracker.jsx diff --git a/src/components/Home/GoalTracker.jsx b/src/components/Home/GoalTracker.jsx deleted file mode 100644 index 3501701..0000000 --- a/src/components/Home/GoalTracker.jsx +++ /dev/null @@ -1,32 +0,0 @@ -import AddItem from '@/components/Home/AddItem' -import MacroGoal from '@/components/Home/MacroGoal' -import { useUser } from '@/contexts/UserContext' -import useGoalsUpdater from '@/hooks/useGoalsUpdater' -import { Box } from '@mui/material' - -export default function GoalTracker() { - const { user } = useUser() - const { addGoal } = useGoalsUpdater() - - return ( - - - - {/* Render existing goals */} - - {user.goals.map((goal, index) => ( - - - - ))} - - - ) -} diff --git a/src/pages/Home.jsx b/src/pages/Home.jsx index ed01c0f..b658e1e 100644 --- a/src/pages/Home.jsx +++ b/src/pages/Home.jsx @@ -1,10 +1,32 @@ -import GoalTracker from '@/components/Home/GoalTracker' +import AddItem from '@/components/Home/AddItem' +import MacroGoal from '@/components/Home/MacroGoal' +import { useUser } from '@/contexts/UserContext' +import useGoalsUpdater from '@/hooks/useGoalsUpdater' import { Box } from '@mui/material' const Home = () => { + const { user } = useUser() + const { addGoal } = useGoalsUpdater() + return ( - - + + + + {/* Render existing goals */} + + {user.goals.map((goal, index) => ( + + + + ))} + ) }