Skip to content

Commit

Permalink
Linked to the error page
Browse files Browse the repository at this point in the history
  • Loading branch information
shivansh-bhatnagar18 committed Jun 10, 2024
1 parent 3252741 commit df7b381
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const router = createBrowserRouter([
element: <Game />,
},
{ path: '/about', element: <About /> },
{ path: '/error', element: <Error /> },
],
},
]);
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ const Navbar: React.FC<NavbarProps> = ({
fontSize="text-2xl"
buttonSize="w-[170px] h-12"
px="px-0"
onClick={() => {
window.location.href = '/error';
}}
/>
</div>
<div className="mt-4">
Expand All @@ -97,6 +100,9 @@ const Navbar: React.FC<NavbarProps> = ({
fontSize="text-2xl"
buttonSize="w-[170px] h-12"
px="px-0"
onClick={() => {
window.location.href = '/error';
}}
/>
</div>
</div>
Expand Down
12 changes: 8 additions & 4 deletions frontend/src/pages/Error.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Link } from 'react-router-dom';
import ErrorImage from '../assets/tornCard.svg';
import Button from '../library/button';

function Error() {
return (
Expand All @@ -21,9 +21,13 @@ function Error() {
Sorry, the page you're looking for can't be found.
Please return to the Homepage!
</p>
<button className="p-4 outline-none border-none rounded-md text-white bg-[#FF2400] cursor-pointer transition-all duration-500 hover:bg-[#12a101]">
<Link to="home">Go back to Homepage</Link>
</button>
<Button
text="Return back to homepage"
buttonSize="w-80 h-12"
className="border-4"
rounded="rounded-full"
onClick={() => (window.location.href = '/')}
/>
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ const Home: React.FC = () => {
const CreateGame = () => {
// Logic to create a game
console.log('Create Game');
navigate('/game');
navigate('/error');
};

const JoinGame = () => {
// Logic to join a game
console.log('Join Game with code');
navigate('/error');
};

const [isLoggedIn, setIsLoggedIn] = useState(false);
Expand Down

0 comments on commit df7b381

Please sign in to comment.