diff --git a/Site Web/client/src/components/Post/Comment.js b/Site Web/client/src/components/Post/Comment.js index b9a3b727..0e000ec3 100644 --- a/Site Web/client/src/components/Post/Comment.js +++ b/Site Web/client/src/components/Post/Comment.js @@ -4,6 +4,9 @@ import { addComment, getPosts } from '../../actions/post.actions'; import FollowHandler from '../UserProfil/FollowHandler'; import { isEmpty, timestampParser } from '../Utils'; import ActionComment from './ActionComment'; +import MiniProfil from "../MiniProfil"; + + const Comment = ({ post }) => { const [message, setMessage] = useState(""); @@ -27,36 +30,22 @@ const Comment = ({ post }) => { return (
- { - if (user._id === comment.commenterId) return user.picture; - else return null; - }) - .join("") - } - alt="commenter-pic" - /> +
-

{comment.commenterPseudo}

- {comment.commenterId !== userData._id && ( - - )}
{timestampParser(comment.timestamp)}
diff --git a/Site Web/client/src/components/Post/DisplayPost/DiplayPostDossier.js b/Site Web/client/src/components/Post/DisplayPost/DiplayPostDossier.js index 30bbe569..702b8621 100644 --- a/Site Web/client/src/components/Post/DisplayPost/DiplayPostDossier.js +++ b/Site Web/client/src/components/Post/DisplayPost/DiplayPostDossier.js @@ -13,14 +13,17 @@ const DiplayPostDossier = () => { useEffect(() => { dispatch(getPosts()); },[dispatch]) - + console.log("datados"); + console.log(postsData); return (
    - {!isEmpty(postsData[0]) && + {!isEmpty(postsData) && postsData.map((post) => { if(post.postedId === uid){ + console.log(post) + console.log("tttt") return } })} diff --git a/Site Web/client/src/components/Post/DisplayPost/DisplayPostLikeProfil.js b/Site Web/client/src/components/Post/DisplayPost/DisplayPostLikeProfil.js index 60b6f9fa..af9debbd 100644 --- a/Site Web/client/src/components/Post/DisplayPost/DisplayPostLikeProfil.js +++ b/Site Web/client/src/components/Post/DisplayPost/DisplayPostLikeProfil.js @@ -13,7 +13,8 @@ const DisplayPostLikeProfil = () => { useEffect(() => { dispatch(getPosts()); },[dispatch]) - + console.log("datapost like"); + console.log(postsData); return (
    diff --git a/Site Web/client/src/components/Post/DisplayPost/NouveauDisplayPosts.js b/Site Web/client/src/components/Post/DisplayPost/NouveauDisplayPosts.js index d928176f..e01197d7 100644 --- a/Site Web/client/src/components/Post/DisplayPost/NouveauDisplayPosts.js +++ b/Site Web/client/src/components/Post/DisplayPost/NouveauDisplayPosts.js @@ -13,7 +13,8 @@ const NouveauDisplayPosts = () => { useEffect(() => { dispatch(getPosts()); },[dispatch]) - + console.log("datapost"); + console.log(postsData); if (!postsData) { return

    Loading...

    ; } diff --git a/Site Web/client/src/components/Post/PostNouvelleAffichage.js b/Site Web/client/src/components/Post/PostNouvelleAffichage.js index 2889b0b6..db02316b 100644 --- a/Site Web/client/src/components/Post/PostNouvelleAffichage.js +++ b/Site Web/client/src/components/Post/PostNouvelleAffichage.js @@ -49,9 +49,6 @@ const PostNouvelleAffichage = ( { post } ) => { !isEmpty(usersData[0]) && setIsLoading(false) }) - if(!isLoading){ - return

    ; - } return (
  • diff --git a/Site Web/client/src/components/UserProfil/NavigationProfil/DossiersPersonnels.js b/Site Web/client/src/components/UserProfil/NavigationProfil/DossiersPersonnels.js index f1b7b7fd..abec1e2f 100644 --- a/Site Web/client/src/components/UserProfil/NavigationProfil/DossiersPersonnels.js +++ b/Site Web/client/src/components/UserProfil/NavigationProfil/DossiersPersonnels.js @@ -5,7 +5,6 @@ import DiplayPostDossier from "../../Post/DisplayPost/DiplayPostDossier"; const DossiersPersonnels=()=>{ - return(
    diff --git a/Site Web/client/src/pages/Profil.js b/Site Web/client/src/pages/Profil.js index 4d4632f1..7d578a18 100644 --- a/Site Web/client/src/pages/Profil.js +++ b/Site Web/client/src/pages/Profil.js @@ -27,7 +27,7 @@ const Profil = () => { } fetchData(); }, [uid]); - + const handleModals = (e) => { if (e.target.id === "DossierPersonnels") { diff --git a/Site Web/client/src/reducers/post.reducer.js b/Site Web/client/src/reducers/post.reducer.js index 664c056d..2c3194f8 100644 --- a/Site Web/client/src/reducers/post.reducer.js +++ b/Site Web/client/src/reducers/post.reducer.js @@ -3,8 +3,7 @@ import { createSlice } from "@reduxjs/toolkit"; export const postSlice = createSlice({ name: "post", initialState: { - post : { - }, + post : null, }, reducers: { setPostData: (state,action) => {