Skip to content

Commit

Permalink
Merge pull request #72 from Dreallers/avatar
Browse files Browse the repository at this point in the history
Avatar
  • Loading branch information
Dreallers authored Jan 24, 2024
2 parents 533b4bd + 317240f commit cc17e2d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
28 changes: 26 additions & 2 deletions frontend/src/components/CommentsSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,30 @@ function CommentsSection({ filmId, user }) {
<div className="FrameContainer">
<div className="Frame1">
<p className="CommentText">{comment.content}</p>
{user.id === comment.userId && (
<div className="CommentActionButtons">
<button
type="button"
className="EditButton"
onClick={() => handleEditComment(comment.id)}
>
<img
src="/src/assets/icons/modifier.png"
alt="Modifier"
/>
</button>
<button
type="button"
className="DeleteButton"
onClick={() => handleDeleteComment(comment.id)}
>
<img
src="/src/assets/icons/supprimer.png"
alt="Supprimer"
/>
</button>
</div>
)}
</div>
<div className="CommentDateContainer">
<h6 className="CommentDate">{formattedDate}</h6>
Expand Down Expand Up @@ -283,7 +307,7 @@ function CommentsSection({ filmId, user }) {
/>
</button>
</div>
{/* <div className="UserInfo">
<div className="UserInfo">
<img
alt="avatar"
className="Avatar2"
Expand All @@ -294,7 +318,7 @@ function CommentsSection({ filmId, user }) {
}
/>
<h6 className="Username">{user.name}</h6>
</div> */}
</div>
</div>
</div>
</section>
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/FreeMovie.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { useParams, NavLink, useNavigate, useLocation } from "react-router-dom";
import PropTypes from "prop-types";
import axios from "axios";
import { useUser } from "../contexts/UserContext";
// eslint-disable-next-line import/no-unresolved
import CommentsSection from "./CommentsSection.js";
import CommentsSection from "./CommentsSection";

function FreeMovie({ movie }) {
const navigate = useNavigate();
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Inscription.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function Inscription() {
// const { updateUser, user: connectedUser } = useUser();
const [showModal, setShowModal] = useState(false);
// const navigate = useNavigate();

// supprimer commentaire ;
const toggleModal = () => {
setShowModal(!showModal);
};
Expand Down

0 comments on commit cc17e2d

Please sign in to comment.