Skip to content

Commit

Permalink
Merge pull request #553 from kethesainikhil/feature/inHouseError
Browse files Browse the repository at this point in the history
InHouse Error Page Introuduced
  • Loading branch information
hkirat authored May 12, 2024
2 parents aaa3799 + d453eb0 commit 4faf90a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/admin/user/LogoutUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const LogoutUserComp = () => {
const email = formData.get('email') as string;
const adminPassword = formData.get('adminPassword') as string;
const res = await logoutUser(email, adminPassword);
toast.info(res.message);
toast.info(res.message || res.error);
};
return (
<form onSubmit={handlLogout} ref={formRef}>
Expand Down
39 changes: 39 additions & 0 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'use client';
import Link from 'next/link';
export default function GlobalError() {
return (
<html>
<head>
<title>404: Page could not be found</title>
</head>
<body>
<div className="text-center absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 ">
<h1 className="mb-4 text-6xl font-semibold text-red-500">404</h1>
<p className="mb-4 text-lg dark:text-white">Oops! Page Not Found.</p>
<div className="animate-bounce">
<svg
className="mx-auto h-16 w-16 text-red-500"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8"
></path>
</svg>
</div>
<Link
href="/"
className="mt-2 inline-block rounded bg-blue-500 px-4 py-2 font-semibold dark:text-white hover:bg-blue-600"
>
{' '}
Go back to Home{' '}
</Link>
</div>
</body>
</html>
);
}
10 changes: 5 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
"incremental": true,
"plugins": [
{
"name": "next"
}
"name": "next",
},
],
"paths": {
"@/*": ["./src/*"],
"@public/*": ["./public/*"]
}
"@public/*": ["./public/*"],
},
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}

0 comments on commit 4faf90a

Please sign in to comment.