Skip to content

Commit

Permalink
Update 404 page
Browse files Browse the repository at this point in the history
[#57]
  • Loading branch information
Sara authored and Sara committed Oct 21, 2024
1 parent 75df11e commit dfb0c4d
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 4 deletions.
50 changes: 50 additions & 0 deletions src/app/core/components/ButtonLink/ButtonLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { forwardRef, Ref, type ReactNode } from "react";
import {
TButtonSize,
TButtonVariant,
ButtonVariants,
ButtonSizes,
} from "@/app/core/components/Button/Button";
import clsx from "clsx";

interface IProps {
children: ReactNode;
size?: TButtonSize;
href: string;
additionalClasses: string;
variant?: TButtonVariant;
fullWidth?: boolean;
}

const ButtonLink = forwardRef(
(
{
children,
href = "/",
additionalClasses = "",
size = "regular",
variant = "primary",
fullWidth = false,
}: IProps,
ref: Ref<HTMLButtonElement>
) => {
return (
<a
href={href}
className={clsx(
"rounded-xl inline-block font-bold transition-all",
additionalClasses,
ButtonSizes[size],
ButtonVariants[variant],
fullWidth && "w-full"
)}
>
{children}
</a>
);
}
);

ButtonLink.displayName = "ButtonLink";

export default ButtonLink;
23 changes: 19 additions & 4 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
import Link from "next/link";
import ButtonLink from "@/app/core/components/ButtonLink/ButtonLink";

export default function NotFound() {
return (
<div>
<h2>Not Found</h2>
<p>Could not find requested resource</p>
<Link href="/">Return Home</Link>
<div className="flex flex-col items-center my-10">
<h1 className="text-[2.5rem] font-pressstart uppercase leading-tight">
<span>404</span>
</h1>
<h2 className="uppercase md:text-2xl font-normal">
<span>Page not found</span>
</h2>
<hr className="w-1/4 max-w-[160px] border-breadpink-shaded my-6" />
<div className="flex flex-col items-center max-w-[250px]">
<p className="leading-tight text-center">
Post-Capitalism can only be achieved through perserverance.
</p>
<p className="leading-tight text-center">Please try again later.</p>
</div>
<ButtonLink href="/" additionalClasses="my-6">
Return home
</ButtonLink>
</div>
</div>
);
}

0 comments on commit dfb0c4d

Please sign in to comment.