Skip to content

Commit

Permalink
Feat: Add 404 page and fix nav and mobile nav color
Browse files Browse the repository at this point in the history
  • Loading branch information
hafezfhmi committed Mar 14, 2023
1 parent b477135 commit daa017f
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 3 deletions.
Binary file added public/images/404-sad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions src/components/common/Error404/Error404.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Image from "next/image";
import styles from "./Error404.module.css";

const Error404 = () => {
return (
<div className={styles.error404}>
<Image
src="/images/404-sad.png"
width={600}
height={400}
alt="cat crying"
/>
<p className="text-lg md:text-xl xl:text-2xl 2xl:text-3xl">
404. Page Not Found.
</p>
</div>
);
};

export default Error404;
12 changes: 12 additions & 0 deletions src/components/common/Error404/Error404.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.error404 {
@apply flex flex-col gap-y-4 justify-center items-center basis-full;

min-height: 100vh;
min-height: 100dvh;
}

@media (min-width: 768px) {
.error404 {
min-height: calc(100vh - 108px);
}
}
1 change: 1 addition & 0 deletions src/components/common/Error404/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "./Error404";
4 changes: 2 additions & 2 deletions src/components/common/MobileNav/MobileNav.module.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.mobileNav__button {
@apply w-12 h-12 fixed top-4 right-4 p-3 border-2 border-black rounded-full bg-white cursor-pointer select-none z-[100];
@apply w-12 h-12 fixed top-4 right-4 p-3 border-2 border-black rounded-full text-black bg-white cursor-pointer select-none z-[100];

-webkit-tap-highlight-color: transparent;
}

.mobileNav__nav {
@apply flex flex-col justify-center items-center gap-y-5 fixed top-0 w-screen border-l-2 border-black text-2xl bg-white z-[99] duration-200;
@apply flex flex-col justify-center items-center gap-y-5 fixed top-0 w-screen border-l-2 border-black text-2xl text-black bg-white z-[99] duration-200;

transition-property: left;
height: 100vh;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const navigationList = [
const Navbar = () => {
return (
<div className="hidden justify-between items-center border-t-2 border-b-2 border-black bg-white text-3xl font-bold md:flex">
<Link href="/" className="ml-6 mr-12">
<Link href="/" className="ml-6 mr-12 text-black">
HFz
</Link>
<nav className="flex items-center">
Expand Down
7 changes: 7 additions & 0 deletions src/pages/404.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Error404 from "@/components/common/Error404";

const NotFound = () => {
return <Error404 />;
};

export default NotFound;

1 comment on commit daa017f

@vercel
Copy link

@vercel vercel bot commented on daa017f Mar 14, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.