diff --git a/containers/react/src/components/Messages/Modal.tsx b/containers/react/src/components/Messages/Modal.tsx index b6552491..944f15d8 100644 --- a/containers/react/src/components/Messages/Modal.tsx +++ b/containers/react/src/components/Messages/Modal.tsx @@ -8,28 +8,12 @@ import api from "../../script/axiosApi.tsx"; import React from "react"; import {User, Conv} from "../../../interfaces.tsx" -const dropIn = { - hidden:{y:"-100vh", - opacity: 0,}, - visible:{y: "0", - opacity: 0, - transotion:{ - duration:0.1, - type:"spring", - damping: 100, - stiffness: 500, - }}, - exit:{y: "100vh", - opacity: 0,}, -}; - interface ModalProps { handleClose: Function, } const Modal = ({handleClose}: ModalProps) => { const [selectTags, setSelectTag] = useState([{ id: 1, selectedOption: ''}]); - const [selectedOptionArray, setSelectedOptionArray] = useState([]); const [users, setUsers] = useState([]); const [user, setUser] = useState(); const [convs, setConvs] = useState([]); @@ -118,8 +102,6 @@ const Modal = ({handleClose}: ModalProps) => { } catch(err) { console.log(err); } - setSelectedOptionArray(selectedOptions); - } return ( diff --git a/containers/react/src/components/Messages/ModalSetting.tsx b/containers/react/src/components/Messages/ModalSetting.tsx index 40e1e713..975139be 100644 --- a/containers/react/src/components/Messages/ModalSetting.tsx +++ b/containers/react/src/components/Messages/ModalSetting.tsx @@ -139,7 +139,7 @@ const ModalSetting = ({ handleClose, convId, socket }: ModalSettingProps) => { const closeMuteAlert = () => setMuteAlert(false); const handleMute = async (e: { key: string; }) => { - if (e.key != "Enter") + if (e.key !== "Enter") return; try { const ret = await api.post("/mute", { convId: convId, username: selectedUser, time: time }) diff --git a/containers/react/src/components/Profile/Win_Loss.tsx b/containers/react/src/components/Profile/Win_Loss.tsx index e8ea4a43..7df9a105 100644 --- a/containers/react/src/components/Profile/Win_Loss.tsx +++ b/containers/react/src/components/Profile/Win_Loss.tsx @@ -1,6 +1,6 @@ import '../../styles/Win_Loss.css' import { User, Matchlog } from "../../../interfaces.tsx" -import React, { useState, useEffect, useRef } from "react"; +import React, { useState, useEffect} from "react"; import { useParams } from 'react-router-dom'; import api from '../../script/axiosApi.tsx'; @@ -9,7 +9,6 @@ function WinLoss() { const [user, setUser] = useState(); const [history, setHistory] = useState([]); const [isLoading, setIsLoading] = useState(true); - const { username } = useParams(); useEffect(()=> { diff --git a/containers/react/src/components/Social/Friend.tsx b/containers/react/src/components/Social/Friend.tsx index a31fd544..6142a5fe 100644 --- a/containers/react/src/components/Social/Friend.tsx +++ b/containers/react/src/components/Social/Friend.tsx @@ -6,7 +6,7 @@ /* By: apommier +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/06/09 08:18:58 by apommier #+# #+# */ -/* Updated: 2023/06/28 17:50:52 by apommier ### ########.fr */ +/* Updated: 2023/06/28 17:59:49 by apommier ### ########.fr */ /* */ /* ************************************************************************** */ @@ -56,7 +56,6 @@ export default function Friend({currentUser}: UserProps) function getStatus(friend: User) { let status = friend.status - let session =friend.sessionNumber let statusColor; if (status === 0) diff --git a/containers/react/src/components/Social/Social.tsx b/containers/react/src/components/Social/Social.tsx index 17826716..20e58fdf 100644 --- a/containers/react/src/components/Social/Social.tsx +++ b/containers/react/src/components/Social/Social.tsx @@ -18,7 +18,6 @@ function Social (){ const tmpFriends = await api.get("/friends") const tmpUser = await api.get("/profile") const tmpInv = await api.get("/inviteRequest") - const pic = await api.post("/getPicture", {username: tmpUser.data.username}) setInvite(tmpInv.data); setUser(tmpUser.data); diff --git a/containers/react/src/pages/QrCode.tsx b/containers/react/src/pages/QrCode.tsx index 54643f57..7f60c3c9 100644 --- a/containers/react/src/pages/QrCode.tsx +++ b/containers/react/src/pages/QrCode.tsx @@ -29,7 +29,6 @@ const qrCode = new QRCodeStyling({ function QrCode () { const ref = useRef(null); - const [user, setUser] = useState(false); const [url, setUrl] = useState(""); const [secret, setSecret] = useState(false); const [code, setCode] = useState(''); @@ -43,7 +42,6 @@ function QrCode () { const getUser = async ()=>{ try{ const tmpUser = await api.get("/profile"); - setUser(tmpUser.data); if (tmpUser.data.otp_verified) { setActivated(true); diff --git a/containers/react/src/pages/canvas.tsx b/containers/react/src/pages/canvas.tsx index 4e55082b..7a72d308 100644 --- a/containers/react/src/pages/canvas.tsx +++ b/containers/react/src/pages/canvas.tsx @@ -11,7 +11,6 @@ interface GameProps { function DrawCanvas(option: number, gameParam: GameProps) { const superpowerModifier = option & 1; // Retrieves the superpower modifier - const obstacleModifier = (option >> 1) & 1; // Retrieves the obstacle modifier const speedModifier = (option >> 2) & 1; // Retrieves the speed modifier function launchGame() @@ -48,7 +47,6 @@ function DrawCanvas(option: number, gameParam: GameProps) { //general canvas let running = true; - const scale = window.devicePixelRatio; canvas.width = canvas.offsetWidth; canvas.height = canvas.offsetHeight; diff --git a/containers/react/src/script/axiosApi.tsx b/containers/react/src/script/axiosApi.tsx index 9cf65274..3c089f71 100644 --- a/containers/react/src/script/axiosApi.tsx +++ b/containers/react/src/script/axiosApi.tsx @@ -1,11 +1,6 @@ import axios from 'axios'; -function getToken() { - const token = localStorage.getItem('token'); - return token; -} - let api = axios.create({ baseURL: 'http://' + process.env.REACT_APP_BASE_URL + '/api', headers: {