Skip to content

Commit

Permalink
17 Added 404 page, added new icon for 404 page, added svg webpack loader
Browse files Browse the repository at this point in the history
  • Loading branch information
vladokuskov committed May 5, 2024
1 parent e00eb8f commit b79460c
Show file tree
Hide file tree
Showing 6 changed files with 1,282 additions and 22 deletions.
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 @@ -26,6 +26,7 @@
"@hookform/resolvers": "^3.3.4",
"@percy/playwright": "^1.0.5",
"@percy/sdk-utils": "^1.28.3",
"@svgr/webpack": "^8.1.0",
"@tabler/icons-react": "^3.3.0",
"axios": "^1.6.7",
"daisyui": "^4.10.1",
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.
2 changes: 1 addition & 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.
24 changes: 24 additions & 0 deletions src/app/[...not_found]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use client';

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

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">
Go back home
</button>
</div>
</div>
);
}
Loading

0 comments on commit b79460c

Please sign in to comment.