diff --git a/src/components/Feed/Feed.jsx b/src/components/Feed/Feed.jsx
index 5aa7e8d..d350430 100644
--- a/src/components/Feed/Feed.jsx
+++ b/src/components/Feed/Feed.jsx
@@ -28,6 +28,7 @@ function Feed({friends}) {
const [posts, setPosts] = useState([]);
const [search, setSearch] = useState();
const [filteredPosts, setFilteredPosts] = useState([]);
+ const [tabValue, setTabValue] = React.useState(0);
// useEffect runs every time the component is rendered
useEffect(() => {
@@ -54,11 +55,9 @@ function Feed({friends}) {
setFilteredPosts(posts) // retrieve all if the search bar isn't being used
}
}, [search, posts]); // must define the states that cause re-rendering
-
- const [value, setValue] = React.useState(0);
const handleChange = (event, newValue) => {
- setValue(newValue);
+ setTabValue(newValue);
if (newValue === 0) {
// public
@@ -72,7 +71,7 @@ function Feed({friends}) {
return (
-
+
} />
} />
@@ -86,7 +85,7 @@ function Feed({friends}) {
.slice()
.sort((a, b) => b.date.seconds - a.date.seconds).map((post) =>
)
)
}
diff --git a/src/components/Post/Post.jsx b/src/components/Post/Post.jsx
index 333233c..73ade27 100644
--- a/src/components/Post/Post.jsx
+++ b/src/components/Post/Post.jsx
@@ -37,7 +37,7 @@ function getQuarterChipClass(quarter) {
return "";
}
-function Post({ post, friends }) {
+function Post({ post, friends, postAnonymously }) {
const navigate = useNavigate();
const renderUserStars = (rating) => {
const filledStars = Math.floor(rating);
@@ -64,7 +64,7 @@ function Post({ post, friends }) {
- {post.anonymous ? "Anonymous" : post.username} rated this course
+ {postAnonymously ? "Anonymous" : post.username} rated this course
{renderUserStars(post.rating ?? 0)}
@@ -75,7 +75,7 @@ function Post({ post, friends }) {
{post.title}
- Posted by {post.anonymous ? "Anonymous" : post.username} on {post.date.toDate().toDateString()}
+ Posted by {postAnonymously ? "Anonymous" : post.username} on {post.date.toDate().toDateString()}
{post.body}
diff --git a/src/components/RatingHistory/RatingHistory.jsx b/src/components/RatingHistory/RatingHistory.jsx
index c86e130..6b5c4a2 100644
--- a/src/components/RatingHistory/RatingHistory.jsx
+++ b/src/components/RatingHistory/RatingHistory.jsx
@@ -34,7 +34,7 @@ function RatingHistory({ userName, profilePic, filteredPost }) {
.slice()
.sort((a, b) => b.date.seconds - a.date.seconds).map((post) =>
)
)
}