This commit is contained in:
YasinShaikh123
2025-02-12 12:51:28 +05:30
33 changed files with 426 additions and 158 deletions

View File

@@ -82,7 +82,11 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict';
"revision": "3ca0b8505b4bec776b69afdba2768812"
}, {
"url": "index.html",
<<<<<<< HEAD
"revision": "0.iv1sobg60j"
=======
"revision": "0.3bv9k3911i8"
>>>>>>> 688f6740627f6cdb421849d1fb012420be1d9d10
}], {});
workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

View File

@@ -11,6 +11,7 @@ import { logout } from "../Redux/Service/authSlice";
import { useDispatch } from "react-redux";
import GlobalStateContext from "../Contexts/GlobalStateContext";
import { useLogOutMutation } from "../Redux/Service/apiSlice";
import ProgressBar from "../components/ProgressBar/ProgressBar";
const DefaultLayout: FC<{ children: React.ReactNode }> = ({ children }) => {
@@ -46,12 +47,15 @@ const DefaultLayout: FC<{ children: React.ReactNode }> = ({ children }) => {
};
return (
<HStack overflow={'hidden'} position={'relative'} bg="#F2F2F2" backgroundPosition="center" backgroundRepeat="repeat" backgroundSize="cover" gap={0} w="100%" h="100vh" p={0}>
<VStack zIndex={1} gap={0} rounded={'lg'} h="100%" w="16%" overflow={'auto'} >
<HStack w={'100%'} p={3} h={'8%'} justifyContent={'center'}>
<VStack gap={0} w="100%" h="100vh" bg="#F2F2F2">
<ProgressBar isLoading={false} />
<HStack overflow={'hidden'} position={'relative'} bg="#F2F2F2" backgroundPosition="center" backgroundRepeat="repeat" backgroundSize="cover" gap={0} w="100%" h="calc(100% - 4px)" p={0}>
<VStack pt={0} zIndex={1} gap={0} rounded={'lg'} h="100%" w="15%" overflow={'auto'} >
<HStack w={'100%'} p={3} h={'7%'} justifyContent={'center'}>
<Image w={55} src={logo} />
</HStack>
<VStack w={'100%'} p={4} pt={0}>
<VStack w={'100%'} p={2} pt={0}>
{nav?.map(({ title, path, Icon, type, children }, index) => type === 'single' ?
<NavLink className="link" key={index} to={path} 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'}} ><Icon style={{ fontSize: '20px' }} /> <Text fontSize={'xs'} w={'100%'}>{title}</Text></NavLink> :
<AccordionRoot key={index} bg={'#fff'} rounded={'lg'} collapsible>
@@ -66,7 +70,9 @@ const DefaultLayout: FC<{ children: React.ReactNode }> = ({ children }) => {
</VStack>
</VStack>
<VStack gap={0} h="100%" w="85%" >
<HStack h={'11%'} w={'100%'} justifyContent={'flex-end'} pe={3} gap={6}>
<NavLink to={'/manage-notification'}><RiNotificationLine color="#013e3e" cursor={'pointer'} style={{ fontSize: '22px' }} /></NavLink>
<HStack cursor={'pointer'} onClick={() => navigate('/profile')} >
<Avatar size={'sm'} src="https://i.pinimg.com/736x/d6/cd/0f/d6cd0ffd4634b0763d3958a7325ce26e.jpg" />
@@ -79,6 +85,7 @@ const DefaultLayout: FC<{ children: React.ReactNode }> = ({ children }) => {
{children}
</VStack>
</HStack>
</VStack>
);
};

View File

@@ -26,6 +26,7 @@ import {
SelectValueText
} from "../../components/ui/select";
import AgencyName from "./AgencyName";
import { Spinner } from "../../components/Sipnner/Spinner";
const Dashboard = () => {
const frameworks = createListCollection({
@@ -186,6 +187,7 @@ const Dashboard = () => {
<AgencyName />
</Box>
</Box>
</MainFrame>
);
};

View File

@@ -5,6 +5,7 @@ import {
Image,
Input,
Text,
Theme,
VStack,
} from "@chakra-ui/react";
import axios from "axios";
@@ -78,6 +79,8 @@ const Login = () => {
console.log("====================================");
}
} catch (error) {
console.log('error', error);
if (error) {
toaster.create({
// title: error?.response?.data?.message,
@@ -91,7 +94,8 @@ const Login = () => {
});
return (
<VStack w={"100%"} h={"100vh"} bg={"#ffffff"}>
<VStack appearance={'light'} w={"100%"} h={"100vh"} bg={"#ffffff"}>
<HStack
boxShadow={"rgba(99, 99, 99, 0.2) 0px 2px 8px 0px"}
w={"100%"}

View File

@@ -1,30 +1,19 @@
import { Box, HStack, Text } from "@chakra-ui/react";
import { Box, HStack, Skeleton, 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";
interface AboutUsContent {
content: string;
}
interface ApiResponse {
data: AboutUsContent[];
}
const AboutUs = () => {
// const {
// data: data
// } = useGetAboutUsQuery()
const { data: response } = useGetAboutUsQuery<{ data: ApiResponse }>();
const { data, isLoading } = useGetAboutUsQuery();
const content = data?.data?.[0]?.content
console.log('====================================');
console.log(response);
// console.log(response);
console.log('====================================');
const content = response?.data?.[0]?.content || "No content available";
return (
@@ -46,9 +35,35 @@ const AboutUs = () => {
<AboutUsAddModel />
</HStack>
</HStack>
<Text as={p} fontSize={"sm"} fontWeight={400} color={"#1D1D1D"} px={3} w={"85%"} mb={"15px"} >
{/* Show Skeleton until content is available */}
{isLoading || !content ? (
<Box px={3} w="85%">
<Skeleton height="20px" mb="10px" />
<Skeleton height="20px" mb="10px" />
<Skeleton height="20px" mb="10px" />
<Skeleton height="20px" mb="10px" width="75%" />
<Skeleton height="20px" mb="15px" width="90%" />
<Skeleton height="20px" mb="10px" />
<Skeleton height="20px" mb="10px" width="85%" />
<Skeleton height="20px" mb="10px" />
<Skeleton height="20px" width="70%" />
</Box>
) : (
<Text
as="p"
fontSize="sm"
fontWeight={400}
color="#1D1D1D"
px={3}
w="85%"
mb="15px"
>
{content}
</Text>
)}
{/* <Text as={p} fontSize={"sm"} fontWeight={400} color={"#1D1D1D"} px={3} w={"85%"} mb={"15px"} >
{content}
</Text>
</Text> */}
{/* <Text as={p} fontSize={"sm"} fontWeight={400} color={"#1D1D1D"} px={3} w={"85%"} >
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Numquam soluta doloremque quibusdam facilis quas, unde hic eaque doloribus sed perferendis atque, eos dolores eius consectetur iure sint adipisci itaque tempora fugit quidem culpa provident possimus. Ullam, vitae in voluptatum dignissimos, quos blanditiis sequi aut repellat error eaque veritatis unde quam temporibus adipisci consectetur neque vero exercitationem dolor cum numquam maiores alias, totam minima quas. Possimus, ratione harum. Alias laboriosam nesciunt esse fugit deserunt pariatur corporis tempora quia veniam laborum aliquid enim voluptatibus asperiores minima tempore repudiandae vero quo porro, doloribus explicabo sit beatae et hic natus. Non earum nisi reiciendis?
</Text> */}

View File

@@ -1,53 +1,189 @@
import { FaRegEdit } from "react-icons/fa"
import { DialogBody, DialogCloseTrigger, DialogContent, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger } from "../../../components/ui/dialog"
import { Field, Stack, Text, Textarea } from "@chakra-ui/react"
import { Button } from "../../../components/ui/button"
// import { FaRegEdit } from "react-icons/fa"
// import { DialogBody, DialogCloseTrigger, DialogContent, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger } from "../../../components/ui/dialog"
// import { Field, Stack, Text, Textarea } from "@chakra-ui/react"
// import { Button } from "../../../components/ui/button"
// import { useUpdateAboutUsMutation } from "../../../Redux/Service/manage.aboutus.service"
// function AboutUsAddModel() {
// const [ updateAboutUs ] = useUpdateAboutUsMutation()
// try {
// const res = updateAboutUs({id:2, updatedData:''})
// console.log(res);
// } catch (error) {
// }
// return (
// <DialogRoot placement="center">
// <DialogTrigger asChild>
// {/* <Button bg={"transparent"} size="sm">
// <MdOutlineRemoveRedEye style={{ cursor: "pointer", fontSize: "16px" }} />
// </Button> */}
// <Button bgColor={'#EEEEEE'} pl={3} pr={3} size={'xs'} color={'#000'}> <FaRegEdit color="#000" style={{ height: '14px', width: '14px' }} /> <Text color={"#000"} mt={1}>Edit</Text></Button>
// </DialogTrigger>
// <DialogContent
// bg={"#fff"}
// // w={{ lg: "60%", md: "230px" }}
// w={{ base: '90%', md: '400px' }}
// height={"auto"}
// p={3} // Reduced padding
// bgSize={'md'}
// >
// <DialogHeader bg="white" >
// <DialogTitle alignSelf="center" color="black" fontSize="14px">Edit</DialogTitle>
// </DialogHeader>
// <DialogBody bg="white">
// <Stack py={3} >
// <Field.Root>
// <Field.Label color="black" pt={1} fontSize="12px">AboutUs</Field.Label>
// <Textarea placeholder="" bgColor="#EEEEEE" color="black" border="none" pl={1} fontSize="12px" height="30px" pt={1.5} />
// </Field.Root>
// </Stack>
// </DialogBody>
// <DialogFooter display="flex" justifyContent="center" pt={"2"}>
// <Button w="100%" bg="#02A0A0" color={"#fff"}>
// Save
// </Button>
// </DialogFooter>
// <DialogCloseTrigger color="black" />
// </DialogContent>
// </DialogRoot >
// )
// }
// export default AboutUsAddModel
import React, { useState } from "react";
import { FaRegEdit } from "react-icons/fa";
import {
DialogBody,
DialogCloseTrigger,
DialogContent,
DialogFooter,
DialogHeader,
DialogRoot,
DialogTitle,
DialogTrigger,
} from "../../../components/ui/dialog";
import { Field, Stack, Text, Textarea } from "@chakra-ui/react";
import { Button } from "../../../components/ui/button";
import { useUpdateAboutUsMutation } from "../../../Redux/Service/manage.aboutus.service";
function AboutUsAddModel() {
return (
const [content, setContent] = useState(""); // State for the textarea input
const [updateAboutUs, { isLoading }] = useUpdateAboutUsMutation(); // Mutation for updating About Us
// const toast = useToast(); // Toast for feedback
// Handle form submission
const handleSubmit = async (e: any) => {
e.preventDefault(); // Prevent default form submission
try {
// Call the updateAboutUs mutation
const res = await updateAboutUs({ id: 2, updatedData: content }).unwrap();
console.log(res);
// Show success toast
// toast({
// title: "Success",
// description: "About Us content updated successfully",
// status: "success",
// duration: 5000,
// isClosable: true,
// });
// Clear the input field after successful submission
setContent("");
} catch (error) {
// Show error toast
// toast({
// title: "Error",
// description: "Failed to update About Us content",
// status: "error",
// duration: 5000,
// isClosable: true,
// });
}
};
return (
<DialogRoot placement="center">
<DialogTrigger asChild>
{/* <Button bg={"transparent"} size="sm">
<MdOutlineRemoveRedEye style={{ cursor: "pointer", fontSize: "16px" }} />
</Button> */}
<Button bgColor={'#EEEEEE'} pl={3} pr={3} size={'xs'} color={'#000'}> <FaRegEdit color="#000" style={{ height: '14px', width: '14px' }} /> <Text color={"#000"} mt={1}>Edit</Text></Button>
<Button bgColor="#EEEEEE" pl={3} pr={3} size="xs" color="#000">
<FaRegEdit color="#000" style={{ height: "14px", width: "14px" }} />
<Text color="#000" mt={1}>
Edit
</Text>
</Button>
</DialogTrigger>
<DialogContent
bg={"#fff"}
// w={{ lg: "60%", md: "230px" }}
w={{ base: '90%', md: '400px' }}
height={"auto"}
p={3} // Reduced padding
bgSize={'md'}
bg="#fff"
w={{ base: "90%", md: "400px" }}
height="auto"
p={3}
>
<DialogHeader bg="white" >
<DialogTitle alignSelf="center" color="black" fontSize="14px">Edit</DialogTitle>
<DialogHeader bg="white">
<DialogTitle alignSelf="center" color="black" fontSize="14px">
Edit
</DialogTitle>
</DialogHeader>
<DialogBody bg="white">
<Stack py={3} >
<Stack py={3}>
<Field.Root>
<Field.Label color="black" pt={1} fontSize="12px">AboutUs</Field.Label>
<Textarea placeholder="" bgColor="#EEEEEE" color="black" border="none" pl={1} fontSize="12px" height="30px" pt={1.5} />
<Field.Label color="black" pt={1} fontSize="12px">
AboutUs
</Field.Label>
<Textarea
placeholder="Enter About Us content"
bgColor="#EEEEEE"
color="black"
border="none"
pl={1}
fontSize="12px"
height="100px" // Increased height for better usability
pt={1.5}
value={content} // Bind the state to the textarea
onChange={(e) => setContent(e.target.value)} // Update state on change
/>
</Field.Root>
</Stack>
</DialogBody>
<DialogFooter display="flex" justifyContent="center" pt={"2"}>
<Button w="100%" bg="#02A0A0" color={"#fff"}>
<DialogFooter display="flex" justifyContent="center" pt="2">
<Button
w="100%"
bg="#02A0A0"
color="#fff"
onClick={handleSubmit} // Trigger handleSubmit on button click
// isLoading={isLoading} // Show loading state while the mutation is in progress
>
Save
</Button>
</DialogFooter>
<DialogCloseTrigger color="black" />
</DialogContent>
</DialogRoot >
)
</DialogRoot>
);
}
export default AboutUsAddModel
export default AboutUsAddModel;

View File

@@ -74,7 +74,7 @@ const FAQ = () => {
colorPalette={"blue"}
_focus={{ border: "1px solid #02A0A0" }}
rounded={"md"}
size={"2xs"}
size={"xs"}
fontSize={"2sm"}
placeholder="Search..."
bgColor={'#EEEEEE'}

View File

@@ -1,12 +1,25 @@
import { Box, HStack, Text } from "@chakra-ui/react";
import MainFrame from "../../../components/MainFrame"
import { p } from "framer-motion/client";
import { Box, HStack, Text, Skeleton } from "@chakra-ui/react";
import MainFrame from "../../../components/MainFrame";
import PrivacyPolicyAddModel from "./PrivacyPolicyAddModel";
import { useGetPrivacyPolicyQuery } from "../../../Redux/Service/privacy.policy.service";
const PrivacyPolicy = () => {
return (
// Fetch data using RTK Query with type annotations
const { data, isLoading } = useGetPrivacyPolicyQuery();
console.log(isLoading);
// Log the response for debugging
console.log("====================================");
console.log(data);
console.log("====================================");
// Extract content array from the response
const content = data?.data?.[0]?.content;
return (
<MainFrame>
<Box>
<HStack
@@ -17,22 +30,39 @@ const PrivacyPolicy = () => {
px={3}
>
<Text as={"span"} fontSize={"sm"} fontWeight={500} color={"#000"}>
Privacy Policy
Privacy Policy
</Text>
<HStack >
<HStack>
<PrivacyPolicyAddModel />
</HStack>
</HStack>
<Text as={p} fontSize={"sm"} fontWeight={400} color={"#1D1D1D"} px={3} w={"85%"} mb={"15px"} >
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Numquam soluta doloremque quibusdam facilis quas, unde hic eaque doloribus sed perferendis atque, eos dolores eius consectetur iure sint adipisci itaque tempora fugit quidem culpa provident possimus. Ullam, vitae in voluptatum dignissimos, quos blanditiis sequi aut repellat error eaque veritatis unde quam temporibus adipisci consectetur neque vero exercitationem dolor cum numquam maiores alias, totam minima quas. Possimus, ratione harum. Alias laboriosam nesciunt esse fugit deserunt pariatur corporis tempora quia veniam laborum aliquid enim voluptatibus asperiores minima tempore repudiandae vero quo porro, doloribus explicabo sit beatae et hic natus. Non earum nisi reiciendis?
</Text>
<Text as={p} fontSize={"sm"} fontWeight={400} color={"#1D1D1D"} px={3} w={"85%"} >
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Numquam soluta doloremque quibusdam facilis quas, unde hic eaque doloribus sed perferendis atque, eos dolores eius consectetur iure sint adipisci itaque tempora fugit quidem culpa provident possimus. Ullam, vitae in voluptatum dignissimos, quos blanditiis sequi aut repellat error eaque veritatis unde quam temporibus adipisci consectetur neque vero exercitationem dolor cum numquam maiores alias, totam minima quas. Possimus, ratione harum. Alias laboriosam nesciunt esse fugit deserunt pariatur corporis tempora quia veniam laborum aliquid enim voluptatibus asperiores minima tempore repudiandae vero quo porro, doloribus explicabo sit beatae et hic natus. Non earum nisi reiciendis?
</Text>
</Box>
{/* Render multiple skeletons or content based on loading state */}
{isLoading || !content ? (
<Box px={3} pb={3} w="90%">
<Skeleton height="20px" mb="10px" width="90%" />
<Skeleton height="20px" mb="15px" width="90%" />
<Skeleton height="20px" mb="10px" width="90%" />
<Skeleton height="20px" mb="10px" width="80%" />
<Skeleton height="20px" width="60%" />
</Box>
) : (
<Text
as="p"
fontSize="sm"
fontWeight={400}
color="#1D1D1D"
px={3}
w="85%"
mb="15px"
>
{content}
</Text>
)}
</Box>
</MainFrame>
)
}
export default PrivacyPolicy
);
};
export default PrivacyPolicy;

View File

@@ -60,8 +60,8 @@ const ManageContact = () => {
colorPalette={"blue"}
_focus={{ border: "1px solid #02A0A0" }}
rounded={"md"}
size={"2xs"}
fontSize={"2sm"}
size={"xs"}
fontSize={"sm"}
placeholder="Search..."
bgColor={'#EEEEEE'}
ps={8}

View File

@@ -82,8 +82,8 @@ const ManageGroups = () => {
colorPalette={"blue"}
_focus={{ border: "1px solid #02A0A0" }}
rounded={"md"}
size={"2xs"}
fontSize={"2sm"}
size={"xs"}
fontSize={"sm"}
placeholder="Search..."
bgColor={'#EEEEEE'}
ps={8}

View File

@@ -83,8 +83,8 @@ const ManageJobs = () => {
colorPalette={"blue"}
_focus={{ border: "1px solid #02A0A0" }}
rounded={"md"}
size={"2xs"}
fontSize={"2sm"}
size={"xs"}
fontSize={"sm"}
placeholder="Search..."
bgColor={'#EEEEEE'}
ps={8}

View File

@@ -90,8 +90,8 @@ const ManagePost = () => {
colorPalette={"blue"}
_focus={{ border: "1px solid #02A0A0" }}
rounded={"md"}
size={"2xs"}
fontSize={"2sm"}
size={"xs"}
fontSize={"sm"}
placeholder="Search..."
bgColor={'#EEEEEE'}
ps={8}

View File

@@ -57,7 +57,7 @@ const DeactivatedAccounts = () => {
_focus={{ border: "1px solid #02A0A0" }}
rounded={"md"}
size={"2xs"}
fontSize={"2sm"}
fontSize={"sm"}
placeholder="Search..."
bgColor={'#EEEEEE'}
ps={8}

View File

@@ -85,8 +85,8 @@ const RegisterUsers = () => {
colorPalette={"blue"}
_focus={{ border: "1px solid #02A0A0" }}
rounded={"md"}
size={"2xs"}
fontSize={"2sm"}
size={"xs"}
fontSize={"sm"}
placeholder="Search..."
bgColor={'#EEEEEE'}
ps={8}

View File

@@ -77,7 +77,7 @@ const AgencyMaster = () => {
_focus={{ border: "1px solid #02A0A0" }}
rounded={"md"}
size={"xs"}
fontSize={"2sm"}
fontSize={"sm"}
placeholder="Search..."
bgColor={'#EEEEEE'}
ps={8}

View File

@@ -63,8 +63,8 @@ const Country = () => {
colorPalette={"blue"}
_focus={{ border: "1px solid #02A0A0" }}
rounded={"md"}
size={"2xs"}
fontSize={"2sm"}
size={"xs"}
fontSize={"sm"}
placeholder="Search..."
bgColor={'#EEEEEE'}
ps={8}

View File

@@ -63,8 +63,8 @@ const JobStatus = () => {
colorPalette={"blue"}
_focus={{ border: "1px solid #02A0A0" }}
rounded={"md"}
size={"2xs"}
fontSize={"2sm"}
size={"xs"}
fontSize={"sm"}
placeholder="Search..."
bgColor={'#EEEEEE'}
ps={8}

View File

@@ -63,8 +63,8 @@ const JobType = () => {
colorPalette={"blue"}
_focus={{ border: "1px solid #02A0A0" }}
rounded={"md"}
size={"2xs"}
fontSize={"2sm"}
size={"xs"}
fontSize={"sm"}
placeholder="Search..."
bgColor={'#EEEEEE'}
ps={8}

View File

@@ -28,8 +28,8 @@ const managepost: any[] = [
"Images": (
// <Image w={50} src={img} />
<HStack >
<Image w={100} h={50} src={img} />
<Image w={100} h={50} src={Templateimg} />
<Image rounded={'lg'} w={100} h={50} src={img} />
<Image rounded={'lg'} w={100} h={50} src={Templateimg} />
</HStack>
@@ -76,8 +76,8 @@ const TemplateMaster = () => {
colorPalette={"blue"}
_focus={{ border: "1px solid #02A0A0" }}
rounded={"md"}
size={"2xs"}
fontSize={"2sm"}
size={"xs"}
fontSize={"sm"}
placeholder="Search..."
bgColor={'#EEEEEE'}
ps={8}

View File

@@ -63,8 +63,8 @@ const WorkspaceMode = () => {
colorPalette={"blue"}
_focus={{ border: "1px solid #02A0A0" }}
rounded={"md"}
size={"2xs"}
fontSize={"2sm"}
size={"xs"}
fontSize={"sm"}
placeholder="Search..."
bgColor={'#EEEEEE'}
ps={8}

View File

@@ -80,7 +80,7 @@ const SubAdmin = () => {
_focus={{ border: "1px solid #02A0A0" }}
rounded={"md"}
size={"xs"}
fontSize={"2sm"}
fontSize={"sm"}
placeholder="Search..."
bgColor={'#EEEEEE'}
ps={8}

View File

@@ -9,7 +9,7 @@ export const aboutUs = createApi({
// 🔹 GET: Fetch all posts
getAboutUs: builder.query<AboutUs[], void>({
getAboutUs: builder.query<AboutUsResponse, void>({
query: () => "/about-us",
}),
@@ -24,18 +24,18 @@ export const aboutUs = createApi({
// 🔹 POST: Create a new post
createPost: builder.mutation<Post, Partial<Post>>({
query: (newPost) => ({
query: (data) => ({
url: "/posts",
method: "POST",
body: newPost,
body: data,
}),
}),
// 🔹 PUT: Update an existing post
updatePost: builder.mutation<Post, { id: number; updatedData: Partial<Post> }>({
updateAboutUs: builder.mutation<UpdateAboutUsResponse, UpdateAboutUsRequest>({
query: ({ id, updatedData }) => ({
url: `/posts/${id}`,
method: "PUT",
method: "POST",
body: updatedData,
}),
}),
@@ -52,6 +52,7 @@ export const aboutUs = createApi({
export const {
useGetAboutUsQuery,
useUpdateAboutUsMutation,
@@ -64,8 +65,7 @@ export const {
useGetPostByIdQuery,
useCreatePostMutation,
useUpdatePostMutation,
useCreatePostMutation,
useDeletePostMutation
} = aboutUs;
@@ -77,9 +77,27 @@ export type Post = {
};
export type UpdateAboutUsRequest={
id: number; updatedData: string
}
export type UpdateAboutUsResponse={
id: number; updatedData: string
}
export type AboutUs = {
id: number;
language_master_xid: number;
content: string;
is_active: boolean;
};
// First define your interface
interface AboutUsResponse {
data: {
content: string;
// other fields...
}[];
}

View File

@@ -1,26 +1,16 @@
import { createApi } from "@reduxjs/toolkit/query";
import { baseQueryWithReauth } from "./apiSlice";
import { createApi } from "@reduxjs/toolkit/query/react";
import { baseQueryWithReauth } from "./apiSlice"; // Ensure this is correctly configured
import { PrivacyPolicyResponse } from "../../Types/privacyPolicyTypes";
export const privacyPolicy = createApi({
reducerPath: "privacyPolicy",
baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
endpoints: (builder) => ({
getPosts: builder.query<Post[], void>({ query: () => "/posts" }),
reducerPath: "privacyPolicy",
baseQuery: baseQueryWithReauth, // Ensure this returns a valid `BaseQueryFn`
endpoints: (builder) => ({
getPrivacyPolicy: builder.query<PrivacyPolicyResponse, void>({ // Fix types here
query: () => "/privacy-policy",
}),
});
export const { } = privacyPolicy;
export type Post = {
id: number;
title: string;
body: string;
};
}),
});
// Export hook
export const { useGetPrivacyPolicyQuery } = privacyPolicy;

View File

@@ -17,7 +17,7 @@ export const nav = [
},
{
title: "Manage Users",
path: "",
path: "/register-users",
Icon: BiUserPin,
type:'multiple',
children: [
@@ -65,7 +65,7 @@ export const nav = [
},
{
title: "Manage CMS",
path: "",
path: "/faq",
Icon: AiOutlineFileText,
type:'multiple',
children: [
@@ -104,7 +104,7 @@ export const nav = [
},
{
title: "Master Module",
path: "",
path: "/agency-master",
Icon: BsBoxes,
type:'multiple',
children: [

View File

@@ -22,6 +22,7 @@ import Country from "../Pages/MasterModule/Country/Country";
import JobStatus from "../Pages/MasterModule/JobStatus/JobStatus";
import RegisterUsers from "../Pages/ManageUsers/RegisterUsers/RegisterUsers";
import DeactivatedAccounts from "../Pages/ManageUsers/DeactivatedAccounts/DeactivatedAccounts";
import { Spinner } from "../components/Sipnner/Spinner";
export const RouteLink = [
{ path: "/", Component: Dashboard },
@@ -47,4 +48,6 @@ export const RouteLink = [
{ path: "/workspace-mode", Component: WorkspaceMode},
{ path: "/country", Component: Country},
{ path: "/job-status", Component: JobStatus},
// { path: "/job-status", Component: Spinner},
]

View File

@@ -0,0 +1,13 @@
export interface PrivacyPolicyContent {
id: number;
language_master_xid: number;
content: string;
is_active: boolean;
}
export interface PrivacyPolicyResponse {
status: "success" | "error"; // Assuming it can be "success" or "error"
status_code: number;
message: string;
data: PrivacyPolicyContent[];
}

View File

@@ -13,7 +13,7 @@ interface MainFrameProps {
const MainFrame: FC<MainFrameProps> = ({ children }) => {
return (
<MotionVStack rounded="lg" overflowY={'auto'} overflowX={'hidden'} {...OPACITY_ON_LOAD} w="100%" minH="93%" p={0} pe={2} pb={2}>
<MotionVStack rounded="lg" overflowY={'auto'} overflowX={'hidden'} {...OPACITY_ON_LOAD} w="100%" minH="93%" p={0} pe={2} ps={1.5} pb={2}>
<Box
w="100%"
// h="100%"
@@ -22,7 +22,7 @@ const MainFrame: FC<MainFrameProps> = ({ children }) => {
rounded="lg"
boxShadow={'rgba(99, 99, 99, 0.2) 0px 2px 8px 0px'}
pt={3}
>
>
{children}
</Box>
</MotionVStack>

View File

@@ -0,0 +1,20 @@
/* HTML: <div class="progressbar"></div> */
.progressbar {
height: 4px;
width: 100%;
--c: no-repeat linear-gradient(#02A0A0 0 0);
background: var(--c), var(--c), #B8F8F8;
background-size: 60% 100%;
animation: l16 3s infinite;
}
@keyframes l16 {
0% {background-position: -150% 0, -150% 0}
66% {background-position: 250% 0, -150% 0}
100% {background-position: 250% 0, 250% 0}
}
.progressbarInactive{
height: 4px;
width: 100%;
}

View File

@@ -0,0 +1,12 @@
import React from "react";
import './ProgessBar.css';
interface ProgressBarProps {
isLoading: boolean;
}
const ProgressBar: React.FC<ProgressBarProps> = ({ isLoading }) => {
return <span className={isLoading ? "progressbar" : "progressbarInactive"} />;
};
export default ProgressBar;

View File

@@ -0,0 +1,28 @@
/* HTML: <div class="loader"></div> */
.loader {
width: 25px;
aspect-ratio: 1;
display: grid;
border-radius: 50%;
background:
linear-gradient(0deg, rgba(2, 160, 160, 0.5) 30%, transparent 0 70%, rgba(2, 160, 160, 1) 0) 50% / 8% 100%,
linear-gradient(90deg, rgba(2, 160, 160, 0.25) 30%, transparent 0 70%, rgba(2, 160, 160, 0.75) 0) 50% / 100% 8%;
background-repeat: no-repeat;
animation: l23 1s infinite steps(12);
}
.loader::before,
.loader::after {
content: "";
grid-area: 1/1;
border-radius: 50%;
background: inherit;
opacity: 0.915;
transform: rotate(30deg);
}
.loader::after {
opacity: 0.83;
transform: rotate(60deg);
}
@keyframes l23 {
100% {transform: rotate(1turn)}
}

View File

@@ -0,0 +1,7 @@
import { Center } from '@chakra-ui/react'
import './Spinner.css'
export const Spinner = () => <Center w={'100%'} h={'100%'}> <div className='loader'/></Center>

View File

@@ -17,16 +17,16 @@ export const toaster = createToaster({
export const Toaster = () => {
return (
<Portal>
<Portal >
<ChakraToaster toaster={toaster} insetInline={{ mdDown: "4" }}>
{(toast) => (
<Toast.Root width={{ md: "sm" }}>
<Toast.Root width={{ md: "sm" }}>
{toast.type === "loading" ? (
<Spinner size="sm" color="blue.solid" />
) : (
<Toast.Indicator />
)}
<Stack rounded={'full'} gap="1" flex="1" maxWidth="100%">
<Stack appearance={'light'} rounded={'full'} gap="1" flex="1" maxWidth="100%">
{toast.title && <Toast.Title p={2} color="#02A0A0">{toast.title}</Toast.Title>}
{toast.description && (
<Toast.Description>{toast.description}</Toast.Description>

View File

@@ -147,32 +147,10 @@ body {
}
/* Style the scrollbar */
::-webkit-scrollbar {
width: 6px;
/* Width of the vertical scrollbar */
height: 12px;
/* Height of the horizontal scrollbar */
}
/* Style the scrollbar track (the background area) */
::-webkit-scrollbar-track {
background-color: #f1f1f1;
border-radius: 10px;
}
/* Style the scrollbar thumb (the draggable part) */
::-webkit-scrollbar-thumb {
background-color: #c8c8c8cf;
/* Gray color for the thumb */
border-radius: 10px;
border: 1px solid #f1f1f1;
/* Border around the thumb */
}
/* Scrollbar width */
::-webkit-scrollbar {
width: 8px;
width: 6px;
height: 8px;
cursor: pointer;
}
@@ -184,14 +162,15 @@ body {
/* Scrollbar thumb (the draggable part) */
::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0.3); /* Light black (30% opacity) */
background: rgba(0, 0, 0, 0.2); /* 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);
background: rgba(0, 0, 0, 0.411);
cursor: pointer;
}