diff --git a/Site Web/client/src/components/Post/DisplayPost/NouveauDisplayPosts.js b/Site Web/client/src/components/Post/DisplayPost/NouveauDisplayPosts.js index d928176f..a5555d9d 100644 --- a/Site Web/client/src/components/Post/DisplayPost/NouveauDisplayPosts.js +++ b/Site Web/client/src/components/Post/DisplayPost/NouveauDisplayPosts.js @@ -17,19 +17,24 @@ const NouveauDisplayPosts = () => { if (!postsData) { return

Loading...

; } + try{ + return ( +
+ +
+ ); + } + catch (error){ + return

Loading...

; - return ( -
- -
- ); + } }; export default NouveauDisplayPosts; \ No newline at end of file diff --git a/Site Web/client/src/components/Post/PostNouvelleAffichage.js b/Site Web/client/src/components/Post/PostNouvelleAffichage.js index 2889b0b6..003b58fe 100644 --- a/Site Web/client/src/components/Post/PostNouvelleAffichage.js +++ b/Site Web/client/src/components/Post/PostNouvelleAffichage.js @@ -52,38 +52,42 @@ const PostNouvelleAffichage = ( { post } ) => { if(!isLoading){ return

; } - - return ( -
  • - {isLoading ? ( - - ):( - <> -
    -
    -
    {dateParser(post.createdAt)}
    -
    -
    - -

    {post.message}

    -
    -
    -
    - - {/* */} -
    {post.likers.length}
    -
    -
    - setComments(!comments)}/> -
    {post.comments.length}
    -
    -
    -
    - {comments && } - - ) } -
  • - ); + try { + return ( +
  • + {isLoading ? ( + + ) : ( + <> +
    +
    +
    {dateParser(post.createdAt)}
    +
    +
    + +

    {post.message}

    +
    +
    +
    + + {/* */} +
    {post.likers.length}
    +
    +
    + setComments(!comments)}/> +
    {post.comments.length}
    +
    +
    +
    + {comments && } + + )} +
  • + ); + } + catch (error){ + return

    Loading...

    ; + } };