Skip to content

Commit

Permalink
added RatingHistory.css for styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank-Gu-81 committed Jan 15, 2025
1 parent 03c3f29 commit 3dc6c1c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
8 changes: 8 additions & 0 deletions src/components/RatingHistory/RatingHistory.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.profile-icon {
width: 80px;
height: 80px;
border-radius: 50%;
background-color: #e0e0e0;
display: inline-block;
margin-bottom: 20px;
}
17 changes: 4 additions & 13 deletions src/components/RatingHistory/RatingHistory.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useState, useEffect } from 'react';
import { Container, Box, Stack } from '@mui/material';
import AppBar from '../AppBar/AppBar';
import NavigationBar from '../NavigationBar/NavigationBar';
import './RatingHistory.css';


function RatingHistory({ userName }) {
Expand All @@ -24,7 +25,6 @@ function RatingHistory({ userName }) {
posts.push({ id: doc.id, ...doc.data() });
}
});
//const filteredPosts = posts.filter(post => post.username === userName?.displayName);
return posts;
} catch (error) {
console.log("Error: ", error);
Expand All @@ -37,29 +37,20 @@ function RatingHistory({ userName }) {
try {
const fetchedPosts = await getPostsFromDB();
setFilteredPost(fetchedPosts);
console.log("Filtered posts: ", fetchedPosts);
// console.log("Filtered posts: ", fetchedPosts);
} catch (error) {
console.error("Error fetching posts: ", error);
}
}
fetchPosts();
}, [userName]); // Add userName as a dependency
}, [userName]); // Add userName as a dependency to prevent it from running infinitely

return (
<div>
<AppBar />
<Container maxWidth="xs" style={{ textAlign: 'center', paddingTop: '20px' }}>
{/* Profile Icon */}
<Box
style={{
width: '80px',
height: '80px',
borderRadius: '50%',
backgroundColor: '#e0e0e0',
display: 'inline-block',
marginBottom: '20px',
}}
>
<Box className="profile-icon">
{/* Profile Name */}
<h1>{userName.displayName}</h1>
{/* Profile Email */}
Expand Down

0 comments on commit 3dc6c1c

Please sign in to comment.