Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

feat: added responsive not found page #13

Merged
merged 3 commits into from
May 31, 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
1 change: 1 addition & 0 deletions .env.local.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
NEXT_SHARP_PATH=node_modules/.bin/sharp
NEXT_PUBLIC_SANITY_DATASET=
NEXT_PUBLIC_SANITY_PROJECT_ID=
SANITY_API_DATASET=
Expand Down
26 changes: 26 additions & 0 deletions app/(Site)/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import Button from '@/components/Button/Button';
import clsx from 'clsx';

export default async function NotFound() {
return (
<div className="flex flex-col justify-center items-center w-full h-screen align-middle p-32">
{/* https://github.com/vercel/next.js/issues/45620 */}
<title>Page not found - Session Token</title>
<div
className={clsx(
'flex flex-col gap-10 justify-center items-center align-middle',
'lg:flex-row lg:h-[200px] '
)}
>
<span className={clsx('text-9xl font-bold pt-10', 'lg:text-[200px]')}>404</span>
<div className={clsx('bg-gray-300 min-w-full min-h-px', 'lg:min-w-px lg:min-h-full')} />
<div className={clsx('flex flex-col justify-center items-center gap-5', 'lg:items-start')}>
<p className={clsx('text-xl text-center', 'lg:max-w-[340px] lg:text-start')}>
{"Sorry! We couldn't find the page you were looking for."}
</p>
<Button url="/" title={'↖ Return Home'} size="large" variant="outline"></Button>
</div>
</div>
</div>
);
}
2 changes: 1 addition & 1 deletion components/DevModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const DevModal = ({ slugs }: { slugs: Array<string> }) => {
return () => {
document.removeEventListener('keydown', handleKeyDown);
};
}, [lastSearchChar, lastSearchIndex]);
}, [lastSearchChar, lastSearchIndex, slugs]);

return (
<Modal isOpen={isModalOpen} onClose={() => setIsModalOpen(false)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@

&:not(:last-child)
margin-bottom: 15px
a
color: var(--color-primary)

@media(max-width: 500px)
.Outer
display: block

legend
display: none
display: none