REFACTOR: Implement full page reloads for state-critical navigation

This commit is contained in:
Chris-1010
2025-02-22 13:00:20 +00:00
parent aa1b85513f
commit 12d9f3660a
9 changed files with 35 additions and 42 deletions

View File

@@ -1,11 +1,9 @@
import React, { useState, useEffect } from "react";
import { useNavigate } from "react-router-dom";
import Button from "../components/Input/Button";
// @ts-ignore
import ChromeDinoGame from "react-chrome-dino";
const NotFoundPage: React.FC = () => {
const navigate = useNavigate();
const [stars, setStars] = useState<{ x: number; y: number }[]>([]);
const starSize = 20;
@@ -59,7 +57,7 @@ const NotFoundPage: React.FC = () => {
<h1 className="text-6xl font-bold mb-4">404</h1>
<p className="text-2xl mb-8">Page Not Found</p>
<ChromeDinoGame />
<Button extraClasses="z-[100]" onClick={() => navigate("/")}>
<Button extraClasses="z-[100]" onClick={() => window.location.href = "/"}>
Go Home
</Button>
</div>