Skip to content

Commit

Permalink
feat:not_found_page
Browse files Browse the repository at this point in the history
  • Loading branch information
farooqpk committed Jan 3, 2025
1 parent b4f570a commit 5f1a5da
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import { VerifyRoute } from "./components/auth/verifyRoute";
import { SocketLayout } from "./components/socketLayout";
import PrivateChat from "./pages/privateChat";
import GroupChat from "./pages/groupChat";
import { PrivacyPolicy } from "./pages/privacyPolicy";
import AiChat from "./pages/aiChat";
import { PeerLayout } from "./components/peerLayout";
import { CallLayout } from "./components/callLayout";
import { lazy } from "react";
const NotFound = lazy(() => import("./pages/404"));
const PrivacyPolicy = lazy(() => import("./pages/privacyPolicy"));

const Layout = () => {
return (
Expand All @@ -25,6 +27,7 @@ const Layout = () => {
<Route path="/chat/ai" element={<AiChat />} />
<Route path="/chat/:id" element={<PrivateChat />} />
<Route path="/group/:id" element={<GroupChat />} />
<Route path="*" element={<NotFound />} />
</Route>
</Route>
</Route>
Expand Down
28 changes: 28 additions & 0 deletions src/pages/404/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { useNavigate } from "react-router-dom";

const NotFound = () => {
const navigate = useNavigate();

return (
<div className="min-h-screen bg-gradient-to-r from-gray-900 via-black to-gray-900 flex items-center justify-center px-4">
<div className="max-w-lg w-full text-center">
<h1 className="text-9xl font-extrabold text-white tracking-widest">
404
</h1>
<button className="mt-5" onClick={() => navigate("/")}>
<span className="relative inline-block text-sm font-medium text-white group active:text-opacity-75">
<span className="absolute inset-0 transition-transform translate-x-0.5 translate-y-0.5 bg-white opacity-[0.1] group-hover:translate-y-0 group-hover:translate-x-0"></span>
<span className="relative block px-8 py-3 bg-black border border-current">
Go Home
</span>
</span>
</button>
<p className="text-white text-xl font-medium mt-8">
Oops! The page you're looking for doesn't exist.
</p>
</div>
</div>
);
};

export default NotFound;
4 changes: 3 additions & 1 deletion src/pages/privacyPolicy/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const PrivacyPolicy = () => {
const PrivacyPolicy = () => {
return (
<div className="p-12 flex flex-col gap-3">
<h1>Privacy Policy</h1>
Expand Down Expand Up @@ -28,3 +28,5 @@ export const PrivacyPolicy = () => {
</div>
);
};

export default PrivacyPolicy;

0 comments on commit 5f1a5da

Please sign in to comment.