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

17 add UI for 404 page #18

Merged
merged 4 commits into from
May 6, 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
7 changes: 7 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ const nextConfig = {
env: {
APP_SERVER_URL: process.env.APP_SERVER_URL,
},
webpack: (config) => {
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
});
return config;
}
}

export default nextConfig
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"dependencies": {
"@hookform/resolvers": "^3.3.4",
"@percy/sdk-utils": "^1.28.3",
"@svgr/webpack": "^8.1.0",
"@tabler/icons-react": "^3.3.0",
"@testing-library/jest-dom": "^6.4.3",
"@testing-library/react": "^15.0.6",
Expand Down
3 changes: 3 additions & 0 deletions public/assets/icons/404.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion public/assets/icons/app-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions src/app/[...not_found]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'use client';

import NotFoundIcon from '@/public/assets/icons/404.svg';
import { useRouter } from 'next/navigation';
import { IconArrowBack } from '@tabler/icons-react';

export default function NotFoundPage() {
const router = useRouter();

return (
<div className="flex h-screen w-full items-center justify-center gap-4 p-4">
<div className="flex flex-col items-center justify-center gap-4">
<NotFoundIcon className="size-48" />
<p className="max-w-md text-center text-sm">
Looks like you`ve stumbled upon a page that`s playing hide and seek
with us. Don`t worry, it happens to the best of us. But fear not,
we`re here to help you get back on track!
</p>
<button onClick={() => router.push('/')} className="btn">
<IconArrowBack /> Go back home
</button>
</div>
</div>
);
}
10 changes: 2 additions & 8 deletions src/app/auth/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import Image from 'next/image';
import AppLogoIcon from '@/public/assets/icons/app-logo.svg';

const AuthLayout = ({ children }: { children: React.ReactNode }) => {
return (
<div className="flex min-h-screen flex-col items-center justify-center">
<div className="flex w-full max-w-md flex-col items-center justify-center p-4">
<Image
src="/assets/icons/app-logo.svg"
className="h-9 w-auto"
alt="App Logo"
width={100}
height={40}
/>
<AppLogoIcon className="w-36" />
{children}
</div>
</div>
Expand Down
1,393 changes: 1,309 additions & 84 deletions yarn.lock

Large diffs are not rendered by default.

Loading