Worked on the termandcondition
This commit is contained in:
@@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict';
|
||||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||
}, {
|
||||
"url": "index.html",
|
||||
"revision": "0.vfttnul9ej"
|
||||
"revision": "0.18bfta5vpmg"
|
||||
}], {});
|
||||
workbox.cleanupOutdatedCaches();
|
||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
||||
|
||||
@@ -33,7 +33,7 @@ function PrivacyPolicyAddModel() {
|
||||
|
||||
<Field.Root>
|
||||
<Field.Label color="black" pt={1} fontSize="12px">PrivacyPolicy</Field.Label>
|
||||
<Textarea placeholder="" bgColor="#EEEEEE" color="black" border="none" pl={1} fontSize="12px" height="30px" pt={1.5} />
|
||||
<Textarea placeholder="" bgColor="#EEEEEE" color="black" border="none" pl={1} fontSize="12px" height="30px" pt={1.5} />
|
||||
</Field.Root>
|
||||
</Stack>
|
||||
</DialogBody>
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
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 TermsAndConditionsAddModel from "./TermsAndConditionsAddModel";
|
||||
|
||||
import {useGetTermsAndConditionQuery} from "../../../Redux/Service/terms.and.condition.service"
|
||||
|
||||
const TermsAndConditions = () => {
|
||||
|
||||
// Fetch data using RTK Query with type annotations
|
||||
const { data, isLoading } = useGetTermsAndConditionQuery();
|
||||
|
||||
|
||||
// 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>
|
||||
@@ -25,12 +37,29 @@ const TermsAndConditions = () => {
|
||||
<TermsAndConditionsAddModel />
|
||||
</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>
|
||||
{/* 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>
|
||||
)
|
||||
|
||||
@@ -1,26 +1,16 @@
|
||||
import { createApi } from "@reduxjs/toolkit/query";
|
||||
import { createApi } from "@reduxjs/toolkit/query/react";
|
||||
import { baseQueryWithReauth } from "./apiSlice";
|
||||
import { TermsAndConditionsResponse } from "../../Types/termsAndConditionTypes";
|
||||
|
||||
export const termsAndCondition = createApi({
|
||||
reducerPath: "api",
|
||||
export const TermsAndCondition = createApi({
|
||||
reducerPath: "TermsAndCondition",
|
||||
baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
|
||||
endpoints: (builder) => ({
|
||||
|
||||
|
||||
|
||||
getPosts: builder.query<Post[], void>({ query: () => "/posts" }),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
getTermsAndCondition: builder.query<TermsAndConditionsResponse, void>({
|
||||
query: () => "/term-and-condition",
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
export const { } = termsAndCondition;
|
||||
|
||||
export type Post = {
|
||||
id: number;
|
||||
title: string;
|
||||
body: string;
|
||||
};
|
||||
});
|
||||
|
||||
// Correctly export the hook
|
||||
export const { useGetTermsAndConditionQuery } = TermsAndCondition;
|
||||
|
||||
@@ -14,6 +14,7 @@ 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";
|
||||
import { TermsAndCondition } from "./Service/terms.and.condition.service";
|
||||
|
||||
export const store = configureStore({
|
||||
reducer: {
|
||||
@@ -21,6 +22,7 @@ export const store = configureStore({
|
||||
[registerUser.reducerPath]: registerUser.reducer,
|
||||
[deactivatedAccounts.reducerPath]: deactivatedAccounts.reducer,
|
||||
[faqs.reducerPath]: faqs.reducer,
|
||||
[TermsAndCondition.reducerPath]: TermsAndCondition.reducer,
|
||||
[managePosts.reducerPath]: managePosts.reducer,
|
||||
[manageSubAdmin.reducerPath]: manageSubAdmin.reducer,
|
||||
[manageJobs.reducerPath]: manageJobs.reducer,
|
||||
@@ -40,6 +42,7 @@ export const store = configureStore({
|
||||
managePosts.middleware,
|
||||
faqs.middleware,
|
||||
manageSubAdmin.middleware,
|
||||
TermsAndCondition.middleware,
|
||||
manageJobs.middleware,
|
||||
manageGroups.middleware,
|
||||
manageContactUs.middleware,
|
||||
|
||||
13
src/Types/termsAndConditionTypes.tsx
Normal file
13
src/Types/termsAndConditionTypes.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
export interface TermsAndConditionsContent {
|
||||
id: number;
|
||||
language_master_xid: number;
|
||||
content: string;
|
||||
is_active: boolean;
|
||||
}
|
||||
|
||||
export interface TermsAndConditionsResponse {
|
||||
status: "success" | "error"; // Assuming it can be "success" or "error"
|
||||
status_code: number;
|
||||
message: string;
|
||||
data: TermsAndConditionsContent[];
|
||||
}
|
||||
Reference in New Issue
Block a user