Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 404 page #122

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
);
}