diff --git a/dev-dist/sw.js b/dev-dist/sw.js index 2b1ee05..0a9d960 100644 --- a/dev-dist/sw.js +++ b/dev-dist/sw.js @@ -82,11 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", -<<<<<<< HEAD - "revision": "0.iv1sobg60j" -======= - "revision": "0.3bv9k3911i8" ->>>>>>> 688f6740627f6cdb421849d1fb012420be1d9d10 + "revision": "0.ch9snbb3598" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { diff --git a/src/Pages/ManageCMS/AboutUs/AboutUs.tsx b/src/Pages/ManageCMS/AboutUs/AboutUs.tsx index d1d704c..ff83b81 100644 --- a/src/Pages/ManageCMS/AboutUs/AboutUs.tsx +++ b/src/Pages/ManageCMS/AboutUs/AboutUs.tsx @@ -61,7 +61,7 @@ // } // export default AboutUs -import { Badge, HStack, Text, VStack } from "@chakra-ui/react"; +import { Badge, HStack, Stack, Text, VStack } from "@chakra-ui/react"; import MainFrame from "../../../components/MainFrame"; import { useGetAboutUsQuery } from "../../../Redux/Service/manage.aboutus.service"; import { Spinner } from "../../../components/Sipnner/Spinner"; @@ -85,6 +85,9 @@ const AboutUs = () => { return ( + About Us + + {isLoading || isFetching ? ( ) : ( @@ -96,9 +99,9 @@ const AboutUs = () => { p={3} key={id} > + - About Us{" "} (null); - const [languageCode, setLanguageCode] = useState(""); const [isOpen, setIsOpen] = useState(false); // RTK Query Mutation Hook const [updateAboutUs, { isLoading }] = useUpdateAboutUsMutation(); + // React Hook Form + const { + control, + handleSubmit, + reset, + setValue, + } = useForm({ + defaultValues: { + content: "", + languageCode: "", + }, + }); + // Function to handle edit click (pre-fill the editor) const handleEditClick = (data: any) => { - setSelectedId(data.id); - setContent(data.content); - setLanguageCode(data.about_language.language_code); + setValue("content", data.content); // Pre-fill the content field + setValue("languageCode", data.about_language.language_code); // Pre-fill the language code setIsOpen(true); // Open dialog - }; // Function to handle update submission - const handleSave = async () => { - if (!selectedId || !content.trim()) return; // Prevent empty updates + const onSubmit = async (formData: any) => { + if (!formData.content.trim()) return; // Prevent empty updates try { - await updateAboutUs({ id: selectedId, content, language_code: languageCode }).unwrap(); + await updateAboutUs({ + id: aboutUsData.id, + content: formData.content, + language_code: formData.languageCode, + }).unwrap(); setIsOpen(false); // Close dialog on success - + reset(); // Reset the form } catch (error) { console.error("Update failed:", error); } }; return ( - + - + setIsOpen(false)} /> ); } -export default AboutUsAddModel; +export default AboutUsAddModel; \ No newline at end of file diff --git a/src/Pages/ManageCMS/FAQ/EditDetails.tsx b/src/Pages/ManageCMS/FAQ/EditDetails.tsx index d088351..a1f2a9b 100644 --- a/src/Pages/ManageCMS/FAQ/EditDetails.tsx +++ b/src/Pages/ManageCMS/FAQ/EditDetails.tsx @@ -1,3 +1,85 @@ +// import { Button } from "../../../components/ui/button"; +// import { +// DialogBody, +// DialogCloseTrigger, +// DialogContent, +// DialogFooter, +// DialogHeader, +// DialogRoot, +// DialogTitle, +// DialogTrigger, +// } from "../../../components/ui/dialog"; +// import { Field, Input, Stack, Textarea } from "@chakra-ui/react"; +// import Edit from "../../../components/ActionIcons/Edit"; +// function EditDetails() { +// return ( +// +// +// {/* */} +// + +// + +// +// +// +// Edit Details +// +// + +// +// +// +// +// Questions +// +// + +// +// Answer +// +//