diff --git a/.env b/.env
index ea61219..78f19ee 100644
--- a/.env
+++ b/.env
@@ -1,4 +1,5 @@
-VITE_API_URL=https://ssa.betadelivery.com/apia/v1
+VITE_API_URL='https://ssa.betadelivery.com/apia/v1'
+# VITE_API_URL='http://192.16.50.44/seo-backend/apia/v1'
VITE_USER_NAME="Admin"
-VITE_PASSWORD="71%@L%es^bUX94`J9XT*%4&^%tUU^%Q^ffgt"
+VITE_PASSWORD="71%@L%es^bUX94`J9XT*@bh,._WWM{$%^^&&"
VITE_APP_NAME=MyViteApp
\ No newline at end of file
diff --git a/dev-dist/sw.js b/dev-dist/sw.js
index 0ae4473..2892c8c 100644
--- a/dev-dist/sw.js
+++ b/dev-dist/sw.js
@@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict';
"revision": "3ca0b8505b4bec776b69afdba2768812"
}, {
"url": "index.html",
- "revision": "0.86j4c86n9j8"
+ "revision": "0.s1fup7lrbig"
}], {});
workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
diff --git a/package-lock.json b/package-lock.json
index 9005efe..0a1160c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -15,6 +15,7 @@
"axios": "^1.7.9",
"chart.js": "^4.4.7",
"framer-motion": "^11.18.0",
+ "js-cookie": "^3.0.5",
"next-themes": "^0.4.4",
"react": "^18.3.1",
"react-chartjs-2": "^5.3.0",
@@ -28,6 +29,7 @@
"devDependencies": {
"@chakra-ui/cli": "^3.2.3",
"@eslint/js": "^9.17.0",
+ "@types/js-cookie": "^3.0.6",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@vitejs/plugin-react": "^4.3.4",
@@ -3248,6 +3250,13 @@
"integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==",
"license": "MIT"
},
+ "node_modules/@types/js-cookie": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/@types/js-cookie/-/js-cookie-3.0.6.tgz",
+ "integrity": "sha512-wkw9yd1kEXOPnvEeEV1Go1MmxtBJL0RR79aOTAApecWFVu7w0NNXNqhcWgvw2YgZDYadliXkl14pa3WXw5jlCQ==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@types/json-schema": {
"version": "7.0.15",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
@@ -7349,6 +7358,15 @@
"node": ">=10"
}
},
+ "node_modules/js-cookie": {
+ "version": "3.0.5",
+ "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.5.tgz",
+ "integrity": "sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=14"
+ }
+ },
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
diff --git a/package.json b/package.json
index aef7be3..af0444f 100644
--- a/package.json
+++ b/package.json
@@ -17,6 +17,7 @@
"axios": "^1.7.9",
"chart.js": "^4.4.7",
"framer-motion": "^11.18.0",
+ "js-cookie": "^3.0.5",
"next-themes": "^0.4.4",
"react": "^18.3.1",
"react-chartjs-2": "^5.3.0",
@@ -30,6 +31,7 @@
"devDependencies": {
"@chakra-ui/cli": "^3.2.3",
"@eslint/js": "^9.17.0",
+ "@types/js-cookie": "^3.0.6",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@vitejs/plugin-react": "^4.3.4",
diff --git a/src/App.tsx b/src/App.tsx
index fa6affb..b9302aa 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -14,7 +14,7 @@ function App() {
} />
- {RouteLink.map(({ path, Component }, index) => (} />))}) : ()} />
+ {RouteLink.map(({ path, Component }, index) => (} />))}) : ()} />
} />
diff --git a/src/Contexts/GlobalStateProvider.tsx b/src/Contexts/GlobalStateProvider.tsx
index 9a839de..105a8cb 100644
--- a/src/Contexts/GlobalStateProvider.tsx
+++ b/src/Contexts/GlobalStateProvider.tsx
@@ -1,11 +1,11 @@
-import { ReactNode, useState } from 'react';
+import { ReactNode, useState } from 'react';
import GlobalStateContext from './GlobalStateContext';
-const GlobalStateProvider = ({ children }:{children:ReactNode}) => {
- const [isAuthenticate, setIsAuthenticate] = useState(false);
+const GlobalStateProvider = ({ children }: { children: ReactNode }) => {
+ const [isAuthenticate, setIsAuthenticate] = useState(true);
return (
diff --git a/src/Layouts/DefaultLayout.tsx b/src/Layouts/DefaultLayout.tsx
index b52e7d5..2e63eae 100644
--- a/src/Layouts/DefaultLayout.tsx
+++ b/src/Layouts/DefaultLayout.tsx
@@ -6,8 +6,12 @@ import { nav } from "../Routes/Nav";
import logo from '../assets/logo.svg';
import { AccordionItem, AccordionItemContent, AccordionItemTrigger, AccordionRoot } from "../components/ui/accordion";
import { Avatar } from "../components/ui/avatar";
+import { LuLogOut } from "react-icons/lu";
+import { logout, setToken } from "../Redux/Service/authSlice";
+import { useDispatch } from "react-redux";
const DefaultLayout: FC<{ children: React.ReactNode }> = ({ children }) => {
+ const dispatch = useDispatch()
const navigate = useNavigate()
const location = useLocation()
@@ -15,25 +19,31 @@ const DefaultLayout: FC<{ children: React.ReactNode }> = ({ children }) => {
return (
-
+
-
+
-
+
{nav?.map(({ title, path, Icon, type, children }, index) => type === 'single' ?
{title} :
-
+
navigate(path)} gap={0} style={{ cursor: 'pointer', borderRadius: '8px', padding: '5px', width: '100%', display: 'flex', alignItems: 'center', border: '1px solid #ffffff', backgroundColor:'#fff',color:'#000', fontSize: '14px', }}> {title}
{children?.map(({ title, path, Icon }, index) => navigate(path)} style={{ marginTop: 6, cursor: 'pointer', borderRadius: '8px', padding: '6px', width: '100%', display: 'flex', alignItems: 'center', gap: 6, border: '1px solid #ffffff', backgroundColor:'#fff',color:'#919198' }} > {title})}
)}
+
+
+ {dispatch(logout()), navigate('/login')}} className="link" style={{ cursor: 'pointer', borderRadius: '8px', padding: '6px', width: '100%', display: 'flex', alignItems: 'center', gap: 6, border: '1px solid #ffffff', backgroundColor:'#fff', color:'#000', boxShadow:'rgba(99, 99, 99, 0.2) 0px 2px 8px 0px'}} > Logout
+
-
-
+
+
+
+
navigate('/profile')} >
diff --git a/src/Pages/Dashboard/Dashboard.tsx b/src/Pages/Dashboard/Dashboard.tsx
index 056fa6c..10539a7 100644
--- a/src/Pages/Dashboard/Dashboard.tsx
+++ b/src/Pages/Dashboard/Dashboard.tsx
@@ -67,8 +67,8 @@ const Dashboard = () => {
return (
-
-
+
+
Total Users
@@ -117,6 +117,7 @@ const Dashboard = () => {
@@ -140,13 +141,14 @@ const Dashboard = () => {
w={"20%"}
boxShadow={"rgba(99, 99, 99, 0.2) 0px 2px 8px 0px"}
p={'10px'}
+ rounded={'lg'}
>
Number Of Groups created
-
-
+
+
Faqs
-
+
diff --git a/src/Pages/Login.tsx b/src/Pages/Login.tsx
index f1cea2d..77c63cf 100644
--- a/src/Pages/Login.tsx
+++ b/src/Pages/Login.tsx
@@ -9,6 +9,8 @@ import logo from '../assets/logo.svg'
import { Button } from "../components/ui/button"
import { Field } from "../components/ui/field"
import { Toaster } from "../components/ui/toaster"
+import { PasswordInput } from "../components/ui/password-input"
+import { useNavigate } from "react-router-dom"
interface FormValues {
mobileNumber: number
@@ -16,6 +18,7 @@ interface FormValues {
}
const Login = () => {
+ const navigate = useNavigate()
const dispatch = useDispatch()
const [isLoading, setIsLoading] = useState(false)
const context = useContext(GlobalStateContext);
@@ -33,15 +36,15 @@ const Login = () => {
setIsLoading(true);
// Encode Basic Auth Credentials
- const username = import.meta.env.VITE_USER_NAME || ''; // Replace with actual username
- const password = import.meta.env.VITE_PASSWORD || ''; // Replace with actual password
- const basicAuth = btoa(`${username}:${password}`); // Encode to Base64
-
+ const username = import.meta.env.VITE_USER_NAME||''; // Replace with actual username
+ const password = import.meta.env.VITE_PASSWORD||''; // Replace with actual password
+ const basicAuth = `${username} : ${password}`; // Encode to Base64
+
try {
- const response = await axios.post(
- `${import.meta.env.VITE_API_URL}/v1/login`,
+ const res = await axios.post(
+ `${import.meta.env.VITE_API_URL}/login`,
{
- mobile_number: data.mobileNumber,
+ mobile_number: Number(data.mobileNumber),
password: data.password,
},
{
@@ -53,10 +56,21 @@ const Login = () => {
}
);
- console.log("====================================");
- console.log(response);
- console.log("====================================");
- dispatch(setToken(String(response.data["access-token"])));
+ if (res.data) {
+ setIsAuthenticate(true)
+ console.log('====================================');
+ console.log(res.data?.data);
+ console.log('====================================');
+ navigate('/')
+ dispatch(setToken(String(res.data?.data["access-token"])));
+ } else {
+
+ console.log("====================================");
+ console.log(res);
+ console.log("====================================");
+
+ }
+
} catch (error) {
if (error) {
@@ -102,12 +116,12 @@ const Login = () => {
-
- {/* Forget password */}
+
+ {/* Forget password */}
-
-
- {/* Forget password */}
+
+
+ {/* Forget password */}
diff --git a/src/Pages/ManageCMS/AboutUs/AboutUs.tsx b/src/Pages/ManageCMS/AboutUs/AboutUs.tsx
index a080942..c704868 100644
--- a/src/Pages/ManageCMS/AboutUs/AboutUs.tsx
+++ b/src/Pages/ManageCMS/AboutUs/AboutUs.tsx
@@ -2,9 +2,18 @@ import { Box, HStack, Text } from "@chakra-ui/react";
import MainFrame from "../../../components/MainFrame"
import { p } from "framer-motion/client";
import AboutUsAddModel from "../../ManageCMS/AboutUs/AboutUsAddModel";
+import { useGetAboutUsQuery } from "../../../Redux/Service/manage.aboutus.service";
const AboutUs = () => {
+
+ const {
+ data
+ } = useGetAboutUsQuery()
+
+ console.log('====================================');
+ console.log(data);
+ console.log('====================================');
return (
diff --git a/src/Pages/ManageContact/ManageContact.tsx b/src/Pages/ManageContact/ManageContact.tsx
index e3bd9d6..d4d44ed 100644
--- a/src/Pages/ManageContact/ManageContact.tsx
+++ b/src/Pages/ManageContact/ManageContact.tsx
@@ -25,7 +25,6 @@ const managepost: any[] = [
"Action": (
-
),
})),
diff --git a/src/Pages/ManageContact/PendingRequests.tsx b/src/Pages/ManageContact/PendingRequests.tsx
index 23d566b..9356979 100644
--- a/src/Pages/ManageContact/PendingRequests.tsx
+++ b/src/Pages/ManageContact/PendingRequests.tsx
@@ -1,77 +1,105 @@
-import { Button } from "../../components/ui/button"
-import { DialogBody, DialogCloseTrigger, DialogContent, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger } from "../../components/ui/dialog"
-import { Field, HStack, Input, Stack, Textarea, } from "@chakra-ui/react"
+import { Button } from "../../components/ui/button";
+import {
+ DialogBody,
+ DialogCloseTrigger,
+ DialogContent,
+ DialogFooter,
+ DialogHeader,
+ DialogRoot,
+ DialogTitle,
+ DialogTrigger,
+} from "../../components/ui/dialog";
+import { Badge, Field, HStack, Input, Stack, Textarea } from "@chakra-ui/react";
function PendingRequests() {
- return (
+ return (
+
+
+
+ Answer request
+
+
-
-
-
- {/* */}
+
+
+
+ Pending Requests
+
+
-
+
+
+
+
+ Request Type
+
+
-
+ Solution
+
+
+
+
+
+
+
+
+
+
+
-
-
-
- Request Type
-
-
- Solution
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
+
+
+
+ );
}
-export default PendingRequests
\ No newline at end of file
+export default PendingRequests;
diff --git a/src/Pages/ManagePost/ManagePost.tsx b/src/Pages/ManagePost/ManagePost.tsx
index ec47225..9f57344 100644
--- a/src/Pages/ManagePost/ManagePost.tsx
+++ b/src/Pages/ManagePost/ManagePost.tsx
@@ -32,7 +32,7 @@ const managepost: any[] = [
),
"Description": (
- {`Lorem ipsum dolor, sit amet consectetur adipisicing elit.`.slice(0, 30) + '...'}
+ {`Lorem ipsum dolor, sit amet consectetur adipisicing elit.}`.slice(0, 30) + '...'}
),
"Publish Data": "12/01/2025",
"Activate/Deactivate": (
diff --git a/src/Pages/ManageUsers/RegisterUsers/RegisterUsers.tsx b/src/Pages/ManageUsers/RegisterUsers/RegisterUsers.tsx
index 4bf7247..7a6c6f2 100644
--- a/src/Pages/ManageUsers/RegisterUsers/RegisterUsers.tsx
+++ b/src/Pages/ManageUsers/RegisterUsers/RegisterUsers.tsx
@@ -1,17 +1,13 @@
import { Box, HStack, Image, Input, Text } from "@chakra-ui/react";
import MainFrame from "../../../components/MainFrame";
import AlertDailog from "../../../components/AlertDailog";
-import { NavLink } from "react-router-dom";
import { RiDeleteBin5Line } from "react-icons/ri";
import DataTable from "../../../components/DataTable";
import { Switch } from "../../../components/ui/switch";
import { InputGroup } from "../../../components/ui/input-group";
import { LuSearch } from "react-icons/lu";
-import { BiEdit } from "react-icons/bi";
import ViewRegisterUsers from "./ViewRegisterUsers";
import EditRegisterUsers from "./EditRegisterUsers";
-import { Button } from "../../../components/ui/button";
-import { IoMdAdd } from "react-icons/io";
import AddRegisterUsers from "./AddRegisterUsers";
const tableHeadRow = [
@@ -41,7 +37,7 @@ const registerUser: any[] = [
),
"Action": (
-
+
{/* */}
@@ -74,7 +70,7 @@ const RegisterUsers = () => {
Register Users
-
+
diff --git a/src/Pages/SubAdmin/AddModel.tsx b/src/Pages/SubAdmin/AddModel.tsx
index 403549b..5fab47e 100644
--- a/src/Pages/SubAdmin/AddModel.tsx
+++ b/src/Pages/SubAdmin/AddModel.tsx
@@ -12,7 +12,7 @@ function AddModel() {
{/* */}
-
+
@@ -65,7 +65,7 @@ function AddModel() {
-
diff --git a/src/Pages/SubAdmin/SubAdmin.tsx b/src/Pages/SubAdmin/SubAdmin.tsx
index 4fa4c0e..974216f 100644
--- a/src/Pages/SubAdmin/SubAdmin.tsx
+++ b/src/Pages/SubAdmin/SubAdmin.tsx
@@ -33,14 +33,9 @@ const managepost: any[] = [
"Action": (
- {/* */}
- {/* */}
- {/* */}
-
+ {/*
Save
-
+ */}
diff --git a/src/Redux/Service/apiSlice.tsx b/src/Redux/Service/apiSlice.tsx
index cc8ae3a..13eb4e6 100644
--- a/src/Redux/Service/apiSlice.tsx
+++ b/src/Redux/Service/apiSlice.tsx
@@ -6,17 +6,26 @@ import { RootState } from "../Store";
const baseQuery = fetchBaseQuery({
baseUrl: `${import.meta.env.VITE_API_URL}`,
prepareHeaders: (headers, { getState }) => {
+
const token = (getState() as RootState).auth.token; // Get token from Redux store
+ // Encode Basic Auth Credentials
+ const username = import.meta.env.VITE_USER_NAME||''; // Replace with actual username
+ const password = import.meta.env.VITE_PASSWORD||''; // Replace with actual password
+ const basicAuth = `${username} : ${password}`; // Encode to Base64
+
if (token) {
- headers.set("Authorization", `Bearer ${token}`);
+ headers.set("Authorization", `Basic ${basicAuth}`);
+ headers.set("access-token", `${token}`);
+
}
headers.set("Content-Type", "application/json");
return headers;
},
});
+
// ✅ Handle 401 Errors (Auto Logout)
-const baseQueryWithReauth: BaseQueryFn<
+export const baseQueryWithReauth: BaseQueryFn<
string | FetchArgs,
unknown,
FetchBaseQueryError
@@ -30,7 +39,10 @@ const baseQueryWithReauth: BaseQueryFn<
return result;
};
-export const apiSlice = createApi({
+
+
+
+export const dashboard = createApi({
reducerPath: "api",
baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
endpoints: (builder) => ({
@@ -46,7 +58,7 @@ export const apiSlice = createApi({
}),
});
-export const { useGetPostsQuery } = apiSlice;
+export const { useGetPostsQuery } = dashboard;
export type Post = {
id: number;
diff --git a/src/Redux/Service/authSlice.tsx b/src/Redux/Service/authSlice.tsx
index 70c9952..a5f1888 100644
--- a/src/Redux/Service/authSlice.tsx
+++ b/src/Redux/Service/authSlice.tsx
@@ -5,8 +5,13 @@ type AuthState = {
};
const initialState: AuthState = {
+<<<<<<< HEAD
token: localStorage.getItem("token"), // Load token from localStorage
};
+=======
+ token: localStorage.getItem("token") || null, // ✅ Ensures token is either a string or null
+};
+>>>>>>> 7a7aeab5b877a665b488245d14c520a0dc3df1c9
const authSlice = createSlice({
name: "auth",
@@ -14,11 +19,11 @@ const authSlice = createSlice({
reducers: {
setToken: (state, action: PayloadAction) => {
state.token = action.payload;
- localStorage.setItem("token", action.payload);
+ localStorage.setItem("token", action.payload); // ✅ Store token in localStorage
},
logout: (state) => {
state.token = null;
- localStorage.removeItem("token");
+ localStorage.removeItem("token"); // ✅ Remove token from localStorage on logout
},
},
});
diff --git a/src/Redux/Service/deactivated.account.service.ts b/src/Redux/Service/deactivated.account.service.ts
new file mode 100644
index 0000000..da76c97
--- /dev/null
+++ b/src/Redux/Service/deactivated.account.service.ts
@@ -0,0 +1,26 @@
+import { createApi } from "@reduxjs/toolkit/query";
+import { baseQueryWithReauth } from "./apiSlice";
+
+export const deactivatedAccounts = createApi({
+ reducerPath: "deactivatedAccounts",
+ baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
+ endpoints: (builder) => ({
+
+
+
+ getPosts: builder.query({ query: () => "/posts" }),
+
+
+
+
+
+ }),
+ });
+
+ export const { } = deactivatedAccounts;
+
+ export type Post = {
+ id: number;
+ title: string;
+ body: string;
+ };
\ No newline at end of file
diff --git a/src/Redux/Service/faqs.service.ts b/src/Redux/Service/faqs.service.ts
new file mode 100644
index 0000000..d232234
--- /dev/null
+++ b/src/Redux/Service/faqs.service.ts
@@ -0,0 +1,26 @@
+import { createApi } from "@reduxjs/toolkit/query";
+import { baseQueryWithReauth } from "./apiSlice";
+
+export const faqs = createApi({
+ reducerPath: "faqs",
+ baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
+ endpoints: (builder) => ({
+
+
+
+ getPosts: builder.query({ query: () => "/posts" }),
+
+
+
+
+
+ }),
+ });
+
+ export const { } = faqs;
+
+ export type Post = {
+ id: number;
+ title: string;
+ body: string;
+ };
\ No newline at end of file
diff --git a/src/Redux/Service/manage.aboutus.service.ts b/src/Redux/Service/manage.aboutus.service.ts
new file mode 100644
index 0000000..300f497
--- /dev/null
+++ b/src/Redux/Service/manage.aboutus.service.ts
@@ -0,0 +1,85 @@
+import { createApi } from "@reduxjs/toolkit/query/react";
+import { baseQueryWithReauth } from "./apiSlice";
+
+export const aboutUs = createApi({
+ reducerPath: "aboutUs",
+ baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
+ endpoints: (builder) => ({
+
+
+
+ // 🔹 GET: Fetch all posts
+ getAboutUs: builder.query({
+ query: () => "/about-us",
+ }),
+
+
+
+
+
+ // 🔹 GET: Fetch a single post by ID
+ getPostById: builder.query({
+ query: (id) => `/posts/${id}`,
+ }),
+
+ // 🔹 POST: Create a new post
+ createPost: builder.mutation>({
+ query: (newPost) => ({
+ url: "/posts",
+ method: "POST",
+ body: newPost,
+ }),
+ }),
+
+ // 🔹 PUT: Update an existing post
+ updatePost: builder.mutation }>({
+ query: ({ id, updatedData }) => ({
+ url: `/posts/${id}`,
+ method: "PUT",
+ body: updatedData,
+ }),
+ }),
+
+ // 🔹 DELETE: Remove a post by ID
+ deletePost: builder.mutation<{ success: boolean }, number>({
+ query: (id) => ({
+ url: `/posts/${id}`,
+ method: "DELETE",
+ }),
+ }),
+ }),
+});
+
+export const {
+ useGetAboutUsQuery,
+
+
+
+
+
+
+
+
+
+
+
+ useGetPostByIdQuery,
+ useCreatePostMutation,
+ useUpdatePostMutation,
+ useDeletePostMutation
+} = aboutUs;
+
+// Define Post type
+export type Post = {
+ id: number;
+ title: string;
+ body: string;
+};
+
+
+export type AboutUs = {
+ id: number;
+ language_master_xid: number;
+ content: string;
+ is_active: boolean;
+};
diff --git a/src/Redux/Service/manage.contactus.service.ts b/src/Redux/Service/manage.contactus.service.ts
new file mode 100644
index 0000000..20b3890
--- /dev/null
+++ b/src/Redux/Service/manage.contactus.service.ts
@@ -0,0 +1,26 @@
+import { createApi } from "@reduxjs/toolkit/query";
+import { baseQueryWithReauth } from "./apiSlice";
+
+export const manageContactUs = createApi({
+ reducerPath: "manageContactUs",
+ baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
+ endpoints: (builder) => ({
+
+
+
+ getPosts: builder.query({ query: () => "/posts" }),
+
+
+
+
+
+ }),
+ });
+
+ export const { } = manageContactUs;
+
+ export type Post = {
+ id: number;
+ title: string;
+ body: string;
+ };
\ No newline at end of file
diff --git a/src/Redux/Service/manage.groups.service.ts b/src/Redux/Service/manage.groups.service.ts
new file mode 100644
index 0000000..32df1aa
--- /dev/null
+++ b/src/Redux/Service/manage.groups.service.ts
@@ -0,0 +1,26 @@
+import { createApi } from "@reduxjs/toolkit/query";
+import { baseQueryWithReauth } from "./apiSlice";
+
+export const manageGroups = createApi({
+ reducerPath: "manageGroups",
+ baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
+ endpoints: (builder) => ({
+
+
+
+ getPosts: builder.query({ query: () => "/posts" }),
+
+
+
+
+
+ }),
+ });
+
+ export const { } = manageGroups;
+
+ export type Post = {
+ id: number;
+ title: string;
+ body: string;
+ };
\ No newline at end of file
diff --git a/src/Redux/Service/manage.jobs.service.ts b/src/Redux/Service/manage.jobs.service.ts
new file mode 100644
index 0000000..c5face7
--- /dev/null
+++ b/src/Redux/Service/manage.jobs.service.ts
@@ -0,0 +1,26 @@
+import { createApi } from "@reduxjs/toolkit/query";
+import { baseQueryWithReauth } from "./apiSlice";
+
+export const manageJobs = createApi({
+ reducerPath: "manageJobs",
+ baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
+ endpoints: (builder) => ({
+
+
+
+ getPosts: builder.query({ query: () => "/posts" }),
+
+
+
+
+
+ }),
+ });
+
+ export const { } = manageJobs;
+
+ export type Post = {
+ id: number;
+ title: string;
+ body: string;
+ };
\ No newline at end of file
diff --git a/src/Redux/Service/manage.posts.service.ts b/src/Redux/Service/manage.posts.service.ts
new file mode 100644
index 0000000..d51e7ab
--- /dev/null
+++ b/src/Redux/Service/manage.posts.service.ts
@@ -0,0 +1,26 @@
+import { createApi } from "@reduxjs/toolkit/query";
+import { baseQueryWithReauth } from "./apiSlice";
+
+export const managePosts = createApi({
+ reducerPath: "managePosts",
+ baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
+ endpoints: (builder) => ({
+
+
+
+ getPosts: builder.query({ query: () => "/posts" }),
+
+
+
+
+
+ }),
+ });
+
+ export const { } = managePosts;
+
+ export type Post = {
+ id: number;
+ title: string;
+ body: string;
+ };
\ No newline at end of file
diff --git a/src/Redux/Service/manage.subadmin.service.ts b/src/Redux/Service/manage.subadmin.service.ts
new file mode 100644
index 0000000..1bc39c7
--- /dev/null
+++ b/src/Redux/Service/manage.subadmin.service.ts
@@ -0,0 +1,26 @@
+import { createApi } from "@reduxjs/toolkit/query";
+import { baseQueryWithReauth } from "./apiSlice";
+
+export const manageSubAdmin = createApi({
+ reducerPath: "manageSubAdmin",
+ baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
+ endpoints: (builder) => ({
+
+
+
+ getPosts: builder.query({ query: () => "/posts" }),
+
+
+
+
+
+ }),
+ });
+
+ export const { } = manageSubAdmin;
+
+ export type Post = {
+ id: number;
+ title: string;
+ body: string;
+ };
\ No newline at end of file
diff --git a/src/Redux/Service/master.module.service.ts b/src/Redux/Service/master.module.service.ts
new file mode 100644
index 0000000..d709379
--- /dev/null
+++ b/src/Redux/Service/master.module.service.ts
@@ -0,0 +1,26 @@
+import { createApi } from "@reduxjs/toolkit/query";
+import { baseQueryWithReauth } from "./apiSlice";
+
+export const masterModule = createApi({
+ reducerPath: "masterModule",
+ baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
+ endpoints: (builder) => ({
+
+
+
+ getPosts: builder.query({ query: () => "/posts" }),
+
+
+
+
+
+ }),
+ });
+
+ export const { } = masterModule;
+
+ export type Post = {
+ id: number;
+ title: string;
+ body: string;
+ };
\ No newline at end of file
diff --git a/src/Redux/Service/myprofie.service.ts b/src/Redux/Service/myprofie.service.ts
new file mode 100644
index 0000000..05748fb
--- /dev/null
+++ b/src/Redux/Service/myprofie.service.ts
@@ -0,0 +1,26 @@
+import { createApi } from "@reduxjs/toolkit/query";
+import { baseQueryWithReauth } from "./apiSlice";
+
+export const myProfile = createApi({
+ reducerPath: "myProfile",
+ baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
+ endpoints: (builder) => ({
+
+
+
+ getPosts: builder.query({ query: () => "/posts" }),
+
+
+
+
+
+ }),
+ });
+
+ export const { } = myProfile;
+
+ export type Post = {
+ id: number;
+ title: string;
+ body: string;
+ };
\ No newline at end of file
diff --git a/src/Redux/Service/privacy.policy.service.ts b/src/Redux/Service/privacy.policy.service.ts
new file mode 100644
index 0000000..b7e3126
--- /dev/null
+++ b/src/Redux/Service/privacy.policy.service.ts
@@ -0,0 +1,26 @@
+import { createApi } from "@reduxjs/toolkit/query";
+import { baseQueryWithReauth } from "./apiSlice";
+
+export const privacyPolicy = createApi({
+ reducerPath: "privacyPolicy",
+ baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
+ endpoints: (builder) => ({
+
+
+
+ getPosts: builder.query({ query: () => "/posts" }),
+
+
+
+
+
+ }),
+ });
+
+ export const { } = privacyPolicy;
+
+ export type Post = {
+ id: number;
+ title: string;
+ body: string;
+ };
\ No newline at end of file
diff --git a/src/Redux/Service/privacy.service.ts b/src/Redux/Service/privacy.service.ts
new file mode 100644
index 0000000..9ee8b09
--- /dev/null
+++ b/src/Redux/Service/privacy.service.ts
@@ -0,0 +1,26 @@
+import { createApi } from "@reduxjs/toolkit/query";
+import { baseQueryWithReauth } from "./apiSlice";
+
+export const privacy = createApi({
+ reducerPath: "privacy",
+ baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
+ endpoints: (builder) => ({
+
+
+
+ getPosts: builder.query({ query: () => "/posts" }),
+
+
+
+
+
+ }),
+ });
+
+ export const { } = privacy;
+
+ export type Post = {
+ id: number;
+ title: string;
+ body: string;
+ };
\ No newline at end of file
diff --git a/src/Redux/Service/register.user.service.ts b/src/Redux/Service/register.user.service.ts
new file mode 100644
index 0000000..801912d
--- /dev/null
+++ b/src/Redux/Service/register.user.service.ts
@@ -0,0 +1,26 @@
+import { createApi } from "@reduxjs/toolkit/query";
+import { baseQueryWithReauth } from "./apiSlice";
+
+export const registerUser = createApi({
+ reducerPath: "registerUser",
+ baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
+ endpoints: (builder) => ({
+
+
+
+ getPosts: builder.query({ query: () => "/posts" }),
+
+
+
+
+
+ }),
+ });
+
+ export const { } = registerUser;
+
+ export type Post = {
+ id: number;
+ title: string;
+ body: string;
+ };
\ No newline at end of file
diff --git a/src/Redux/Service/terms.and.condition.service.ts b/src/Redux/Service/terms.and.condition.service.ts
new file mode 100644
index 0000000..7a7e445
--- /dev/null
+++ b/src/Redux/Service/terms.and.condition.service.ts
@@ -0,0 +1,26 @@
+import { createApi } from "@reduxjs/toolkit/query";
+import { baseQueryWithReauth } from "./apiSlice";
+
+export const termsAndCondition = createApi({
+ reducerPath: "api",
+ baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
+ endpoints: (builder) => ({
+
+
+
+ getPosts: builder.query({ query: () => "/posts" }),
+
+
+
+
+
+ }),
+ });
+
+ export const { } = termsAndCondition;
+
+ export type Post = {
+ id: number;
+ title: string;
+ body: string;
+ };
\ No newline at end of file
diff --git a/src/Redux/Store.tsx b/src/Redux/Store.tsx
index f2d8548..428a383 100644
--- a/src/Redux/Store.tsx
+++ b/src/Redux/Store.tsx
@@ -1,14 +1,54 @@
import { configureStore } from "@reduxjs/toolkit";
-import { apiSlice } from "./Service/apiSlice";
-import authReducer from "./Service/authSlice"
+import { dashboard } from "./Service/apiSlice";
+import authReducer from "./Service/authSlice";
+import { registerUser } from "./Service/register.user.service";
+import { deactivatedAccounts } from "./Service/deactivated.account.service";
+import { faqs } from "./Service/faqs.service";
+import { managePosts } from "./Service/manage.posts.service";
+import { manageSubAdmin } from "./Service/manage.subadmin.service";
+import { manageJobs } from "./Service/manage.jobs.service";
+import { manageGroups } from "./Service/manage.groups.service";
+import { manageContactUs } from "./Service/manage.contactus.service";
+import { aboutUs } from "./Service/manage.aboutus.service";
+import { privacyPolicy } from "./Service/privacy.policy.service";
+import { privacy } from "./Service/privacy.service";
+import { myProfile } from "./Service/myprofie.service";
+import { masterModule } from "./Service/master.module.service";
export const store = configureStore({
reducer: {
- [apiSlice.reducerPath]: apiSlice.reducer,
+ [dashboard.reducerPath]: dashboard.reducer,
+ [registerUser.reducerPath]: registerUser.reducer,
+ [deactivatedAccounts.reducerPath]: deactivatedAccounts.reducer,
+ [faqs.reducerPath]: faqs.reducer,
+ [managePosts.reducerPath]: managePosts.reducer,
+ [manageSubAdmin.reducerPath]: manageSubAdmin.reducer,
+ [manageJobs.reducerPath]: manageJobs.reducer,
+ [manageGroups.reducerPath]: manageGroups.reducer,
+ [manageContactUs.reducerPath]: manageContactUs.reducer,
+ [aboutUs.reducerPath]: aboutUs.reducer,
+ [privacyPolicy.reducerPath]: privacyPolicy.reducer,
+ [privacy.reducerPath]: privacy.reducer,
+ [myProfile.reducerPath]: myProfile.reducer,
+ [masterModule.reducerPath]: masterModule.reducer,
auth: authReducer,
},
middleware: (getDefaultMiddleware) =>
- getDefaultMiddleware().concat(apiSlice.middleware),
+ getDefaultMiddleware().concat(
+ dashboard.middleware,
+ deactivatedAccounts.middleware,
+ managePosts.middleware,
+ faqs.middleware,
+ manageSubAdmin.middleware,
+ manageJobs.middleware,
+ manageGroups.middleware,
+ manageContactUs.middleware,
+ aboutUs.middleware,
+ privacyPolicy.middleware,
+ privacy.middleware,
+ myProfile.middleware,
+ masterModule.middleware,
+ ),
});
export type RootState = ReturnType;
diff --git a/src/components/DataTable.tsx b/src/components/DataTable.tsx
index a291d1a..1e1faf1 100644
--- a/src/components/DataTable.tsx
+++ b/src/components/DataTable.tsx
@@ -94,7 +94,7 @@ const DataTable: React.FC = ({
>
{tableHeadRow.map((heading, colIndex) => (
+
+
+
+
+ {/* */}
+
-
-
-
-
-
- {/* */}
+
+
+
+ Edit Sub Admin Account
+
+
-
+
+
+
+
+ First Name
+
+
+
+ First Name
+
+
+
+ Last Name
+
+
-
-
- Edit Sub Admin Account
-
+
+ DOB
+
+
-
-
-
-
- First Name
-
- First Name
-
- Last Name
-
-
- DOB
-
-
- Gender
-
- Permissions
-
-
-
- Dashboard
- Manage contact us
- manage User
- Manage CMS
- Manage Post
- Manage Reports
- manage Sub-Admin
- My profile
- Manage Jobs
- manage feedbacks
- Manage community
- Notification
-
-
-
-
-
- Save
-
-
-
-
-
-
-
- )
+
+ Gender
+
+
+
+ Permissions
+
+
+
+
+ Dashboard
+
+
+ Manage contact us
+
+
+ manage User
+
+
+ Manage CMS
+
+
+ Manage Post
+
+
+ Manage Reports
+
+
+ manage Sub-Admin
+
+
+ My profile
+
+
+ Manage Jobs{" "}
+
+
+ manage feedbacks
+
+
+ Manage community{" "}
+
+
+ Notification
+
+
+
+
+
+
+ Save
+
+
+
+
+
+ );
}
-export default EditSubAdmin
\ No newline at end of file
+export default EditSubAdmin;
diff --git a/src/components/MainFrame.tsx b/src/components/MainFrame.tsx
index 575830b..2646c63 100644
--- a/src/components/MainFrame.tsx
+++ b/src/components/MainFrame.tsx
@@ -13,13 +13,13 @@ interface MainFrameProps {
const MainFrame: FC = ({ children }) => {
return (
-
+
diff --git a/src/index.css b/src/index.css
index ff86a1b..521b87f 100644
--- a/src/index.css
+++ b/src/index.css
@@ -156,12 +156,31 @@ body {
/* Border around the thumb */
}
-/* Style the scrollbar thumb on hover */
-::-webkit-scrollbar-thumb:hover {
- background-color: #555;
- /* Darker gray when hovered */
+/* Scrollbar width */
+::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+ cursor: pointer;
}
+/* Scrollbar track */
+::-webkit-scrollbar-track {
+ background: transparent; /* No visible track */
+}
+
+/* Scrollbar thumb (the draggable part) */
+::-webkit-scrollbar-thumb {
+ background: rgba(0, 0, 0, 0.3); /* Light black (30% opacity) */
+ border-radius: 10px; /* Rounded edges */
+ transition: background 0.3s;
+}
+
+/* On hover, make it darker */
+::-webkit-scrollbar-thumb:hover {
+ background: rgba(0, 0, 0, 0.5);
+}
+
+
input:focus-visible {
border: none !important;
}
diff --git a/src/main.tsx b/src/main.tsx
index 5bc746e..c983e7f 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -1,23 +1,27 @@
-import React from 'react'
-import ReactDOM from 'react-dom/client'
-import App from './App'
+import React from "react";
+import ReactDOM from "react-dom/client";
+import App from "./App";
import { Provider as ReduxProvider } from "react-redux";
-import { Provider } from './components/ui/provider'
-import GlobalStateProvider from './Contexts/GlobalStateProvider'
-import './index.css'
-import { Theme } from '@chakra-ui/react'
-import { store } from './Redux/Store'
+import { Provider } from "./components/ui/provider";
+import GlobalStateProvider from "./Contexts/GlobalStateProvider";
+import "./index.css";
+import { Theme } from "@chakra-ui/react";
+import { store } from "./Redux/Store";
-ReactDOM.createRoot(document.getElementById('root')!).render(
-
- {/* ✅ Wrap with Redux Provider */}
+ReactDOM.createRoot(document.getElementById("root")!).render(
+
+
+ {" "}
+ {/* ✅ Wrap with Redux Provider */}
- {/* ✅ Wrap with Provider */}
-
-
+
+ {" "}
+ {/* ✅ Wrap with Provider */}
+
+
-)
\ No newline at end of file
+);
diff --git a/vite.config.ts b/vite.config.ts
index 71b3004..8377a40 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -6,7 +6,7 @@ import { VitePWA } from "vite-plugin-pwa";
export default defineConfig({
server: {
host: "0.0.0.0",
- port: 3001, // You can use any port
+ port: 3000, // You can use any port
},
plugins: [
react(),