From 4e415f4c4de38fa7e10d4b7012e8cc7d18ced297 Mon Sep 17 00:00:00 2001 From: Frank-Gu-81 Date: Tue, 21 Jan 2025 21:27:19 -0600 Subject: [PATCH] dont break please don't break... --- src/components/Account/Friends/MyFriends.jsx | 37 +++++++++++++++++++ src/components/Comment/Comment.css | 4 ++ src/components/Comment/Comment.jsx | 3 +- .../RatingHistory/RatingHistory.css | 10 ++++- .../RatingHistory/RatingHistory.jsx | 28 +++++++------- src/{services => utilities}/friendService.js | 2 +- 6 files changed, 66 insertions(+), 18 deletions(-) create mode 100644 src/components/Account/Friends/MyFriends.jsx rename src/{services => utilities}/friendService.js (98%) diff --git a/src/components/Account/Friends/MyFriends.jsx b/src/components/Account/Friends/MyFriends.jsx new file mode 100644 index 0000000..9585182 --- /dev/null +++ b/src/components/Account/Friends/MyFriends.jsx @@ -0,0 +1,37 @@ +import React from 'react'; +import { List, ListItem, ListItemText, Button, Container } from '@mui/material'; +import { removeFriend } from '../../../utilities/friendService'; +import AppBar from '../../AppBar/AppBar'; +import NavigationBar from '../../NavigationBar/NavigationBar'; +import "./Friends.css"; + +function MyFriends({ user, friends, loadFriends }) { + const handleUnfriend = async (friendId) => { + await removeFriend(user.uid, friendId); + await loadFriends(); + }; + + return ( +
+ + +

My Friends

+ + {friends.length === 0 &&

You have no friends yet.

} + {friends.map((friend) => ( + + + + + ))} +
+
+ +
+ ); +} + +export default MyFriends; diff --git a/src/components/Comment/Comment.css b/src/components/Comment/Comment.css index d438362..9c385f5 100644 --- a/src/components/Comment/Comment.css +++ b/src/components/Comment/Comment.css @@ -10,3 +10,7 @@ .comments-list { margin-top: 20px; } + +.comment-container { + margin-top: 80px; +} \ No newline at end of file diff --git a/src/components/Comment/Comment.jsx b/src/components/Comment/Comment.jsx index da948ba..0d6040b 100644 --- a/src/components/Comment/Comment.jsx +++ b/src/components/Comment/Comment.jsx @@ -7,6 +7,7 @@ import AppBar from '../AppBar/AppBar'; import NavigationBar from '../NavigationBar/NavigationBar'; import Post from '../Post/Post'; import { useParams } from 'react-router-dom'; +import './Comment.css'; function Comment({ userName, profilePic }) { const post_id = useParams().post_id; @@ -86,7 +87,7 @@ function Comment({ userName, profilePic }) { return (
- + {/* Comments for {post_id} */} diff --git a/src/components/RatingHistory/RatingHistory.css b/src/components/RatingHistory/RatingHistory.css index e26dcea..2b37fbd 100644 --- a/src/components/RatingHistory/RatingHistory.css +++ b/src/components/RatingHistory/RatingHistory.css @@ -5,6 +5,12 @@ } .rating-history-page { - padding: 3em; - height: 100vh; + padding-bottom: 3em; + margin-top: 2px; + margin-bottom: auto; +} + +.profile-container { + text-align: center; + padding-top: 100px; } \ No newline at end of file diff --git a/src/components/RatingHistory/RatingHistory.jsx b/src/components/RatingHistory/RatingHistory.jsx index 1bc3532..c86a0f5 100644 --- a/src/components/RatingHistory/RatingHistory.jsx +++ b/src/components/RatingHistory/RatingHistory.jsx @@ -14,25 +14,25 @@ function RatingHistory({ userName, profilePic, filteredPost }) { return (
- + - + - - { filteredPost.length === 0 ? - (

Loading posts...

) : - (filteredPost - .slice() - .sort((a, b) => b.date.seconds - a.date.seconds).map((post) => -
- -
) - ) - } -
+ + { filteredPost.length === 0 ? + (

Loading posts...

) : + (filteredPost + .slice() + .sort((a, b) => b.date.seconds - a.date.seconds).map((post) => +
+ +
) + ) + } +
diff --git a/src/services/friendService.js b/src/utilities/friendService.js similarity index 98% rename from src/services/friendService.js rename to src/utilities/friendService.js index fb6874e..733e531 100644 --- a/src/services/friendService.js +++ b/src/utilities/friendService.js @@ -1,4 +1,4 @@ -import { db } from '../utilities/firebase'; +import { db } from './firebase'; import { collection, doc,