removing unused vars
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Antoine M 2024-09-12 12:40:54 +02:00
parent ffce318131
commit a7d644e787
16 changed files with 24 additions and 37 deletions

View File

@ -17,7 +17,7 @@ import Warning from "./pages/Warning.jsx";
import { useLocation, Routes, Route } from "react-router-dom";
import { AnimatePresence } from "framer-motion";
import React, { useEffect, useRef } from "react";
import React, { useEffect } from "react";
function App() {
const location = useLocation();

View File

@ -1,5 +1,5 @@
import React from "react";
import { useLocation, useHistory } from "react-router-dom";
import { useLocation } from "react-router-dom";
import { motion } from "framer-motion";
export default function AnimatedPage({ children, className }) {

View File

@ -1,4 +1,4 @@
import React, { useEffect } from "react";
import React from "react";
import Modal from "../../components/ui/Modal.jsx";
import cookiesModalCover from "../../assets/img/illustrations/cookies-modal-cover.svg";
import { Link } from "react-router-dom";

View File

@ -1,13 +1,10 @@
import React, { useEffect, useState } from "react";
import GameObjects from "./GameObjects";
import { useGame } from "../../hooks/useGame";
import { postWordpressStatisticsData, useWordpressCustomData } from "../../services/WordpressFetchData.js";
import { useWordpressCustomData } from "../../services/WordpressFetchData.js";
import Score from "../../components/game/Score.jsx";
import Timer from "../../components/game/Timer.jsx";
import Help from "../../components/game/Help.jsx";
import SoundControl from "../../components/game/SoundControl.jsx";
import ExtraControls from "../../components/game/ExtraControls.jsx";
import { useUser } from "../../hooks/useUser.jsx";
import Loading from "../../components/animations/Loading.jsx";
export default function GameContainer({ gameId }) {
@ -16,8 +13,7 @@ export default function GameContainer({ gameId }) {
const [isDragging, setIsDragging] = useState(false);
const [startX, setStartX] = useState(0);
const { answers, contextGameDatas, setContextGameDatas, isGameComplete, score } = useGame();
const { language, country } = useUser();
const { contextGameDatas, setContextGameDatas, isGameComplete, score } = useGame();
useEffect(() => {
if (!gameDatas || gameDatas.error) return;
@ -55,7 +51,7 @@ export default function GameContainer({ gameId }) {
const gameBackgroundUrl = contextGameDatas.gameBlockDatas.attrs.coverUrl;
const blocks = contextGameDatas.gameBlockDatas.innerBlocks;
return (
<>
{/* <ExtraControls /> */}

View File

@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react";
import useSound from "use-sound";
import React, { useState } from "react";
// import useSound from "use-sound";
import chantierAtmopshere from "../../assets/sounds/chantier_1.mp3";
import soundControlIcon from "../../assets/img/icons/sound-control-icon.svg";
export default function SoundControl() {

View File

@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react";
import React, { useEffect } from "react";
import clock from "../../assets/img/illustrations/clock.svg";
import { useGame } from "../../hooks/useGame";
import { formatCurrentTime } from "../../utils/gameFunctions";

View File

@ -24,7 +24,7 @@ export default function ResultsModals({ resultsDatas }) {
if (!resultsDatas) return navigate("/home");
const { gameStats, contextGameDatas } = resultsDatas;
const { gameStats } = resultsDatas;
function goRating() {
setIsModalOpen(false);

View File

@ -58,7 +58,10 @@ export default function Footer() {
</li>
<li className='made_by'>
Web & graphic design by{" "}
<a target='_blank' href='https://deligraph.com/'>
<a
target='_blank'
rel='noreferrer'
href='https://deligraph.com/'>
Deligraph
</a>
</li>

View File

@ -6,7 +6,6 @@ export default function LanguageSelect() {
const [isSubmenuOpen, setIsSubmenuOpen] = useState(false);
if (!screensTranslations || !screensTranslations.ui) return <p>loading translations</p>;
const currentUiTranslations = screensTranslations.ui;
function handleShowHideSubmenu() {
setIsSubmenuOpen(!isSubmenuOpen);

View File

@ -1,4 +1,4 @@
import { Link, NavLink } from "react-router-dom";
import { Link } from "react-router-dom";
import { useLocation } from "react-router-dom";
import { useUser } from "../../hooks/useUser";
import LanguageSelect from "./LanguageSelect";
@ -11,7 +11,7 @@ import Loading from "../animations/Loading";
export default function Nav() {
let location = useLocation();
const { language, screensTranslations } = useUser();
const { screensTranslations } = useUser();
const [isMenuOpen, setIsMenuOpen] = useState(false);
@ -44,7 +44,7 @@ export default function Nav() {
return (
<nav className='main-menu'>
{location && location.pathname != "/Home" ? <Logo /> : null}
{location && location.pathname !== "/Home" ? <Logo /> : null}
<LanguageSelect />
<button
title={uiScreenTranslations.openMenu}

View File

@ -1,5 +1,5 @@
import { createContext, useContext, useEffect, useState } from "react";
import chantierAtmopshere from "../assets/sounds/chantier_1.mp3";
import { createContext, useEffect, useState } from "react";
// import chantierAtmopshere from "../assets/sounds/chantier_1.mp3";
import GameAnswerExplanation from "../components/game/GameAnswerExplanation.jsx";
import { useUser } from "../hooks/useUser.jsx";
import { calculateScore } from "../utils/gameFunctions.js";

View File

@ -3,12 +3,8 @@ import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import { UserContextProvider } from "./context/UserContext.js";
import { BrowserRouter, Route, Routes, useLocation } from "react-router-dom";
import { AnimatePresence } from "framer-motion";
import Home from "./pages/Home.jsx";
import Profile from "./pages/Profile.jsx";
import { BrowserRouter } from "react-router-dom";
import { ErrorBoundary } from "react-error-boundary";
// import { ErrorBoundary } from "./components/ErrorBoundary.jsx";
const root = ReactDOM.createRoot(document.getElementById("root"));

View File

@ -11,7 +11,7 @@ export default function Country() {
const navigate = useNavigate();
const location = useLocation();
const { language, screensTranslations } = useUser();
const { screensTranslations } = useUser();
if (!screensTranslations || !screensTranslations.country) return <p>loading</p>;
const currentScreenTranslations = screensTranslations.country;

View File

@ -2,14 +2,11 @@ import React from "react";
import Nav from "../components/ui/Nav";
import AnimatedPage from "../components/AnimatedPage";
import { useUser } from "../hooks/useUser";
import { useLocation } from "react-router-dom";
import ResultsModals from "../components/results/ResultsModals";
import { useNavigate } from "react-router-dom";
export default function Results() {
// const { language, screenTranslations } = useUser();
// if (!screenTranslations) return <p>loading</p>;
let location = useLocation();
const navigate = useNavigate();

View File

@ -1,13 +1,9 @@
import Nav from "../components/ui/Nav";
import { postGameStatisticsData, postRatingData } from "../services/WordpressFetchData";
import { useLanguage } from "../hooks/useLanguage";
import { useEffect, useState } from "react";
import axios from "axios";
import { useState } from "react";
export default function Test() {
const { language } = useLanguage();
const [randomData, setRandomData] = useState({});
const [randomData] = useState({});
function postRandomDatas() {
const requestDataExample = {

View File

@ -9,7 +9,7 @@ import Lottie from "lottie-react";
import Loading from "../components/animations/Loading";
export default function Welcome() {
const { language, screensTranslations } = useUser();
const { screensTranslations } = useUser();
if (!screensTranslations || !screensTranslations.welcome) return <Loading />;
const currentScreenTranslations = screensTranslations.welcome;