diff --git a/src/components/DictionaryRuleProcessor.tsx b/src/components/DictionaryRuleProcessor.tsx index 51e40b9..1f71c34 100644 --- a/src/components/DictionaryRuleProcessor.tsx +++ b/src/components/DictionaryRuleProcessor.tsx @@ -50,7 +50,7 @@ export default function DictionaryRuleProcessor ({

Code couleur du jeu :

  • 🟩 : La lettre est bien placée
  • -

    🟧 : La lettre est présente dans le mot

    +
  • 🟧 : La lettre est présente dans le mot
  • ) } diff --git a/src/components/DifficultyRules.tsx b/src/components/DifficultyRules.tsx index 56a37f1..95fe780 100644 --- a/src/components/DifficultyRules.tsx +++ b/src/components/DifficultyRules.tsx @@ -37,7 +37,7 @@ export default function DifficultyRules ({ answer }: DifficultyRulesProps) {

    ☄️ {locationDifficulty.isColor() ? 'Couleur autorisée' : 'Couleur non autorisée'}

    - +
    ) diff --git a/src/home/Difficulty.tsx b/src/home/Difficulty.tsx index dbdd2f5..9f2b152 100644 --- a/src/home/Difficulty.tsx +++ b/src/home/Difficulty.tsx @@ -5,11 +5,14 @@ import easy from '../resources/images/black_swan.png' import medium from '../resources/images/jingliu.png' import hard from '../resources/images/sparkle.png' import impossible from '../resources/images/ruan_mei.png' -import { useLocation, useNavigate } from 'react-router-dom' +import { Navigate, useLocation, useNavigate } from 'react-router-dom' export default function Difficulty () { const navigate = useNavigate() const location = useLocation() + if (location.state.theme === undefined || location.state.theme === null) { + return // Rediriger vers la page de base + } interface FormData { difficulty: string diff --git a/src/home/Motus.tsx b/src/home/Motus.tsx index 06e035a..765c211 100644 --- a/src/home/Motus.tsx +++ b/src/home/Motus.tsx @@ -5,7 +5,7 @@ import DictionaryRuleProcessor from '../components/DictionaryRuleProcessor' import WordHistory from '../components/WordHistory' import InputAnswer from '../components/InputAnswer' import DifficultyRules from '../components/DifficultyRules' -import { Link, Navigate, useLocation } from 'react-router-dom' +import { Navigate, useLocation, useNavigate } from 'react-router-dom' import HealthTry from '../components/HealthTry' import { LocationDifficulty } from '../entities/LocationDifficulty' @@ -14,8 +14,9 @@ export default function Motus () { const [historyInput, setHistoryInput] = useState([]) const [inputValue, setInputValue] = useState('') const location = useLocation() - if (location.state === undefined || location.state === null) { - return // Rediriger vers la page de base + const navigate = useNavigate() + if (location.state.difficulty === undefined || location.state.difficulty === null) { + return // Rediriger vers la page de base } const locationDifficulty = new LocationDifficulty(location) @@ -23,6 +24,10 @@ export default function Motus () { window.location.reload() } + const handleNavigate = () => { + navigate('/motus', {}) + } + const theme: string = location.state.theme useEffect(() => { @@ -62,8 +67,8 @@ export default function Motus () { />
    - Page d’accueil - + +
    diff --git a/src/home/styles/App.css b/src/home/styles/App.css index 03a0dc9..4460f66 100644 --- a/src/home/styles/App.css +++ b/src/home/styles/App.css @@ -50,9 +50,11 @@ button { color: white; text-decoration: none; padding: 10px; - background-color: #e58585; + background-color: var(--init-border-color); border-radius: 10px; border-color: white; + cursor: pointer; + transition: background-color 0.3s ease; } .items img {