first terms and condition etc

This commit is contained in:
pawan-dot 2024-06-07 15:32:59 +05:30
parent 88b6914d29
commit 90e913f695
6 changed files with 240 additions and 240 deletions

View File

@ -192,7 +192,7 @@ const _nav = [
// },
{
component: CNavGroup,
name: "Website Related",
name: "Website Settings",
icon: <CIcon icon={cilCart} customClassName="nav-icon" />,
group: "",
@ -202,28 +202,28 @@ const _nav = [
name: "Banner",
icon: <CIcon icon={cilImage} customClassName="nav-icon" />,
to: "/banner",
group: "Website Related",
group: "Website Settings",
},
{
component: CNavItem,
name: "Register Image",
icon: <CIcon icon={cilImage} customClassName="nav-icon" />,
to: "/registerImage",
group: "Website Related",
group: "Website Settings",
},
{
component: CNavItem,
name: "Login Image",
icon: <CIcon icon={cilImage} customClassName="nav-icon" />,
to: "/loginImage",
group: "Website Related",
group: "Website Settings",
},
{
component: CNavItem,
name: "Shop Page Image",
icon: <CIcon icon={cilImage} customClassName="nav-icon" />,
to: "/shopImage",
group: "Website Related",
group: "Website Settings",
},
// {
// component: CNavItem,
@ -253,15 +253,15 @@ const _nav = [
name: "Content ",
icon: <CIcon icon={cilText} customClassName="nav-icon" />,
to: "/content",
group: "Website Related",
},
{
component: CNavItem,
name: "Home",
icon: <CIcon icon={cilFeaturedPlaylist} customClassName="nav-icon" />,
to: "/home",
group: "Website Related",
group: "Website Settings",
},
// {
// component: CNavItem,
// name: "Home",
// icon: <CIcon icon={cilFeaturedPlaylist} customClassName="nav-icon" />,
// to: "/home",
// group: "Website Settings",
// },
],
},
{

View File

@ -5,6 +5,7 @@ import ReactQuill from "react-quill";
import "react-quill/dist/quill.snow.css";
import axios from "axios";
import { isAutheticated } from "src/auth";
import { Link } from "react-router-dom";
const TOOLBAR_OPTIONS = [
[{ header: [1, 2, 3, 4, 5, 6, false] }],
@ -35,12 +36,9 @@ export default function EditAboutUs() {
},
});
if (response.status === 200) {
setContent(response?.data?.aboutUs[0]?.aboutUsContent);
setId(response?.data?.aboutUs[0]?._id);
setOlderContent(
response?.data?.aboutUs[0]?.aboutUsContent
);
setOlderContent(response?.data?.aboutUs[0]?.aboutUsContent);
}
};
@ -76,7 +74,6 @@ export default function EditAboutUs() {
Authorization: `Bearer ${token}`,
},
}
);
if (response.status === 200) {
swal({
@ -96,7 +93,7 @@ export default function EditAboutUs() {
}
};
const handleSaveClick = async () => {
if (olderContent === undefined && olderContent.length===0) {
if (olderContent === undefined || olderContent === "") {
await addAboutUs();
setAdded(true);
} else {
@ -126,10 +123,11 @@ export default function EditAboutUs() {
>
Save
</Button>
<Link to="/content">
<Button
variant="contained"
color="primary"
onClick={handleCancelClick}
// onClick={handleCancelClick}
style={{
fontWeight: "bold",
marginBottom: "1rem",
@ -137,8 +135,9 @@ export default function EditAboutUs() {
marginRight: "5px",
}}
>
Cancel
Back
</Button>
</Link>
</div>
<Box style={{ background: "#FFFFFF", color: "black", padding: "1rem" }}>
@ -159,4 +158,4 @@ export default function EditAboutUs() {
</Box>
</div>
);
}
}

View File

@ -5,6 +5,7 @@ import ReactQuill from "react-quill";
import "react-quill/dist/quill.snow.css";
import axios from "axios";
import { isAutheticated } from "src/auth";
import { Link } from "react-router-dom";
const TOOLBAR_OPTIONS = [
[{ header: [1, 2, 3, 4, 5, 6, false] }],
@ -76,7 +77,6 @@ export default function EditPrivacyPolicy() {
Authorization: `Bearer ${token}`,
},
}
);
if (response.status === 200) {
swal({
@ -96,7 +96,7 @@ export default function EditPrivacyPolicy() {
}
};
const handleSaveClick = async () => {
if (olderContent.length===0) {
if (olderContent === undefined || olderContent === "") {
await addPrivacyPolicy();
setAdded(true);
} else {
@ -126,10 +126,11 @@ export default function EditPrivacyPolicy() {
>
Save
</Button>
<Link to="/content">
<Button
variant="contained"
color="primary"
onClick={handleCancelClick}
// onClick={handleCancelClick}
style={{
fontWeight: "bold",
marginBottom: "1rem",
@ -137,8 +138,9 @@ export default function EditPrivacyPolicy() {
marginRight: "5px",
}}
>
Cancel
Back
</Button>
</Link>
</div>
<Box style={{ background: "#FFFFFF", color: "black", padding: "1rem" }}>

View File

@ -6,7 +6,7 @@ import ReactQuill from "react-quill";
import "react-quill/dist/quill.snow.css";
import axios from "axios";
import { isAutheticated } from "src/auth";
import { useNavigate, useNavigation } from "react-router-dom";
import { Link, useNavigate, useNavigation } from "react-router-dom";
const TOOLBAR_OPTIONS = [
[{ header: [1, 2, 3, 4, 5, 6, false] }],
@ -24,8 +24,7 @@ export default function editRefundPolicy() {
const [content, setContent] = useState("");
const [added, setAdded] = useState(false);
const [olderContent, setOlderContent] = useState("");
const [id, setId] = useState(null)
const [id, setId] = useState(null);
const token = isAutheticated();
const handleContentChange = (content, delta, source, editor) => {
@ -77,7 +76,6 @@ export default function editRefundPolicy() {
Authorization: `Bearer ${token}`,
},
}
);
if (response.status === 200) {
swal({
@ -97,7 +95,7 @@ export default function editRefundPolicy() {
}
};
const handleSaveClick = async () => {
if (olderContent.length===0) {
if (olderContent === undefined || olderContent === "") {
await addTermsandConditions();
setAdded(true);
} else {
@ -128,10 +126,11 @@ export default function editRefundPolicy() {
>
Save
</Button>
<Link to="/content">
<Button
variant="contained"
color="primary"
onClick={handleCancelClick}
// onClick={handleCancelClick}
style={{
fontWeight: "bold",
marginBottom: "1rem",
@ -139,8 +138,9 @@ export default function editRefundPolicy() {
marginRight: "5px",
}}
>
Cancel
Back
</Button>
</Link>
</div>
<Box style={{ background: "#FFFFFF", color: "black", padding: "1rem" }}>

View File

@ -6,7 +6,7 @@ import ReactQuill from "react-quill";
import "react-quill/dist/quill.snow.css";
import axios from "axios";
import { isAutheticated } from "src/auth";
import { useNavigate, useNavigation } from "react-router-dom";
import { Link, useNavigate, useNavigation } from "react-router-dom";
const TOOLBAR_OPTIONS = [
[{ header: [1, 2, 3, 4, 5, 6, false] }],
@ -24,8 +24,7 @@ export default function EditShippingPolicy() {
const [content, setContent] = useState("");
const [added, setAdded] = useState(false);
const [olderContent, setOlderContent] = useState("");
const [id, setId] = useState(null)
const [id, setId] = useState(null);
const token = isAutheticated();
const handleContentChange = (content, delta, source, editor) => {
@ -97,7 +96,7 @@ export default function EditShippingPolicy() {
}
};
const handleSaveClick = async () => {
if (olderContent.length===0) {
if (olderContent === undefined || olderContent === "") {
await addShipping();
setAdded(true);
} else {
@ -128,10 +127,11 @@ export default function EditShippingPolicy() {
>
Save
</Button>
<Link to="/content">
<Button
variant="contained"
color="primary"
onClick={handleCancelClick}
// onClick={handleCancelClick}
style={{
fontWeight: "bold",
marginBottom: "1rem",
@ -139,8 +139,9 @@ export default function EditShippingPolicy() {
marginRight: "5px",
}}
>
Cancel
Back
</Button>
</Link>
</div>
<Box style={{ background: "#FFFFFF", color: "black", padding: "1rem" }}>

View File

@ -6,7 +6,7 @@ import ReactQuill from "react-quill";
import "react-quill/dist/quill.snow.css";
import axios from "axios";
import { isAutheticated } from "src/auth";
import { useNavigate, useNavigation } from "react-router-dom";
import { Link, useNavigate, useNavigation } from "react-router-dom";
const TOOLBAR_OPTIONS = [
[{ header: [1, 2, 3, 4, 5, 6, false] }],
@ -24,8 +24,7 @@ export default function EditTermsConditions() {
const [content, setContent] = useState("");
const [added, setAdded] = useState(false);
const [olderContent, setOlderContent] = useState("");
const [id, setId] = useState(null)
const [id, setId] = useState(null);
const token = isAutheticated();
const handleContentChange = (content, delta, source, editor) => {
@ -38,14 +37,11 @@ export default function EditTermsConditions() {
},
});
if (response.status === 200) {
// console.log(response);
setContent(response?.data?.termsAndCondition[0]?.termsAndContionContent);
setOlderContent(
response?.data?.termsAndCondition[0]?.termsAndContionContent
);
setId(
response?.data?.termsAndCondition[0]?._id
);
setId(response?.data?.termsAndCondition[0]?._id);
}
};
@ -100,7 +96,7 @@ export default function EditTermsConditions() {
}
};
const handleSaveClick = async () => {
if (olderContent.length===0) {
if (olderContent === undefined || olderContent === "") {
await addTermsandConditions();
setAdded(true);
} else {
@ -131,10 +127,11 @@ export default function EditTermsConditions() {
>
Save
</Button>
<Link to="/content">
<Button
variant="contained"
color="primary"
onClick={handleCancelClick}
// onClick={handleCancelClick}
style={{
fontWeight: "bold",
marginBottom: "1rem",
@ -142,8 +139,9 @@ export default function EditTermsConditions() {
marginRight: "5px",
}}
>
Cancel
Back
</Button>
</Link>
</div>
<Box style={{ background: "#FFFFFF", color: "black", padding: "1rem" }}>