Skip to content

Commit

Permalink
Merge pull request #38 from rajkaranm/404-page
Browse files Browse the repository at this point in the history
add: added page not found page
  • Loading branch information
PriyansuMaurya committed Jul 4, 2023
2 parents db4e6b0 + a5c24fb commit 76aba2a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
43 changes: 43 additions & 0 deletions app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"use client";
import { theme } from "@/types";
import { useThemeContext } from "./context/store";
import { useEffect } from "react";
import Link from "next/link";
import Image from "next/image";
import pageNotFound from "../public/page404.png";
export default function NotFound() {
// Dark Mode
const { theme }: theme = useThemeContext();

useEffect(() => {
if (theme === "dark") {
document.documentElement.classList.add("dark");
} else {
document.documentElement.classList.remove("dark");
}
}, [theme]);
return (
<div className="flex flex-col items-center xl:flex-row xl:items-start justify-around bg-[--light-bg] dark:bg-[--dark-bg] text-[--dark-bg] dark:text-[--light-bg] md:ms-16 md:my-16 mt-10 m-5">
<div>
<h1 className="md:w-[42rem] font-bold text-3xl md:text-5xl">Sorry, we can't find that page</h1>
<div className="md:w-[30rem]">
<p className="text-xl md:text-2xl mt-7">
Ahoy, it seems you've ventured into uncharted territory.
</p>
<p className="text-xl md:text-2xl mt-7">Feel free to navigate back to the <Link className="underline hover:decoration-[--primary-color] decoration-0 underline-offset-2" href="/">
Homepage
</Link> or click on any of the tabs above.</p>
</div>

</div>
<div className="mt-24">
<Image
src={pageNotFound}
alt="404 page image"
width={600}
height={300}
/>
</div>
</div>
);
}
4 changes: 3 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
const nextConfig = {
trailingSlash: true
}

module.exports = nextConfig
Binary file added public/page404.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit 76aba2a

@vercel
Copy link

@vercel vercel bot commented on 76aba2a Jul 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

aifusion – ./

aifusion.vercel.app
aifusion-git-main-priyansu.vercel.app
aifusion-priyansu.vercel.app

Please sign in to comment.