Skip to content

Commit 94ce9bd

Browse files
committed
Custom 404 page
- Created a `not-found.tsx` file - Added an Image for the custom page. - re installed react-icons package (It was giving some errors)
1 parent f9b9b52 commit 94ce9bd

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,8 @@
4242
},
4343
"engines": {
4444
"node": ">=18.17.0"
45+
},
46+
"dependencies": {
47+
"react-icons": "^5.3.0"
4548
}
4649
}

packages/nextjs/app/not-found.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from "react";
2+
import Image from "next/image";
3+
import Link from "next/link";
4+
5+
const NotFound = () => {
6+
return (
7+
<main className=" text-center">
8+
<div className=" h-[500px] md:w-auto my-[100px]">
9+
<Image alt=" 404image" src={"/404.svg"} height={300} width={300} className=" overflow-hidden h-full w-full" />
10+
<p className=" text-sm font-light">
11+
Go back to the{" "}
12+
<Link href={"/"}>
13+
{" "}
14+
<span className=" font-normal underline text-primary-content text-base">Home Page</span>{" "}
15+
</Link>{" "}
16+
</p>
17+
</div>
18+
</main>
19+
);
20+
};
21+
22+
export default NotFound;

packages/nextjs/public/404.svg

Lines changed: 1 addition & 0 deletions
Loading

yarn.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12019,6 +12019,15 @@ __metadata:
1201912019
languageName: node
1202012020
linkType: hard
1202112021

12022+
"react-icons@npm:^5.3.0":
12023+
version: 5.3.0
12024+
resolution: "react-icons@npm:5.3.0"
12025+
peerDependencies:
12026+
react: "*"
12027+
checksum: 3aa5f50e05aafc6d31e0d995fe0d98560069aa88717b24ce8aaa082a7e7b20ca95e1e19d847ed6e52d658a5a30e15826af20d7554bf993a743edd55586db62e3
12028+
languageName: node
12029+
linkType: hard
12030+
1202212031
"react-is@npm:^16.13.1":
1202312032
version: 16.13.1
1202412033
resolution: "react-is@npm:16.13.1"
@@ -12680,6 +12689,7 @@ __metadata:
1268012689
dependencies:
1268112690
husky: ^8.0.1
1268212691
lint-staged: ^13.0.3
12692+
react-icons: ^5.3.0
1268312693
languageName: unknown
1268412694
linkType: soft
1268512695

0 commit comments

Comments
 (0)