eleven-solutions-common-website-unique-web 21.0.56 → 22.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/App.d.ts +0 -3
- package/dist/App.js +0 -2
- package/dist/components/admin/Sidebar.d.ts +0 -1
- package/dist/components/admin/Sidebar.js +2 -2
- package/dist/components/admin/UserForm.js +1 -1
- package/dist/components/admin/Users.js +2 -2
- package/dist/components/footer/Footer.d.ts +3 -2
- package/dist/components/footer/Footer.js +2 -3
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +3 -2
- package/dist/components/login/GoogleButton.js +4 -1
- package/dist/components/login/Header.d.ts +3 -1
- package/dist/components/login/Header.js +135 -31
- package/dist/components/login/Login.d.ts +2 -1
- package/dist/components/login/Login.js +15 -65
- package/dist/components/login/Setcookie.d.ts +2 -0
- package/dist/components/login/Setcookie.js +7 -0
- package/dist/components/redux/slices/types/types.d.ts +3 -0
- package/dist/components/redux/slices/types/types.js +1 -0
- package/dist/components/redux/slices/userSlice.d.ts +20 -0
- package/dist/components/redux/slices/userSlice.js +90 -0
- package/dist/components/useraccount/UpdateUserDetails.d.ts +1 -0
- package/dist/components/useraccount/UpdateUserDetails.js +15 -22
- package/package.json +8 -4
- package/.github/workflows/main.yml +0 -22
- package/azure-pipelines.yml +0 -20
- package/dist/components/Navbar.d.ts +0 -6
- package/dist/components/Navbar.js +0 -5
- package/dist/components/login/View.d.ts +0 -2
- package/dist/components/login/View.js +0 -10
- package/dist/components/useraccount/AddMissingDetails.d.ts +0 -9
- package/dist/components/useraccount/AddMissingDetails.js +0 -56
- package/dist/components/useraccount/AddUserDetails.d.ts +0 -9
- package/dist/components/useraccount/AddUserDetails.js +0 -21
- package/src/App.tsx +0 -21
- package/src/components/Navbar.tsx +0 -21
- package/src/components/admin/Dashboard.tsx +0 -7
- package/src/components/admin/Editor.tsx +0 -25
- package/src/components/admin/Sidebar.tsx +0 -102
- package/src/components/admin/Taxionomies.tsx +0 -314
- package/src/components/admin/TaxonomyForm.tsx +0 -744
- package/src/components/admin/Template.tsx +0 -304
- package/src/components/admin/TemplateForm.tsx +0 -141
- package/src/components/admin/UserForm.tsx +0 -231
- package/src/components/admin/Users.tsx +0 -479
- package/src/components/api/api.ts +0 -59
- package/src/components/api/taxonomy.ts +0 -201
- package/src/components/api/template.ts +0 -114
- package/src/components/api/updateuser.ts +0 -53
- package/src/components/api/user.ts +0 -133
- package/src/components/footer/Footer.tsx +0 -128
- package/src/components/footer/Privacy.tsx +0 -82
- package/src/components/footer/Terms.tsx +0 -156
- package/src/components/index.ts +0 -19
- package/src/components/login/GoogleButton.tsx +0 -85
- package/src/components/login/Header.tsx +0 -340
- package/src/components/login/Login.tsx +0 -277
- package/src/components/useraccount/AddUserDetails.tsx +0 -136
- package/src/components/useraccount/UpdateUserDetails.tsx +0 -214
- package/src/index.ts +0 -1
- package/tsconfig.json +0 -15
@@ -1,156 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
// import { ThemeContext } from "../theme/ThemeProvider";
|
3
|
-
// import { useContext } from 'react';
|
4
|
-
|
5
|
-
export function TermsAndC({isDarkMode}) {
|
6
|
-
// const themeContext = useContext(ThemeContext);
|
7
|
-
|
8
|
-
// if (!themeContext) {
|
9
|
-
// throw new Error("ThemeContext must be used within a ThemeProvider");
|
10
|
-
// }
|
11
|
-
|
12
|
-
// const { isDarkMode } = themeContext;
|
13
|
-
|
14
|
-
return (
|
15
|
-
<div
|
16
|
-
className={`container md:mx-auto min-h-[70vh] p-4 text-justify lg:px-72 lg:text-justify ${
|
17
|
-
isDarkMode ? "bg-globalBg text-[#ffff]" : "bg-white text-black"
|
18
|
-
}`}
|
19
|
-
>
|
20
|
-
<h2
|
21
|
-
className={`font-extrabold mb-4 text-2xl lg:text-center md:text-center ${
|
22
|
-
isDarkMode ? "text-blue-300" : "text-blue-400"
|
23
|
-
}`}
|
24
|
-
>
|
25
|
-
Terms and Conditions
|
26
|
-
</h2>
|
27
|
-
<p className="text-sm mt-4">
|
28
|
-
Welcome to TajushShariah Foundation - Islamic Trust For Donation. By accessing our website, making a donation, or using our services, you agree to comply with and be bound by the following Terms and Conditions. If you do not agree with these terms, please do not use our website or services.
|
29
|
-
</p>
|
30
|
-
|
31
|
-
<h5
|
32
|
-
className={`text-base font-semibold mt-6 ${
|
33
|
-
isDarkMode ? "text-yellow-300" : "text-black"
|
34
|
-
}`}
|
35
|
-
>
|
36
|
-
1. Donation Policy
|
37
|
-
</h5>
|
38
|
-
<p className="text-sm mt-2">
|
39
|
-
<strong className={`${isDarkMode ? "text-blue-400" : "text-black"}`}>
|
40
|
-
Eligibility:{" "}
|
41
|
-
</strong>
|
42
|
-
By making a donation to TajushShariah Foundation, you confirm that you are legally capable of entering into a binding agreement.
|
43
|
-
</p>
|
44
|
-
<p className="text-sm mt-2">
|
45
|
-
<strong className={`${isDarkMode ? "text-blue-400" : "text-black"}`}>
|
46
|
-
Acceptance:{" "}
|
47
|
-
</strong>
|
48
|
-
We reserve the right to refuse or cancel any donation for any reason, including but not limited to issues with payment processing, suspicion of fraudulent activity, or violation of our policies.
|
49
|
-
</p>
|
50
|
-
<p className="text-sm mt-2">
|
51
|
-
<strong className={`${isDarkMode ? "text-blue-400" : "text-black"}`}>
|
52
|
-
Confirmation:{" "}
|
53
|
-
</strong>
|
54
|
-
Upon successful donation, you will receive a confirmation email. This email will serve as a receipt for your donation.
|
55
|
-
</p>
|
56
|
-
|
57
|
-
<h5
|
58
|
-
className={`text-base font-semibold mt-6 ${
|
59
|
-
isDarkMode ? "text-yellow-300" : "text-black"
|
60
|
-
}`}
|
61
|
-
>
|
62
|
-
2. User Accounts
|
63
|
-
</h5>
|
64
|
-
<p className="text-sm mt-2">
|
65
|
-
<strong className={`${isDarkMode ? "text-blue-400" : "text-black"}`}>
|
66
|
-
Creation:{" "}
|
67
|
-
</strong>
|
68
|
-
If you create an account on our website, you are responsible for maintaining the confidentiality of your account information, including your password.
|
69
|
-
</p>
|
70
|
-
<p className="text-sm mt-2">
|
71
|
-
<strong className={`${isDarkMode ? "text-blue-400" : "text-black"}`}>
|
72
|
-
Termination:{" "}
|
73
|
-
</strong>
|
74
|
-
We reserve the right to terminate or suspend your account at our discretion, without notice, if we believe you have violated these Terms and Conditions.
|
75
|
-
</p>
|
76
|
-
|
77
|
-
<h5
|
78
|
-
className={`text-base font-semibold mt-6 ${
|
79
|
-
isDarkMode ? "text-yellow-300" : "text-black"
|
80
|
-
}`}
|
81
|
-
>
|
82
|
-
3. Intellectual Property
|
83
|
-
</h5>
|
84
|
-
<p className="text-sm mt-2">
|
85
|
-
<strong className={`${isDarkMode ? "text-blue-400" : "text-black"}`}>
|
86
|
-
Ownership:{" "}
|
87
|
-
</strong>
|
88
|
-
All content on our website, including but not limited to text, graphics, logos, and images, is the property of TajushShariah Foundation and is protected by copyright and other intellectual property laws.
|
89
|
-
</p>
|
90
|
-
<p className="text-sm mt-2">
|
91
|
-
<strong className={`${isDarkMode ? "text-blue-400" : "text-black"}`}>
|
92
|
-
Use of Content:{" "}
|
93
|
-
</strong>
|
94
|
-
You may not reproduce, distribute, modify, or create derivative works from the content on our website without prior written consent from TajushShariah Foundation.
|
95
|
-
</p>
|
96
|
-
|
97
|
-
<h5
|
98
|
-
className={`text-base font-semibold mt-6 ${
|
99
|
-
isDarkMode ? "text-yellow-300" : "text-black"
|
100
|
-
}`}
|
101
|
-
>
|
102
|
-
4. Privacy Policy
|
103
|
-
</h5>
|
104
|
-
<p className="text-sm mt-2">
|
105
|
-
Your use of our website and services is also governed by our Privacy Policy. Please review our Privacy Policy to understand how we collect, use, and protect your personal information.
|
106
|
-
</p>
|
107
|
-
|
108
|
-
<h5
|
109
|
-
className={`text-base font-semibold mt-6 ${
|
110
|
-
isDarkMode ? "text-yellow-300" : "text-black"
|
111
|
-
}`}
|
112
|
-
>
|
113
|
-
5. Limitation of Liability
|
114
|
-
</h5>
|
115
|
-
<p className="text-sm mt-2">
|
116
|
-
<strong className={`${isDarkMode ? "text-blue-400" : "text-black"}`}>
|
117
|
-
Disclaimer:{" "}
|
118
|
-
</strong>
|
119
|
-
TajushShariah Foundation is not liable for any damages, losses, or expenses resulting from your use of our website or services.
|
120
|
-
</p>
|
121
|
-
<p className="text-sm mt-2">
|
122
|
-
<strong className={`${isDarkMode ? "text-blue-400" : "text-black"}`}>
|
123
|
-
Indemnification:{" "}
|
124
|
-
</strong>
|
125
|
-
You agree to indemnify and hold TajushShariah Foundation harmless from any claims, liabilities, or expenses arising from your use of our website or services.
|
126
|
-
</p>
|
127
|
-
|
128
|
-
<h5
|
129
|
-
className={`text-base font-semibold mt-6 ${
|
130
|
-
isDarkMode ? "text-yellow-300" : "text-black"
|
131
|
-
}`}
|
132
|
-
>
|
133
|
-
6. Governing Law
|
134
|
-
</h5>
|
135
|
-
<p className="text-sm mt-2">
|
136
|
-
These Terms and Conditions are governed by the laws of India. Any legal actions arising from or related to these terms will be filed in the appropriate courts within India.
|
137
|
-
</p>
|
138
|
-
|
139
|
-
<h5
|
140
|
-
className={`text-base font-semibold mt-6 ${
|
141
|
-
isDarkMode ? "text-yellow-300" : "text-black"
|
142
|
-
}`}
|
143
|
-
>
|
144
|
-
7. Changes to Terms and Conditions
|
145
|
-
</h5>
|
146
|
-
<p className="text-sm mt-2">
|
147
|
-
We reserve the right to update or modify these Terms and Conditions at any time. Changes will be effective upon posting the revised terms on our website.
|
148
|
-
</p>
|
149
|
-
<p className="text-sm mb-6">
|
150
|
-
By using our website or services, you acknowledge that you have read, understood, and agreed to these Terms and Conditions.
|
151
|
-
</p>
|
152
|
-
</div>
|
153
|
-
);
|
154
|
-
}
|
155
|
-
|
156
|
-
export default TermsAndC;
|
package/src/components/index.ts
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
// Exports for components
|
2
|
-
export { default as Navbar } from "./Navbar";
|
3
|
-
export { default as Footer } from "./footer/Footer";
|
4
|
-
export { default as Terms } from "./footer/Terms";
|
5
|
-
export { default as Privacy } from "./footer/Privacy";
|
6
|
-
export { default as Login } from "./login/Login";
|
7
|
-
export { default as Header } from "./login/Header";
|
8
|
-
export { default as Users } from "./admin/Users";
|
9
|
-
export { default as UserForm } from "./admin/UserForm";
|
10
|
-
export { default as Taxionomies } from "./admin/Taxionomies";
|
11
|
-
export { default as TaxonomyForm } from "./admin/TaxonomyForm";
|
12
|
-
export { default as Template } from "./admin/Template";
|
13
|
-
export { default as TemplateForm } from "./admin/TemplateForm";
|
14
|
-
export { default as Editor } from "./admin/Editor";
|
15
|
-
export { default as AdminSideBar } from "./admin/Sidebar";
|
16
|
-
export { default as Dashboard } from "./admin/Dashboard";
|
17
|
-
export { registerApi, loginApi } from "./api/api";
|
18
|
-
|
19
|
-
export { default as UpdateUserDetails } from "./useraccount/UpdateUserDetails";
|
@@ -1,85 +0,0 @@
|
|
1
|
-
import { useGoogleLogin } from "@react-oauth/google";
|
2
|
-
import axios from "axios";
|
3
|
-
import React from "react";
|
4
|
-
import Cookies from "universal-cookie";
|
5
|
-
|
6
|
-
// Define the shape of the response data
|
7
|
-
interface LoginResponse {
|
8
|
-
token: string;
|
9
|
-
}
|
10
|
-
|
11
|
-
function GoogleIcon(props: React.ComponentPropsWithoutRef<"svg">) {
|
12
|
-
return (
|
13
|
-
<svg
|
14
|
-
xmlns="http://www.w3.org/2000/svg"
|
15
|
-
preserveAspectRatio="xMidYMid"
|
16
|
-
viewBox="0 0 256 262"
|
17
|
-
className="w-4 h-4"
|
18
|
-
{...props}
|
19
|
-
>
|
20
|
-
<path
|
21
|
-
fill="#4285F4"
|
22
|
-
d="M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027"
|
23
|
-
/>
|
24
|
-
<path
|
25
|
-
fill="#34A853"
|
26
|
-
d="M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1"
|
27
|
-
/>
|
28
|
-
<path
|
29
|
-
fill="#FBBC05"
|
30
|
-
d="M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782"
|
31
|
-
/>
|
32
|
-
<path
|
33
|
-
fill="#EB4335"
|
34
|
-
d="M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251"
|
35
|
-
/>
|
36
|
-
</svg>
|
37
|
-
);
|
38
|
-
}
|
39
|
-
|
40
|
-
function GoogleButton({
|
41
|
-
onClose,
|
42
|
-
url,
|
43
|
-
...props
|
44
|
-
}: React.ComponentPropsWithoutRef<"button"> & {
|
45
|
-
onClose: () => void;
|
46
|
-
url: string;
|
47
|
-
}) {
|
48
|
-
const googleLogin = useGoogleLogin({
|
49
|
-
onSuccess: async (tokenResponse) => {
|
50
|
-
try {
|
51
|
-
const response = await axios.post<LoginResponse>(
|
52
|
-
`${url}/login`,
|
53
|
-
{ type: 2 },
|
54
|
-
{ headers: { Authorization: `Bearer ${tokenResponse.access_token}` } }
|
55
|
-
);
|
56
|
-
|
57
|
-
if (response.data.token) {
|
58
|
-
const cookies = new Cookies();
|
59
|
-
cookies.set("authToken", response.data.token, { maxAge: 86400 });
|
60
|
-
window.location.href = "/home";
|
61
|
-
}
|
62
|
-
|
63
|
-
if (onClose) onClose();
|
64
|
-
} catch (error) {
|
65
|
-
console.error(error);
|
66
|
-
}
|
67
|
-
},
|
68
|
-
onError: (errorResponse) => console.error(errorResponse),
|
69
|
-
});
|
70
|
-
|
71
|
-
return (
|
72
|
-
<button
|
73
|
-
onClick={() => googleLogin()}
|
74
|
-
className="w-full h-10 mt-4 bg-[#ffff] text-black border border-gray-300 rounded-3xl"
|
75
|
-
{...props}
|
76
|
-
>
|
77
|
-
<div className="flex flex-row items-center justify-center gap-3">
|
78
|
-
<GoogleIcon />
|
79
|
-
<span className="font-medium">Sign in with Google</span>
|
80
|
-
</div>
|
81
|
-
</button>
|
82
|
-
);
|
83
|
-
}
|
84
|
-
|
85
|
-
export default GoogleButton;
|
@@ -1,340 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { CiLight, CiDark } from "react-icons/ci";
|
3
|
-
import { RxPerson } from "react-icons/rx";
|
4
|
-
import Cookies from "universal-cookie";
|
5
|
-
import { FC, useState } from "react";
|
6
|
-
import UpdateUserDetails from "../useraccount/UpdateUserDetails";
|
7
|
-
|
8
|
-
interface HeaderProps {
|
9
|
-
toggleTheme;
|
10
|
-
userLogedin;
|
11
|
-
userType;
|
12
|
-
url: string;
|
13
|
-
isDarkMode: boolean;
|
14
|
-
img: string;
|
15
|
-
name: string;
|
16
|
-
userdetails;
|
17
|
-
}
|
18
|
-
|
19
|
-
interface IconProps extends React.SVGProps<SVGSVGElement> {
|
20
|
-
className?: string;
|
21
|
-
}
|
22
|
-
|
23
|
-
const IconWrapper: FC<IconProps> = ({ className, ...props }) => (
|
24
|
-
<div className={className}>
|
25
|
-
<RxPerson {...props} />
|
26
|
-
</div>
|
27
|
-
);
|
28
|
-
|
29
|
-
const Header = ({
|
30
|
-
toggleTheme,
|
31
|
-
isDarkMode,
|
32
|
-
userLogedin,
|
33
|
-
userType,
|
34
|
-
url,
|
35
|
-
img,
|
36
|
-
name,
|
37
|
-
userdetails,
|
38
|
-
}: HeaderProps) => {
|
39
|
-
const [isOpen, setIsOpen] = useState(false);
|
40
|
-
const [usermodalopen, setusermodalopen] = useState(false);
|
41
|
-
const [showUserCard, setShowUserCard] = useState(false);
|
42
|
-
const handleNavigation = (event, path) => {
|
43
|
-
event.preventDefault();
|
44
|
-
window.history.pushState({}, "", path);
|
45
|
-
window.dispatchEvent(new PopStateEvent("popstate"));
|
46
|
-
};
|
47
|
-
// console.log("logged", userLogedin);
|
48
|
-
const isActive = (path) => window.location.pathname === path;
|
49
|
-
const handleDark = () => {
|
50
|
-
toggleTheme();
|
51
|
-
};
|
52
|
-
// console.log("in common", userType.roleType);
|
53
|
-
const handleLogout = () => {
|
54
|
-
const cookies = new Cookies();
|
55
|
-
const token = cookies.get("authToken");
|
56
|
-
if (token) {
|
57
|
-
cookies.remove("authToken", { path: "/" });
|
58
|
-
window.location.href = "/home";
|
59
|
-
}
|
60
|
-
};
|
61
|
-
const handleUser = () => {
|
62
|
-
setusermodalopen(true);
|
63
|
-
setIsOpen(false);
|
64
|
-
};
|
65
|
-
|
66
|
-
return (
|
67
|
-
<header
|
68
|
-
className={`relative ${
|
69
|
-
isDarkMode
|
70
|
-
? "bg-globalBg border-b border-gray-700"
|
71
|
-
: "bg-white border-b border-gray-200"
|
72
|
-
}`}
|
73
|
-
>
|
74
|
-
<div
|
75
|
-
className={` pl-4 pr-4 mx-auto ${
|
76
|
-
isDarkMode ? "bg-globalBg " : "bg-[#ffff]"
|
77
|
-
}`}
|
78
|
-
>
|
79
|
-
<div className="flex items-center justify-between ">
|
80
|
-
{/* Logo */}
|
81
|
-
<div>
|
82
|
-
<a
|
83
|
-
href="/home"
|
84
|
-
onClick={(event) => handleNavigation(event, "/home")}
|
85
|
-
className="flex items-center justify-between gap-4"
|
86
|
-
>
|
87
|
-
<img
|
88
|
-
className="w-auto h-14 sm:h-10 md:h-14 lg:h-14"
|
89
|
-
src={img}
|
90
|
-
alt="Logo"
|
91
|
-
/>
|
92
|
-
<span className="text-2xl font-semibold bg-gradient-to-r from-red-500 to-yellow-400 bg-clip-text text-transparent">
|
93
|
-
{name}
|
94
|
-
</span>
|
95
|
-
</a>
|
96
|
-
</div>
|
97
|
-
<div className="md:hidden lg:hidden">
|
98
|
-
<button
|
99
|
-
onClick={() => setIsOpen(!isOpen)}
|
100
|
-
type="button"
|
101
|
-
className={`${isDarkMode ? " text-white" : "text-black"}`}
|
102
|
-
aria-label="toggle menu"
|
103
|
-
>
|
104
|
-
{!isOpen ? (
|
105
|
-
<svg
|
106
|
-
xmlns="http://www.w3.org/2000/svg"
|
107
|
-
className="w-6 h-6"
|
108
|
-
fill="none"
|
109
|
-
viewBox="0 0 24 24"
|
110
|
-
stroke="currentColor"
|
111
|
-
strokeWidth="2"
|
112
|
-
>
|
113
|
-
<path
|
114
|
-
strokeLinecap="round"
|
115
|
-
strokeLinejoin="round"
|
116
|
-
d="M4 8h16M4 16h16"
|
117
|
-
/>
|
118
|
-
</svg>
|
119
|
-
) : (
|
120
|
-
<svg
|
121
|
-
xmlns="http://www.w3.org/2000/svg"
|
122
|
-
className="w-6 h-6"
|
123
|
-
fill="none"
|
124
|
-
viewBox="0 0 24 24"
|
125
|
-
stroke="currentColor"
|
126
|
-
strokeWidth="2"
|
127
|
-
>
|
128
|
-
<path
|
129
|
-
strokeLinecap="round"
|
130
|
-
strokeLinejoin="round"
|
131
|
-
d="M6 18L18 6M6 6l12 12"
|
132
|
-
/>
|
133
|
-
</svg>
|
134
|
-
)}
|
135
|
-
</button>
|
136
|
-
</div>
|
137
|
-
|
138
|
-
<div
|
139
|
-
className={` ${
|
140
|
-
isOpen ? "translate-x-0" : "translate-x-full md:translate-x-0"
|
141
|
-
}
|
142
|
-
transform transition-transform duration-300 ease-in-out w-full md:w-auto mt-20 md:mt-0 fixed md:relative top-0 right-0 md:top-auto md:bg-transparent md:h-auto z-50 md:z-auto ${
|
143
|
-
isOpen
|
144
|
-
? isDarkMode
|
145
|
-
? "bg-[#2e2e2e] text-[#ffff]"
|
146
|
-
: "bg-[#ffff] text-black"
|
147
|
-
: ""
|
148
|
-
}`}
|
149
|
-
>
|
150
|
-
<div className=" flex flex-col md:flex-row md:items-center md:space-x-4 p-4 md:p-0 mr-3">
|
151
|
-
<a
|
152
|
-
href="/home"
|
153
|
-
onClick={(event) => handleNavigation(event, "/home")}
|
154
|
-
className={`px-2 py-1 rounded-md ${
|
155
|
-
isActive("/home")
|
156
|
-
? "bg-blue-500 text-white"
|
157
|
-
: isDarkMode
|
158
|
-
? "text-white hover:bg-gray-600"
|
159
|
-
: "text-black hover:bg-gray-200"
|
160
|
-
}`}
|
161
|
-
>
|
162
|
-
Home
|
163
|
-
</a>
|
164
|
-
<a
|
165
|
-
href="/about"
|
166
|
-
onClick={(event) => handleNavigation(event, "/about")}
|
167
|
-
className={`px-2 py-1 rounded-md ${
|
168
|
-
isActive("/about")
|
169
|
-
? "bg-blue-500 text-white"
|
170
|
-
: isDarkMode
|
171
|
-
? "text-white hover:bg-gray-600"
|
172
|
-
: "text-black hover:bg-gray-200"
|
173
|
-
}`}
|
174
|
-
>
|
175
|
-
About Us
|
176
|
-
</a>
|
177
|
-
<a
|
178
|
-
href="/contact"
|
179
|
-
onClick={(event) => handleNavigation(event, "/contact")}
|
180
|
-
className={`px-2 py-1 rounded-md ${
|
181
|
-
isActive("/contact")
|
182
|
-
? "bg-blue-500 text-white"
|
183
|
-
: isDarkMode
|
184
|
-
? "text-white hover:bg-gray-600"
|
185
|
-
: "text-black hover:bg-gray-200"
|
186
|
-
}`}
|
187
|
-
>
|
188
|
-
Contact Us
|
189
|
-
</a>
|
190
|
-
{userLogedin ? (
|
191
|
-
<div className="relative">
|
192
|
-
<div
|
193
|
-
className={`px-3 py-1 h-20 rounded-md md:flex items-center ${
|
194
|
-
isDarkMode ? "text-white" : "text-black"
|
195
|
-
} hidden `}
|
196
|
-
onMouseEnter={() => setShowUserCard(true)}
|
197
|
-
>
|
198
|
-
<div className="w-6 h-6 flex items-center justify-center">
|
199
|
-
<IconWrapper style={{ width: "50px", height: "20px" }} />
|
200
|
-
</div>
|
201
|
-
</div>
|
202
|
-
|
203
|
-
{/* Dropdown menu */}
|
204
|
-
{showUserCard && (
|
205
|
-
<div
|
206
|
-
className={`absolute top-16 right-0 p-2 w-52 shadow-lg rounded-lg border border-gray-200 hidden sm:block ${
|
207
|
-
isDarkMode
|
208
|
-
? "bg-[#2e2e2e] border-gray-700"
|
209
|
-
: "bg-[#ffff] border-gray-200"
|
210
|
-
}`}
|
211
|
-
onMouseEnter={() => setShowUserCard(true)}
|
212
|
-
onMouseLeave={() => setShowUserCard(false)}
|
213
|
-
>
|
214
|
-
{userType === 2 && (
|
215
|
-
<p
|
216
|
-
onClick={(event) => {
|
217
|
-
handleNavigation(event, "/admin");
|
218
|
-
event.currentTarget.parentElement.classList.add(
|
219
|
-
"hidden"
|
220
|
-
);
|
221
|
-
}}
|
222
|
-
className={`cursor-pointer block px-4 py-2 rounded-md hover:bg-blue-400 transition-colors duration-200 ${
|
223
|
-
isDarkMode
|
224
|
-
? "text-white hover:bg-gray-600"
|
225
|
-
: "text-black hover:bg-gray-200"
|
226
|
-
}`}
|
227
|
-
>
|
228
|
-
Admin
|
229
|
-
</p>
|
230
|
-
)}
|
231
|
-
<p
|
232
|
-
onClick={(event) => {
|
233
|
-
setusermodalopen(true);
|
234
|
-
event.currentTarget.parentElement.classList.add(
|
235
|
-
"hidden"
|
236
|
-
);
|
237
|
-
}}
|
238
|
-
className={`cursor-pointer block px-4 py-2 rounded-md hover:bg-blue-400 transition-colors duration-200 ${
|
239
|
-
isDarkMode
|
240
|
-
? "text-white hover:bg-gray-600"
|
241
|
-
: "text-black hover:bg-gray-200"
|
242
|
-
}`}
|
243
|
-
>
|
244
|
-
Update Details
|
245
|
-
</p>
|
246
|
-
<p
|
247
|
-
onClick={(event) => {
|
248
|
-
handleLogout();
|
249
|
-
event.currentTarget.parentElement.classList.add(
|
250
|
-
"hidden"
|
251
|
-
);
|
252
|
-
}}
|
253
|
-
className={`cursor-pointer block px-4 py-2 rounded-md hover:bg-blue-400 transition-colors duration-200 ${
|
254
|
-
isDarkMode
|
255
|
-
? "text-white hover:bg-gray-600"
|
256
|
-
: "text-black hover:bg-gray-200"
|
257
|
-
}`}
|
258
|
-
>
|
259
|
-
Logout
|
260
|
-
</p>
|
261
|
-
</div>
|
262
|
-
)}
|
263
|
-
|
264
|
-
{/* Direct menu for mobile view */}
|
265
|
-
<div className="sm:hidden">
|
266
|
-
{userType === 2 && (
|
267
|
-
<p
|
268
|
-
onClick={(event) => handleNavigation(event, "/admin")}
|
269
|
-
className={`cursor-pointer block pl-2 py-2 rounded-md hover:bg-blue-400 transition-colors duration-200 ${
|
270
|
-
isDarkMode
|
271
|
-
? "text-white hover:bg-gray-600"
|
272
|
-
: "text-black hover:bg-gray-200"
|
273
|
-
}`}
|
274
|
-
>
|
275
|
-
Admin
|
276
|
-
</p>
|
277
|
-
)}
|
278
|
-
<p
|
279
|
-
onClick={handleUser}
|
280
|
-
className={`cursor-pointer block pl-2 py-2 rounded-md hover:bg-blue-400 transition-colors duration-200 ${
|
281
|
-
isDarkMode
|
282
|
-
? "text-white hover:bg-gray-600"
|
283
|
-
: "text-black hover:bg-gray-200"
|
284
|
-
}`}
|
285
|
-
>
|
286
|
-
Update Details
|
287
|
-
</p>
|
288
|
-
<p
|
289
|
-
onClick={handleLogout}
|
290
|
-
className={`cursor-pointer block pl-2 py-2 rounded-md hover:bg-blue-400 transition-colors duration-200 ${
|
291
|
-
isDarkMode
|
292
|
-
? "text-white hover:bg-gray-600"
|
293
|
-
: "text-black hover:bg-gray-200"
|
294
|
-
}`}
|
295
|
-
>
|
296
|
-
Logout
|
297
|
-
</p>
|
298
|
-
</div>
|
299
|
-
</div>
|
300
|
-
) : (
|
301
|
-
<a
|
302
|
-
href="/login"
|
303
|
-
onClick={(event) => handleNavigation(event, "/login")}
|
304
|
-
className={`px-2 py-1 rounded-md ${
|
305
|
-
isActive("/login")
|
306
|
-
? "bg-blue-500 text-white"
|
307
|
-
: isDarkMode
|
308
|
-
? "text-white hover:bg-gray-600"
|
309
|
-
: "text-black hover:bg-gray-200"
|
310
|
-
}`}
|
311
|
-
>
|
312
|
-
Login
|
313
|
-
</a>
|
314
|
-
)}
|
315
|
-
|
316
|
-
<button
|
317
|
-
onClick={() => handleDark()}
|
318
|
-
className={`md:px-3 pl-1 py-1 md:border-2 rounded-md transition-transform transform hover:scale-95 duration-300 ${
|
319
|
-
isDarkMode
|
320
|
-
? "text-white border-white"
|
321
|
-
: "text-black border-black"
|
322
|
-
}`}
|
323
|
-
>
|
324
|
-
{isDarkMode ? <CiDark /> : <CiLight />}
|
325
|
-
</button>
|
326
|
-
</div>
|
327
|
-
</div>
|
328
|
-
</div>
|
329
|
-
</div>
|
330
|
-
<UpdateUserDetails
|
331
|
-
usermodalopen={usermodalopen}
|
332
|
-
closeusermodal={() => setusermodalopen(false)}
|
333
|
-
url={url}
|
334
|
-
isDarkMode={isDarkMode}
|
335
|
-
/>
|
336
|
-
</header>
|
337
|
-
);
|
338
|
-
};
|
339
|
-
|
340
|
-
export default Header;
|