diff --git a/.env b/.env
index b24b765..78f19ee 100644
--- a/.env
+++ b/.env
@@ -1,5 +1,5 @@
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 acea9fc..a44d858 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.i87c5gdh6n"
+ "revision": "0.g82l9bbo3ro"
}], {});
workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
diff --git a/src/App.tsx b/src/App.tsx
index 2b7873a..b9302aa 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,20 +1,20 @@
+import { useContext } from 'react';
import { Route, BrowserRouter as Router, Routes } from "react-router-dom";
+import GlobalStateContext from './Contexts/GlobalStateContext';
import DefaultLayout from './Layouts/DefaultLayout';
import Login from './Pages/Login';
import { RouteLink } from './Routes/Routes';
-import Cookies from "js-cookie";
function App() {
- // const context = useContext(GlobalStateContext);
- // if (!context) throw new Error('App must be used within a GlobalStateProvider');
- // const { isAuthenticate } = context;
- const token = Cookies.get("token")
+ const context = useContext(GlobalStateContext);
+ if (!context) throw new Error('App must be used within a GlobalStateProvider');
+ const { isAuthenticate } = context;
return (
} />
- {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/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/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 abfb571..7a6c6f2 100644
--- a/src/Pages/ManageUsers/RegisterUsers/RegisterUsers.tsx
+++ b/src/Pages/ManageUsers/RegisterUsers/RegisterUsers.tsx
@@ -37,7 +37,7 @@ const registerUser: any[] = [
),
"Action": (
-
+
{/* */}
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": (
- {/* */}
- {/* */}
- {/* */}
) => {
state.token = action.payload;
- Cookies.set("token", action.payload, { expires: 7, secure: true, sameSite: "Strict" }); // Store in cookies for 7 days
+ localStorage.setItem("token", action.payload); // ✅ Store token in localStorage
},
logout: (state) => {
state.token = null;
- Cookies.remove("token");
+ localStorage.removeItem("token"); // ✅ Remove token from localStorage on logout
},
},
});
diff --git a/src/Redux/Service/manage.aboutus.service.ts b/src/Redux/Service/manage.aboutus.service.ts
index bda6a51..300f497 100644
--- a/src/Redux/Service/manage.aboutus.service.ts
+++ b/src/Redux/Service/manage.aboutus.service.ts
@@ -1,26 +1,85 @@
-import { createApi } from "@reduxjs/toolkit/query";
+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) => ({
-
-
-
- getPosts: builder.query({ query: () => "/posts" }),
-
-
-
-
-
+ 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,
+
+
+
+
+
+
+
+
+
+
- export const { } = aboutUs;
-
- export type Post = {
- id: number;
- title: string;
- body: string;
- };
\ No newline at end of file
+ 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/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) => (
= ({ 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;
}