From 64e296bcb858695e55b960289e6ca696a0239532 Mon Sep 17 00:00:00 2001 From: Darius BERTRAND Date: Fri, 20 Jan 2023 09:19:03 +0100 Subject: [PATCH] reglage bugs --- .../components/Configurations/ConfigurationDuProfil.js | 9 --------- .../src/components/Post/DisplayPost/DiplayPostDossier.js | 7 ++----- .../components/Post/DisplayPost/DisplayPostLikeProfil.js | 3 +-- .../components/Post/DisplayPost/NouveauDisplayPosts.js | 4 ++-- Site Web/client/src/components/Post/DisplayPosts.js | 4 +++- .../UserProfil/NavigationProfil/DossiersPersonnels.js | 4 ++-- .../components/UserProfil/NavigationProfil/PostsLikes.js | 4 ++-- .../UserProfil/NavigationProfil/PostsPersonnels.js | 4 ++-- Site Web/client/src/pages/Profil.js | 6 +++--- 9 files changed, 17 insertions(+), 28 deletions(-) diff --git a/Site Web/client/src/components/Configurations/ConfigurationDuProfil.js b/Site Web/client/src/components/Configurations/ConfigurationDuProfil.js index 77c60d19..efc25d6b 100644 --- a/Site Web/client/src/components/Configurations/ConfigurationDuProfil.js +++ b/Site Web/client/src/components/Configurations/ConfigurationDuProfil.js @@ -120,15 +120,6 @@ const ConfigurationDuProfil = ()=>{ -

Acces au dossiers personnel

-
-
- - -
- -
- {displayAdd && (
diff --git a/Site Web/client/src/components/Post/DisplayPost/DiplayPostDossier.js b/Site Web/client/src/components/Post/DisplayPost/DiplayPostDossier.js index 702b8621..483447d8 100644 --- a/Site Web/client/src/components/Post/DisplayPost/DiplayPostDossier.js +++ b/Site Web/client/src/components/Post/DisplayPost/DiplayPostDossier.js @@ -6,9 +6,8 @@ import { isEmpty } from "../../Utils"; import Post from '../PostNouvelleAffichage'; import { UidContext } from '../../AppContext'; -const DiplayPostDossier = () => { +const DiplayPostDossier = ({uid}) => { const postsData = useSelector((state) => state.post.post); - const uid = useContext(UidContext); const dispatch = useDispatch(); useEffect(() => { dispatch(getPosts()); @@ -21,9 +20,7 @@ const DiplayPostDossier = () => {
    {!isEmpty(postsData) && postsData.map((post) => { - if(post.postedId === uid){ - console.log(post) - console.log("tttt") + if(post.postedId === uid && post.privee === true){ return } })} diff --git a/Site Web/client/src/components/Post/DisplayPost/DisplayPostLikeProfil.js b/Site Web/client/src/components/Post/DisplayPost/DisplayPostLikeProfil.js index dd417457..aa4bdd77 100644 --- a/Site Web/client/src/components/Post/DisplayPost/DisplayPostLikeProfil.js +++ b/Site Web/client/src/components/Post/DisplayPost/DisplayPostLikeProfil.js @@ -6,9 +6,8 @@ import { isEmpty } from "../../Utils"; import Post from '../PostNouvelleAffichage'; import { UidContext } from '../../AppContext'; -const DisplayPostLikeProfil = () => { +const DisplayPostLikeProfil = ({uid}) => { const postsData = useSelector((state) => state.post.post); - const uid = useContext(UidContext); const dispatch = useDispatch(); useEffect(() => { dispatch(getPosts()); diff --git a/Site Web/client/src/components/Post/DisplayPost/NouveauDisplayPosts.js b/Site Web/client/src/components/Post/DisplayPost/NouveauDisplayPosts.js index b28a18af..769eb84c 100644 --- a/Site Web/client/src/components/Post/DisplayPost/NouveauDisplayPosts.js +++ b/Site Web/client/src/components/Post/DisplayPost/NouveauDisplayPosts.js @@ -6,9 +6,8 @@ import { isEmpty } from "../../Utils"; import Post from '../PostNouvelleAffichage'; import { UidContext } from '../../AppContext'; -const NouveauDisplayPosts = () => { +const NouveauDisplayPosts = ({uid}) => { const postsData = useSelector((state) => state.post.post); - const uid = useContext(UidContext); const dispatch = useDispatch(); useEffect(() => { dispatch(getPosts()); @@ -25,6 +24,7 @@ const NouveauDisplayPosts = () => { {!isEmpty(postsData) && postsData.map((post) => { if(post.postedId === uid){ + console.log("test uid post"); return } })} diff --git a/Site Web/client/src/components/Post/DisplayPosts.js b/Site Web/client/src/components/Post/DisplayPosts.js index 9e62b259..250056ac 100644 --- a/Site Web/client/src/components/Post/DisplayPosts.js +++ b/Site Web/client/src/components/Post/DisplayPosts.js @@ -34,9 +34,11 @@ const DisplayPosts = ( {type} ) => { return (
      - {!isEmpty(postsData) && !isEmpty(postsData) && + {!isEmpty(postsData) && postsData.map((post) => { + if(post.publique === true){ return + } })}
    diff --git a/Site Web/client/src/components/UserProfil/NavigationProfil/DossiersPersonnels.js b/Site Web/client/src/components/UserProfil/NavigationProfil/DossiersPersonnels.js index abec1e2f..0f1b441f 100644 --- a/Site Web/client/src/components/UserProfil/NavigationProfil/DossiersPersonnels.js +++ b/Site Web/client/src/components/UserProfil/NavigationProfil/DossiersPersonnels.js @@ -4,10 +4,10 @@ import DiplayPostDossier from "../../Post/DisplayPost/DiplayPostDossier"; -const DossiersPersonnels=()=>{ +const DossiersPersonnels=({uid})=>{ return(
    - +
    ) diff --git a/Site Web/client/src/components/UserProfil/NavigationProfil/PostsLikes.js b/Site Web/client/src/components/UserProfil/NavigationProfil/PostsLikes.js index bfa79115..96fcbff7 100644 --- a/Site Web/client/src/components/UserProfil/NavigationProfil/PostsLikes.js +++ b/Site Web/client/src/components/UserProfil/NavigationProfil/PostsLikes.js @@ -4,13 +4,13 @@ import DisplayPostLikeProfil from "../../Post/DisplayPost/DisplayPostLikeProfil" -const PostLikes=()=>{ +const PostLikes=({uid})=>{ return(
    - +
    ) diff --git a/Site Web/client/src/components/UserProfil/NavigationProfil/PostsPersonnels.js b/Site Web/client/src/components/UserProfil/NavigationProfil/PostsPersonnels.js index 1b412518..f3bbbb10 100644 --- a/Site Web/client/src/components/UserProfil/NavigationProfil/PostsPersonnels.js +++ b/Site Web/client/src/components/UserProfil/NavigationProfil/PostsPersonnels.js @@ -4,11 +4,11 @@ import NouveauDisplayPosts from "../../Post/DisplayPost/NouveauDisplayPosts"; -const PostPersonnels=()=>{ +const PostPersonnels=({uid})=>{ return(
    - +
    ) } diff --git a/Site Web/client/src/pages/Profil.js b/Site Web/client/src/pages/Profil.js index 772e9b6e..832da86a 100644 --- a/Site Web/client/src/pages/Profil.js +++ b/Site Web/client/src/pages/Profil.js @@ -153,9 +153,9 @@ const Profil = () => {
- {dossierPersonnels &&} - {postPersonnels &&} - {postLikes &&} + {dossierPersonnels &&} + {postPersonnels &&} + {postLikes &&}