Skip to content

Commit

Permalink
refactor: integrate useAuth hook in user profile view
Browse files Browse the repository at this point in the history
Updated user-profile-view to use the useAuth hook for better state management and clean up the useLazyProfile hook usage.
- Imported useAuth hook to manage selectedProfile state.
- Removed redundant data fetching from useLazyProfile hook.
  • Loading branch information
cswni committed Nov 5, 2024
1 parent 39e577a commit b15873b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sections/user/view/user-profile-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import ProfileFollowing from '../profile-following';
import ProfileHeader from '../profile-header';
import Label from '../../../components/label';
import ProfileCollected from '../profile-collected';
import {useAuth} from "@src/hooks/use-auth.ts";

// ----------------------------------------------------------------------

Expand All @@ -30,7 +31,8 @@ const UserProfileView = ({ id }: any) => {
const [currentTab, setCurrentTab] = useState('publications');
const settings = useSettingsContext();

const { called, data: profile, execute } = useLazyProfile();
const { called, execute } = useLazyProfile();
const { selectedProfile: profile } = useAuth();

const { data: publications } = usePublications({
where: {
Expand Down

0 comments on commit b15873b

Please sign in to comment.