From 83af9593f6fc09b9e11941ed0793317695eceb7a Mon Sep 17 00:00:00 2001 From: Anna Cai Date: Tue, 21 Jan 2025 22:58:46 -0600 Subject: [PATCH] display count for personal posts --- src/App.jsx | 2 +- src/components/Account/Account.jsx | 3 +-- src/components/RatingHistory/RatingHistory.jsx | 9 +-------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 1ae24fe..0de54da 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -113,7 +113,7 @@ function App() { : } /> : } /> - : } /> + : } /> : } /> } /> diff --git a/src/components/Account/Account.jsx b/src/components/Account/Account.jsx index 94aa862..dc2fd57 100644 --- a/src/components/Account/Account.jsx +++ b/src/components/Account/Account.jsx @@ -13,8 +13,7 @@ function Account({ userName, userEmail, profilePic, - filteredPost, - setFilteredPost + filteredPost }) { const navigate = useNavigate(); const [friendCount, setFriendCount] = useState(0); diff --git a/src/components/RatingHistory/RatingHistory.jsx b/src/components/RatingHistory/RatingHistory.jsx index 6add36f..bd0ddaf 100644 --- a/src/components/RatingHistory/RatingHistory.jsx +++ b/src/components/RatingHistory/RatingHistory.jsx @@ -9,8 +9,7 @@ import Avatar from '@mui/material/Avatar'; import { useState, useEffect } from 'react'; -function RatingHistory({ userName, profilePic }) { - const [filteredPost, setFilteredPost] = useState([]); +function RatingHistory({ userName, filteredPost, setFilteredPost}) { const fake_friends = ["Alice", "Bob", "Charlie", "David"]; // Add userName as a dependency to prevent it from running infinitely @@ -44,12 +43,6 @@ function RatingHistory({ userName, profilePic }) { fetchPosts(); }, [userName]); // Add userName as a dependency to prevent it from running infinitely - // print out the posts - useEffect(() => { - console.log(filteredPost); - } - , [filteredPost]); - return (