clean unused var
This commit is contained in:
parent
c5371353f8
commit
6f98aa90e5
@ -8,28 +8,12 @@ import api from "../../script/axiosApi.tsx";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import {User, Conv} from "../../../interfaces.tsx"
|
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 {
|
interface ModalProps {
|
||||||
handleClose: Function,
|
handleClose: Function,
|
||||||
}
|
}
|
||||||
|
|
||||||
const Modal = ({handleClose}: ModalProps) => {
|
const Modal = ({handleClose}: ModalProps) => {
|
||||||
const [selectTags, setSelectTag] = useState([{ id: 1, selectedOption: ''}]);
|
const [selectTags, setSelectTag] = useState([{ id: 1, selectedOption: ''}]);
|
||||||
const [selectedOptionArray, setSelectedOptionArray] = useState<string[]>([]);
|
|
||||||
const [users, setUsers] = useState<User[]>([]);
|
const [users, setUsers] = useState<User[]>([]);
|
||||||
const [user, setUser] = useState<User>();
|
const [user, setUser] = useState<User>();
|
||||||
const [convs, setConvs] = useState<Conv[]>([]);
|
const [convs, setConvs] = useState<Conv[]>([]);
|
||||||
@ -118,8 +102,6 @@ const Modal = ({handleClose}: ModalProps) => {
|
|||||||
} catch(err) {
|
} catch(err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
setSelectedOptionArray(selectedOptions);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -139,7 +139,7 @@ const ModalSetting = ({ handleClose, convId, socket }: ModalSettingProps) => {
|
|||||||
const closeMuteAlert = () => setMuteAlert(false);
|
const closeMuteAlert = () => setMuteAlert(false);
|
||||||
|
|
||||||
const handleMute = async (e: { key: string; }) => {
|
const handleMute = async (e: { key: string; }) => {
|
||||||
if (e.key != "Enter")
|
if (e.key !== "Enter")
|
||||||
return;
|
return;
|
||||||
try {
|
try {
|
||||||
const ret = await api.post("/mute", { convId: convId, username: selectedUser, time: time })
|
const ret = await api.post("/mute", { convId: convId, username: selectedUser, time: time })
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import '../../styles/Win_Loss.css'
|
import '../../styles/Win_Loss.css'
|
||||||
import { User, Matchlog } from "../../../interfaces.tsx"
|
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 { useParams } from 'react-router-dom';
|
||||||
import api from '../../script/axiosApi.tsx';
|
import api from '../../script/axiosApi.tsx';
|
||||||
|
|
||||||
@ -9,7 +9,6 @@ function WinLoss() {
|
|||||||
const [user, setUser] = useState<User>();
|
const [user, setUser] = useState<User>();
|
||||||
const [history, setHistory] = useState([]);
|
const [history, setHistory] = useState([]);
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
|
|
||||||
const { username } = useParams();
|
const { username } = useParams();
|
||||||
|
|
||||||
useEffect(()=> {
|
useEffect(()=> {
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
|
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/06/09 08:18:58 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)
|
function getStatus(friend: User)
|
||||||
{
|
{
|
||||||
let status = friend.status
|
let status = friend.status
|
||||||
let session =friend.sessionNumber
|
|
||||||
let statusColor;
|
let statusColor;
|
||||||
|
|
||||||
if (status === 0)
|
if (status === 0)
|
||||||
|
|||||||
@ -18,7 +18,6 @@ function Social (){
|
|||||||
const tmpFriends = await api.get("/friends")
|
const tmpFriends = await api.get("/friends")
|
||||||
const tmpUser = await api.get("/profile")
|
const tmpUser = await api.get("/profile")
|
||||||
const tmpInv = await api.get("/inviteRequest")
|
const tmpInv = await api.get("/inviteRequest")
|
||||||
const pic = await api.post("/getPicture", {username: tmpUser.data.username})
|
|
||||||
|
|
||||||
setInvite(tmpInv.data);
|
setInvite(tmpInv.data);
|
||||||
setUser(tmpUser.data);
|
setUser(tmpUser.data);
|
||||||
|
|||||||
@ -29,7 +29,6 @@ const qrCode = new QRCodeStyling({
|
|||||||
|
|
||||||
function QrCode () {
|
function QrCode () {
|
||||||
const ref = useRef<HTMLDivElement>(null);
|
const ref = useRef<HTMLDivElement>(null);
|
||||||
const [user, setUser] = useState(false);
|
|
||||||
const [url, setUrl] = useState("");
|
const [url, setUrl] = useState("");
|
||||||
const [secret, setSecret] = useState(false);
|
const [secret, setSecret] = useState(false);
|
||||||
const [code, setCode] = useState('');
|
const [code, setCode] = useState('');
|
||||||
@ -43,7 +42,6 @@ function QrCode () {
|
|||||||
const getUser = async ()=>{
|
const getUser = async ()=>{
|
||||||
try{
|
try{
|
||||||
const tmpUser = await api.get("/profile");
|
const tmpUser = await api.get("/profile");
|
||||||
setUser(tmpUser.data);
|
|
||||||
if (tmpUser.data.otp_verified)
|
if (tmpUser.data.otp_verified)
|
||||||
{
|
{
|
||||||
setActivated(true);
|
setActivated(true);
|
||||||
|
|||||||
@ -11,7 +11,6 @@ interface GameProps {
|
|||||||
function DrawCanvas(option: number, gameParam: GameProps) {
|
function DrawCanvas(option: number, gameParam: GameProps) {
|
||||||
|
|
||||||
const superpowerModifier = option & 1; // Retrieves the superpower modifier
|
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
|
const speedModifier = (option >> 2) & 1; // Retrieves the speed modifier
|
||||||
|
|
||||||
function launchGame()
|
function launchGame()
|
||||||
@ -48,7 +47,6 @@ function DrawCanvas(option: number, gameParam: GameProps) {
|
|||||||
|
|
||||||
//general canvas
|
//general canvas
|
||||||
let running = true;
|
let running = true;
|
||||||
const scale = window.devicePixelRatio;
|
|
||||||
canvas.width = canvas.offsetWidth;
|
canvas.width = canvas.offsetWidth;
|
||||||
canvas.height = canvas.offsetHeight;
|
canvas.height = canvas.offsetHeight;
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,6 @@
|
|||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
function getToken() {
|
|
||||||
const token = localStorage.getItem('token');
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
let api = axios.create({
|
let api = axios.create({
|
||||||
baseURL: 'http://' + process.env.REACT_APP_BASE_URL + '/api',
|
baseURL: 'http://' + process.env.REACT_APP_BASE_URL + '/api',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user