Skip to content

Commit

Permalink
centered aligned ratinghistory profile info
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank-Gu-81 committed Jan 15, 2025
1 parent 3ff5377 commit 17d22ba
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
17 changes: 14 additions & 3 deletions src/components/RatingHistory/RatingHistory.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
height: 80px;
border-radius: 50%;
background-color: #e0e0e0;
display: inline-block;
margin-bottom: 20px;
}
margin: 0 auto 20px auto; /* Center horizontally and add bottom margin */
}

.profile-text {
display: flex;
flex-direction: column;
align-items: center; /* Center children horizontally */
justify-content: center;
}

.profile-name-email {
margin: 5px 0; /* Add vertical spacing */
text-align: center; /* Ensure text is centered */
}
16 changes: 9 additions & 7 deletions src/components/RatingHistory/RatingHistory.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ function RatingHistory({ userName }) {
const querySnapshot = await getDocs(collection(db, "posts"));
const posts = [];
querySnapshot.forEach((doc) => {
// console.log("doc status before pushing: ", doc.data());
// console.log("username: ", doc.data().username);
// console.log("displayName: ", userName.displayName);
if (doc.data().username === userName?.displayName){
posts.push({ id: doc.id, ...doc.data() });
}
Expand Down Expand Up @@ -51,13 +48,18 @@ function RatingHistory({ userName }) {
<Container maxWidth="xs" style={{ textAlign: 'center', paddingTop: '20px' }}>
{/* Profile Icon */}
<Box className="profile-icon">
{/* Profile Name */}
<h1>{userName.displayName}</h1>
{/* Profile Email */}
<p>{userName.email}</p>

{/* Profile Name and Email */}
<Box className="profile-text">
<h1 className="profile-name-email">{userName.displayName}</h1>
<p className="profile-name-email">{userName.email}</p>
</Box>

</Box>
<br />
</Container>


<Container maxWidth="sm">
<Box paddingBottom="30px">
<Stack spacing={3}>
Expand Down

0 comments on commit 17d22ba

Please sign in to comment.