From 44372059cd1b1fa434aa60da2e5e8572ff6cbe1b Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Sun, 8 Jun 2025 02:20:25 -0400 Subject: [PATCH] refactor: Replace UserContext with useUserProfile hook in UserPoints component --- src/views/User/UserPoints.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/User/UserPoints.jsx b/src/views/User/UserPoints.jsx index 8746f93..309fbbf 100644 --- a/src/views/User/UserPoints.jsx +++ b/src/views/User/UserPoints.jsx @@ -22,8 +22,8 @@ import { Tabs, Typography, } from '@mui/joy' -import { useContext, useEffect, useState } from 'react' -import { UserContext } from '../../contexts/UserContext.js' +import { useEffect, useState } from 'react' +import { useUserProfile } from '../../queries/UserQueries' import LoadingComponent from '../components/Loading.jsx' import { useChoresHistory } from '../../queries/ChoreQueries.jsx' @@ -47,7 +47,7 @@ const UserPoints = () => { handleLimitChange: handleChoresHistoryLimitChange, } = useChoresHistory(7) - const { userProfile } = useContext(UserContext) + const { data: userProfile } = useUserProfile() const [selectedUser, setSelectedUser] = useState(userProfile?.id) const [circleUsers, setCircleUsers] = useState([]) const [selectedHistory, setSelectedHistory] = useState([])