From 50b4bd747b068c17a05c36e27413730be98a6e4b Mon Sep 17 00:00:00 2001 From: "bastien.ollier@etu.uca.fr" Date: Thu, 19 Jan 2023 16:21:49 +0100 Subject: [PATCH 1/5] regle problemme --- .../Post/DisplayPost/NouveauDisplayPosts.js | 29 ++++---- .../components/Post/PostNouvelleAffichage.js | 68 ++++++++++--------- 2 files changed, 53 insertions(+), 44 deletions(-) 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...

    ; + } }; From 85c9a3f54c2bd1b9e5d5783b1fac44af937101df Mon Sep 17 00:00:00 2001 From: "bastien.ollier@etu.uca.fr" Date: Thu, 19 Jan 2023 17:29:05 +0100 Subject: [PATCH 2/5] css mini profil --- Site Web/client/src/components/MiniProfil.js | 10 +- .../components/UserProfil/SuggestFriends.js | 4 +- Site Web/client/src/pages/Profil.js | 68 +++++--------- Site Web/client/src/pages/SearchBar.js | 94 ++++++++++--------- Site Web/client/src/styles/_settings.scss | 1 - .../src/styles/component/_miniProfil.scss | 21 +++++ Site Web/client/src/styles/index.scss | 3 +- Site Web/client/src/styles/pages/_profil.scss | 9 +- 8 files changed, 109 insertions(+), 101 deletions(-) create mode 100644 Site Web/client/src/styles/component/_miniProfil.scss diff --git a/Site Web/client/src/components/MiniProfil.js b/Site Web/client/src/components/MiniProfil.js index 721561b4..f48f0f58 100644 --- a/Site Web/client/src/components/MiniProfil.js +++ b/Site Web/client/src/components/MiniProfil.js @@ -22,10 +22,12 @@ const MiniProfil = ({uid} ) => { } return ( -
    -
    - - {userData.pseudo} +
    +
    + +
    +
    ); diff --git a/Site Web/client/src/components/UserProfil/SuggestFriends.js b/Site Web/client/src/components/UserProfil/SuggestFriends.js index d4651c7b..2ceee84c 100644 --- a/Site Web/client/src/components/UserProfil/SuggestFriends.js +++ b/Site Web/client/src/components/UserProfil/SuggestFriends.js @@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import { isEmpty } from '../Utils'; import FollowHandler from './FollowHandler'; +import MiniProfil from "../MiniProfil"; const SuggestFriends = () => { const userData = useSelector((state) => state.user.user); @@ -79,8 +80,7 @@ const SuggestFriends = () => { if(user === usersData[i]._id){ return (
    - img -

    {usersData[i].pseudo}

    +
    ); diff --git a/Site Web/client/src/pages/Profil.js b/Site Web/client/src/pages/Profil.js index 4d4632f1..bf6f41f3 100644 --- a/Site Web/client/src/pages/Profil.js +++ b/Site Web/client/src/pages/Profil.js @@ -1,4 +1,4 @@ -import React,{useEffect, useState} from 'react'; +import React, {useContext, useEffect, useState} from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { useParams } from 'react-router-dom' @@ -9,15 +9,19 @@ import PostPersonnels from '../components/UserProfil/NavigationProfil/PostsPerso import DossierPersonnels from '../components/UserProfil/NavigationProfil/DossiersPersonnels'; import PostsLikes from '../components/UserProfil/NavigationProfil/PostsLikes'; import MiniProfil from "../components/MiniProfil"; +import SuggestFriends from "../components/UserProfil/SuggestFriends"; +import {UidContext} from "../components/AppContext"; const Profil = () => { const { uid } = useParams(); const [userData, setUserData] = useState(null); const [followingPopup, setFollowingPopup] = useState(false); + const [uidS, setUidS] = useState(false); const [followerPopup, setFollowerPopup] = useState(false); const [dossierPersonnels,setdossierPersonnels ] = useState(false); const [postPersonnels,setpostPersonnels ] = useState(true); - const [postLikes,setpostLikes ] = useState(false) + const [postLikes,setpostLikes ] = useState(false); + const uidU= useContext(UidContext); useEffect(() => { async function fetchData() { @@ -26,6 +30,9 @@ const Profil = () => { setUserData(data); } fetchData(); + if(uidU === uid){ + setUidS(true); + } }, [uid]); @@ -50,8 +57,8 @@ const Profil = () => { } return ( - <> - +
    + {/*

    Compte créé le : {dateParser(userData.createdAt)}

    @@ -134,8 +141,8 @@ const Profil = () => {
    */} -
    -
    +
    +
    @@ -145,7 +152,7 @@ const Profil = () => { {/*

    suuu

    */}
    - Suivre + + { uidS && Suivre +}
    setFollowingPopup(true)}> @@ -211,7 +218,7 @@ const Profil = () => {
    -
    +
    -
    - {dossierPersonnels &&} - {postPersonnels &&} - {postLikes &&} + {dossierPersonnels &&} + {postPersonnels &&} + {postLikes &&}
    -
    -
    -
    - Vous pourriez suivre -
    -
    -
    - - UtiT - Suivre -
    -
    - - UtiT - Suivre -
    -
    - - UtiT - Suivre -
    -
    - -
    - +
    + {uid && }
    - - -
    -
    - +
    +
    +
    ) }; diff --git a/Site Web/client/src/pages/SearchBar.js b/Site Web/client/src/pages/SearchBar.js index 9eb2c557..b8c21c6c 100644 --- a/Site Web/client/src/pages/SearchBar.js +++ b/Site Web/client/src/pages/SearchBar.js @@ -3,6 +3,7 @@ import { useSelector } from 'react-redux'; import Navbar from '../components/Navbar'; import Post from '../components/Post/Post'; import { isEmpty } from '../components/Utils'; +import MiniProfil from "../components/MiniProfil"; const SearchBar = () => { const [searchValue, setSearchValue] = useState(""); @@ -12,7 +13,6 @@ const SearchBar = () => { const posts = useSelector((state) => state.post.post); const users = useSelector((state) => state.users.users); - const filteredResultsPosts = posts.filter(function(item) { return item.tags.some(function(tag) { return tag.toLowerCase().indexOf(searchValue.toLowerCase()) !== -1; @@ -31,9 +31,9 @@ const SearchBar = () => { console.log("Recherche pour : " + input); if(searchUsers && searchValue !== "") - setSearchResults(filteredResultsUsers); + setSearchResults(filteredResultsUsers); else if(searchPosts && searchValue !== "") - setSearchResults(filteredResultsPosts); + setSearchResults(filteredResultsPosts); } const handleModals = (e) => { @@ -41,54 +41,60 @@ const SearchBar = () => { setSearchUsers(true); setSearchPosts(false); if(searchValue !== "") - setSearchResults(filteredResultsUsers); + setSearchResults(filteredResultsUsers); } else { setSearchPosts(true); setSearchUsers(false); if(searchValue !== "") - setSearchResults(filteredResultsPosts); + setSearchResults(filteredResultsPosts); } }; - return ( -
    - -
    -
    -
    - setSearchValue(e.target.value)} placeholder="Rechercher..." /> - -
    -
    - - { searchUsers && -
      - {searchResults.map((result) => ( -
    • {result.pseudo}
    • - ))} -
    - } - { searchPosts && -
      - {searchResults.length !== 0 && searchResults.map((result) => ( - - ))} -
    - } -
    -
    -
    -
    - ); + try { + return ( +
    + +
    +
    +
    + setSearchValue(e.target.value)} + placeholder="Rechercher..."/> + +
    +
    + + {searchUsers && +
      + {searchResults.map((result) => ( + + ))} +
    + } + {searchPosts && +
      + {searchResults.length !== 0 && searchResults.map((result) => ( + + ))} +
    + } +
    +
    +
    +
    + ); + } + catch (error){ + return

    Loading...

    ; + } }; export default SearchBar; \ No newline at end of file diff --git a/Site Web/client/src/styles/_settings.scss b/Site Web/client/src/styles/_settings.scss index d6033ff7..59598602 100644 --- a/Site Web/client/src/styles/_settings.scss +++ b/Site Web/client/src/styles/_settings.scss @@ -39,6 +39,5 @@ body{ width: 180px; height: 180px; clip-path:circle(50%); - } diff --git a/Site Web/client/src/styles/component/_miniProfil.scss b/Site Web/client/src/styles/component/_miniProfil.scss new file mode 100644 index 00000000..d8fd92df --- /dev/null +++ b/Site Web/client/src/styles/component/_miniProfil.scss @@ -0,0 +1,21 @@ +.miniProfil{ + display: flex; + align-content: start; +} + +.infoMiniProfil{ + margin-left: 10px; +} + +.miniProfilLien{ + +} + +.miniProfilImage{ + + object-fit: cover; + background-size: cover; + width: 25px; + height: 25px; + clip-path:circle(50%); +} \ No newline at end of file diff --git a/Site Web/client/src/styles/index.scss b/Site Web/client/src/styles/index.scss index 37461681..8d5b3679 100644 --- a/Site Web/client/src/styles/index.scss +++ b/Site Web/client/src/styles/index.scss @@ -9,7 +9,8 @@ @import'./component/configurationDuCompte.scss'; @import'./component/politiqueDeConfidentialite'; @import './component/newPoste'; -@import'./component/postNouvelleAffichage'; +@import './component/postNouvelleAffichage'; +@import './component/miniProfil'; @import './pages/searchBar'; diff --git a/Site Web/client/src/styles/pages/_profil.scss b/Site Web/client/src/styles/pages/_profil.scss index 3049b746..f1b2f74a 100644 --- a/Site Web/client/src/styles/pages/_profil.scss +++ b/Site Web/client/src/styles/pages/_profil.scss @@ -313,7 +313,7 @@ margin-top: 1%; .divMenu { margin: 0%; background-color: #cccaca; - width: 75%; + width: 1000px; height: 500px; border-radius: 25px; } @@ -351,14 +351,13 @@ scrollbar-gutter: stable both-edges; } .basDePage { -display: flex; - flex-direction: row ; - justify-content: space-around; + display: flex; + justify-content: space-between; } .recoDiv { -width: 20%; + width: 250px; } .UtiReco { From 7ae197568c91e8a7c20fab5b6dfb7b56a8488d0e Mon Sep 17 00:00:00 2001 From: "bastien.ollier@etu.uca.fr" Date: Thu, 19 Jan 2023 17:32:23 +0100 Subject: [PATCH 3/5] css nom user --- Site Web/client/src/styles/component/_miniProfil.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Site Web/client/src/styles/component/_miniProfil.scss b/Site Web/client/src/styles/component/_miniProfil.scss index d8fd92df..069ef048 100644 --- a/Site Web/client/src/styles/component/_miniProfil.scss +++ b/Site Web/client/src/styles/component/_miniProfil.scss @@ -1,6 +1,6 @@ .miniProfil{ display: flex; - align-content: start; + justify-content: start; } .infoMiniProfil{ @@ -8,6 +8,8 @@ } .miniProfilLien{ + font-weight: bold; + text-decoration : none; } From ac9db645ebadaed8a36a27fbed24ecebabe673c8 Mon Sep 17 00:00:00 2001 From: "bastien.ollier@etu.uca.fr" Date: Thu, 19 Jan 2023 17:37:06 +0100 Subject: [PATCH 4/5] css button add link --- Site Web/client/src/styles/component/_ajoutLien.scss | 2 +- Site Web/client/src/styles/pages/_profil.scss | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Site Web/client/src/styles/component/_ajoutLien.scss b/Site Web/client/src/styles/component/_ajoutLien.scss index 09903901..dcdd2b26 100644 --- a/Site Web/client/src/styles/component/_ajoutLien.scss +++ b/Site Web/client/src/styles/component/_ajoutLien.scss @@ -2,7 +2,7 @@ border: solid black 2px; background-color: beige; border-radius: 10px; - width: 140px; + width: 250px; height: 50px; text-align: center; cursor: pointer; diff --git a/Site Web/client/src/styles/pages/_profil.scss b/Site Web/client/src/styles/pages/_profil.scss index f1b2f74a..69fb79b4 100644 --- a/Site Web/client/src/styles/pages/_profil.scss +++ b/Site Web/client/src/styles/pages/_profil.scss @@ -358,6 +358,7 @@ scrollbar-gutter: stable both-edges; .recoDiv { width: 250px; + margin-top: 10px; } .UtiReco { From 297c64b107fcc623301b41ba09fa90efe7dbae23 Mon Sep 17 00:00:00 2001 From: Noan07 <84435602+Noan07@users.noreply.github.com> Date: Thu, 19 Jan 2023 17:39:11 +0100 Subject: [PATCH 5/5] Connexion --- Site Web/client/src/components/Log/index.js | 7 +++++++ .../src/styles/pages/_homenavigation.scss | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Site Web/client/src/components/Log/index.js b/Site Web/client/src/components/Log/index.js index 828ba032..b42c1c00 100644 --- a/Site Web/client/src/components/Log/index.js +++ b/Site Web/client/src/components/Log/index.js @@ -1,6 +1,7 @@ import React, { useState } from 'react'; import Connexion from './Connexion'; import Inscription from './Inscription'; +import Logo from '../../assets/img/logo.png'; const Log = ( props ) => { const [signUpModal, setSignUpModal] = useState(props.signup); @@ -18,6 +19,12 @@ const Log = ( props ) => { return (
    +
    + Favor +

    Bienvenue!

    +

    "Comment découvrir et partager des sites et des ressources sur internet de manière plus efficace et personnalisée ?"

    +

    +
      diff --git a/Site Web/client/src/styles/pages/_homenavigation.scss b/Site Web/client/src/styles/pages/_homenavigation.scss index 88f06bd8..52a264f8 100644 --- a/Site Web/client/src/styles/pages/_homenavigation.scss +++ b/Site Web/client/src/styles/pages/_homenavigation.scss @@ -52,7 +52,7 @@ flex-direction: row-reverse; justify-content: center; padding-top: 4%; - + padding-left: 400px; } @@ -171,3 +171,18 @@ input[type="submit"]:hover, .buttonTEL:hover{ visibility: hidden; } */ + + +.form-presentation{ + width: 400px; + display: flex; + flex-direction: column; + align-items: center; + height: 100%; + position: fixed; + border-right: 2px solid black; + border-radius: 5px; + p{ + padding-top: 10%; + } +}