warning sidebar fixed warning Win_Loss fixed modif bouton edit_name
This commit is contained in:
parent
a7d2917f91
commit
37e500f9d8
15026
containers/react/package-lock.json
generated
15026
containers/react/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -17,7 +17,7 @@
|
|||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"socket.io-client": "^4.6.1",
|
"socket.io-client": "^4.6.1",
|
||||||
"styled-components": "^5.3.10",
|
"styled-components": "^5.3.10",
|
||||||
"typescript": "^5.0.4",
|
"typescript": "^3.2.1",
|
||||||
"web-vitals": "^2.1.4"
|
"web-vitals": "^2.1.4"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -2,29 +2,36 @@ export const DBWinLoss = [
|
|||||||
{
|
{
|
||||||
title: 'Victory',
|
title: 'Victory',
|
||||||
score: '10 - 6',
|
score: '10 - 6',
|
||||||
|
opponent: 'chef bandit'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Defeat',
|
title: 'Defeat',
|
||||||
score: '9 - 10',
|
score: '9 - 10',
|
||||||
|
opponent: 'ex tueur'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Victory',
|
title: 'Victory',
|
||||||
score: '10 - 0',
|
score: '10 - 0',
|
||||||
|
opponent: 'tueur'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Victory',
|
title: 'Victory',
|
||||||
score: '10 - 9',
|
score: '10 - 9',
|
||||||
|
opponent: 'boulanger'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Defeat',
|
title: 'Defeat',
|
||||||
score: '3 - 10',
|
score: '3 - 10',
|
||||||
|
opponent: 'charcutier'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Deafet',
|
title: 'Deafet',
|
||||||
score: '9 - 10',
|
score: '9 - 10',
|
||||||
|
opponent: 'preach'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Victory',
|
title: 'Victory',
|
||||||
score: '10 - 9',
|
score: '10 - 9',
|
||||||
|
opponent: 'aba'
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@ -16,6 +16,7 @@ import SuccessToken from '../script/tokenSuccess'
|
|||||||
|
|
||||||
import DoubleAuth from "../pages/2fa.js";
|
import DoubleAuth from "../pages/2fa.js";
|
||||||
import Game from "../pages/Game.jsx";
|
import Game from "../pages/Game.jsx";
|
||||||
|
import Social from "../pages/Social.jsx";
|
||||||
|
|
||||||
function AnimatedRoute () {
|
function AnimatedRoute () {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
@ -27,6 +28,7 @@ function AnimatedRoute () {
|
|||||||
<Route exact path="/profile" element={<Home/>}/>
|
<Route exact path="/profile" element={<Home/>}/>
|
||||||
|
|
||||||
<Route exact path="/2fa" element={<DoubleAuth/>}/>
|
<Route exact path="/2fa" element={<DoubleAuth/>}/>
|
||||||
|
<Route exact path="/Social" element={<Social/>}/>
|
||||||
|
|
||||||
<Route exact path="/token" element={<SuccessToken />}/>
|
<Route exact path="/token" element={<SuccessToken />}/>
|
||||||
<Route path="/game" element={<PlayButton />}/>
|
<Route path="/game" element={<PlayButton />}/>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import {motion} from "framer-motion"
|
import {motion} from "framer-motion"
|
||||||
// import Backdrop from "./Sidebar/Backdrop"
|
// import Backdrop from "../Sidebar/Backdrop"
|
||||||
import {Link} from 'react-router-dom';
|
import {Link} from 'react-router-dom';
|
||||||
import { UserProfile } from "../../DataBase/DataUserProfile";
|
import { UserProfile } from "../../DataBase/DataUserProfile";
|
||||||
import {useState} from 'react';
|
import {useState} from 'react';
|
||||||
@ -30,6 +30,7 @@ const ModalEdit = ({ handleClose }) => {
|
|||||||
{
|
{
|
||||||
setUserName (e.target.value);
|
setUserName (e.target.value);
|
||||||
}
|
}
|
||||||
|
void(handleClose);
|
||||||
return (
|
return (
|
||||||
// <Backdrop onClick={handleClose}>
|
// <Backdrop onClick={handleClose}>
|
||||||
<motion.div
|
<motion.div
|
||||||
@ -40,9 +41,11 @@ const ModalEdit = ({ handleClose }) => {
|
|||||||
exit="exit">
|
exit="exit">
|
||||||
<h2>Type your new name</h2>
|
<h2>Type your new name</h2>
|
||||||
<input className="text" type="text" value={username} onChange={handler} handleClose/>
|
<input className="text" type="text" value={username} onChange={handler} handleClose/>
|
||||||
|
<div onClick={handleClose}>
|
||||||
<div onClick={() => {UserProfile.UserName = username;}}>
|
<div onClick={() => {UserProfile.UserName = username;}}>
|
||||||
<Link className="button">change</Link>
|
<Link className="button">change</Link>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
// </Backdrop>
|
// </Backdrop>
|
||||||
|
|
||||||
|
|||||||
@ -52,11 +52,11 @@ function WinLoss() {
|
|||||||
<div className='scroll'>
|
<div className='scroll'>
|
||||||
{DBWinLoss.map((item, index) => {
|
{DBWinLoss.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
<div className='elements'>
|
<div key={index} className='elements'>
|
||||||
<li key={index}>
|
<li key={index}>
|
||||||
<h4 className='content'>{item.title}</h4>
|
<h4 className='content'>{item.title}</h4>
|
||||||
<div className='content2nd'>
|
<div className='content2nd'>
|
||||||
<h4 className='me'>{UserProfile.UserName}</h4> <h4 className='score'>{item.score} {item.openent}</h4>
|
<h4 className='me'>{UserProfile.UserName}</h4> <h4 className='score'>{item.score}</h4> <h4 className="opponent">{item.opponent}</h4>
|
||||||
</div>
|
</div>
|
||||||
{/* <h4 className='content'>{item.openent}</h4> */}
|
{/* <h4 className='content'>{item.openent}</h4> */}
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@ -5,9 +5,9 @@ const Backdrop = ({ children, onClick }) => {
|
|||||||
return (
|
return (
|
||||||
<motion.div className="backdrop"
|
<motion.div className="backdrop"
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
initial={{ opacity: 0}}
|
initial={{ opacity: -1}}
|
||||||
animate={{ opacity: 1}}
|
animate={{ opacity: 1}}
|
||||||
exit={{ opacity: 0}}>
|
exit={{ opacity: -1}}>
|
||||||
{children}
|
{children}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -58,8 +58,7 @@ const Modal = ({ handleClose }) => {
|
|||||||
<ul className='nav-menu-items'>
|
<ul className='nav-menu-items'>
|
||||||
{SidebarData.map((item, index) => {
|
{SidebarData.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
<motion.div whileHover={{scale: 1.1}}
|
<motion.div key={index} whileHover={{scale: 1.1}}>
|
||||||
className>
|
|
||||||
<li key={index} className={item.cName}>
|
<li key={index} className={item.cName}>
|
||||||
<Link to={item.path}>
|
<Link to={item.path}>
|
||||||
{item.icon}
|
{item.icon}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ export const SidebarData = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Social',
|
title: 'Social',
|
||||||
path: '/team',
|
path: '/social',
|
||||||
icon: <IoIcons.IoMdPeople />,
|
icon: <IoIcons.IoMdPeople />,
|
||||||
cName: 'nav-text'
|
cName: 'nav-text'
|
||||||
},
|
},
|
||||||
|
|||||||
@ -4,26 +4,54 @@ import '../styles/Profile.css'
|
|||||||
import DefaultPicture from "../assets/profile.jpg";
|
import DefaultPicture from "../assets/profile.jpg";
|
||||||
import WinLoss from "../components/Profile/Win_Loss";
|
import WinLoss from "../components/Profile/Win_Loss";
|
||||||
import { motion, AnimatePresence } from 'framer-motion'
|
import { motion, AnimatePresence } from 'framer-motion'
|
||||||
import { AiFillEdit } from 'react-icons/ai'
|
// import { AiFillEdit } from 'react-icons/ai'
|
||||||
|
// import { GrClose } from 'react-icons/gr'
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import ModalEdit from "../components/Profile/EditName";
|
import ModalEdit from "../components/Profile/EditName";
|
||||||
import {AiOutlineHistory} from 'react-icons/ai'
|
import {AiOutlineHistory} from 'react-icons/ai'
|
||||||
// import { Link } from "react-router-dom";
|
// import { Link } from "react-router-dom";
|
||||||
import {UserProfile} from "../DataBase/DataUserProfile";
|
import {UserProfile} from "../DataBase/DataUserProfile";
|
||||||
|
// import axios from "axios";
|
||||||
|
import api from '../script/axiosApi';
|
||||||
|
import { CgEditMarkup } from 'react-icons/cg'
|
||||||
|
import { IoCloseCircleOutline } from "react-icons/io5";
|
||||||
|
|
||||||
|
|
||||||
|
// axios.get("http://localhost/api")
|
||||||
|
// .then((response) => {
|
||||||
|
// response = response.json()
|
||||||
|
// response.then((result) => {
|
||||||
|
// console.log(result)
|
||||||
|
// console.log("ceci est un test")
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
|
||||||
function Profile () {
|
function Profile () {
|
||||||
const [modalOpen, setModalOpen] = useState(false);
|
const [modalOpen, setModalOpen] = useState(false);
|
||||||
const close = () => setModalOpen(false);
|
const close = () => setModalOpen(false);
|
||||||
const open = () => setModalOpen(true);
|
const open = () => setModalOpen(true);
|
||||||
|
|
||||||
|
const getConv = async ()=>{
|
||||||
|
try{
|
||||||
|
const convs = await api.get("/profile")
|
||||||
|
// const tmpUser = await api.get("/profile")
|
||||||
|
console.log(convs.data);
|
||||||
|
// setUser(tmpUser);
|
||||||
|
// setConversation(convs.data);
|
||||||
|
}
|
||||||
|
catch(err){
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
getConv();
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<div className="profile">
|
<div className="profile">
|
||||||
<img className="profile-pic" src={DefaultPicture} alt="Profile pic" />
|
<img className="profile-pic" src={DefaultPicture} alt="Profile pic" />
|
||||||
<h1>{UserProfile.UserName}</h1>
|
<h1>{UserProfile.UserName}</h1>
|
||||||
<motion.div onClick={() => (modalOpen ? close() : open())}>
|
<motion.div onClick={() => (modalOpen ? close() : open())}>
|
||||||
<Link to="#" className="edit_name">
|
<Link to="#" className="edit_name">
|
||||||
<AiFillEdit/>
|
{modalOpen === true ? <IoCloseCircleOutline/> : <CgEditMarkup/>}
|
||||||
</Link>
|
</Link>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
<AnimatePresence
|
<AnimatePresence
|
||||||
@ -39,15 +67,15 @@ function Home () {
|
|||||||
const [move, setmove ] = useState(false);
|
const [move, setmove ] = useState(false);
|
||||||
return (
|
return (
|
||||||
<motion.div className="page"
|
<motion.div className="page"
|
||||||
initial={{opacity: 0}}
|
initial={{opacity: -1}}
|
||||||
animate={{opacity: 1}}
|
animate={{opacity: 1}}
|
||||||
exit={{opacity: 0}}>
|
exit={{opacity: -1}}>
|
||||||
<div className="home">
|
<div className="home">
|
||||||
<motion.div animate={{x: move ? -200: 170}}
|
<motion.div animate={{x: move ? -200: 170}}
|
||||||
transition={{type: "tween", duration: 0.5}}>
|
transition={{type: "tween", duration: 0.5}}>
|
||||||
<Profile/>
|
<Profile/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
<motion.div animate={{opacity: !move ? 0 : 1}}>
|
<motion.div animate={{opacity: !move ? -1 : 1}}>
|
||||||
<WinLoss/>
|
<WinLoss/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
9
containers/react/src/pages/Social.jsx
Normal file
9
containers/react/src/pages/Social.jsx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
function Social (){
|
||||||
|
return (
|
||||||
|
<div>je suis la partie social</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Social
|
||||||
@ -1,6 +1,6 @@
|
|||||||
.tab{
|
.tab{
|
||||||
display: flex;
|
/* display: flex; */
|
||||||
flex-direction: column;
|
/* flex-direction: column; */
|
||||||
/* background-color: red; */
|
/* background-color: red; */
|
||||||
height: 70vh;
|
height: 70vh;
|
||||||
/* padding: 15px; */
|
/* padding: 15px; */
|
||||||
@ -16,6 +16,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.elements {
|
.elements {
|
||||||
|
/* display: flex; */
|
||||||
border-width:1px;
|
border-width:1px;
|
||||||
border-style:solid;
|
border-style:solid;
|
||||||
/* background-color: #5843e4; */
|
/* background-color: #5843e4; */
|
||||||
@ -34,31 +35,34 @@
|
|||||||
color: white;
|
color: white;
|
||||||
/* font-size: 22px; */
|
/* font-size: 22px; */
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
display: flex;
|
/* display: flex; */
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content2nd {
|
.content2nd {
|
||||||
|
display:inline;
|
||||||
|
flex-direction: row;
|
||||||
color: white;
|
color: white;
|
||||||
/* font-size: 22px; */
|
/* font-size: 22px; */
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
text-align: justify;
|
/* text-align: justify; */
|
||||||
/* margin-bottom: 5px; */
|
/* margin-bottom: 5px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.me {
|
.me {
|
||||||
text-align: start;
|
text-align: start;
|
||||||
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.score {
|
.score {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.oponent {
|
.opponent {
|
||||||
align-items: flex-end;
|
text-align: end;
|
||||||
|
margin-right:10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div::-webkit-scrollbar {
|
div::-webkit-scrollbar {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user