%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/src/Components/
Upload File :
Create Path :
Current File : //var/www/html/src/Components/Footer.js

import { useState } from "react";
import Link from "next/link";
import { TwitterIcon, FbIcon, InstaIcon, CloseIcon, DPLogo } from "./Icons";
import parse from "html-react-parser";
import { useGlobalContext } from "./store/context/GlobalContext";

function Footer() {
  const [legalModal, setLegalModal] = useState(false);
  const { footer } = useGlobalContext();

  const hideScroll = () => {
    let html = document.querySelector("html");
    html.classList.add("overflowHidden");
  };

  const showScroll = () => {
    let html = document.querySelector("html");
    html.classList.remove("overflowHidden");
  };

  return (
    <div className="mainContact">
      <div className="footer" style={{ padding: "2rem 16.2rem" }}>
        <a
          href={"https://digitalpresent.io/"}
          target="_blank"
          rel="noopener noreferrer"
          aria-label="developed by Digital Present"
          className={"developed"}
        >
          <p className={"developed__p"}>Developed by</p>
          <DPLogo color={"#fff"} />
        </a>
        <p>Copyright {new Date().getFullYear()} ATV. All rights reserved.</p>
        {footer?.footer?.slice(0, 1).map((links, index) => (
          <div className="legal" key={index}>
            <p
              onClick={() => {
                setLegalModal(true);
                hideScroll();
              }}
            >
              {links?.title}
            </p>
            <div
              className="legal-modal"
              style={{ display: legalModal ? "flex" : "none" }}
            >
              <div className="legal-modal-content">
                <button
                  onClick={(e) => {
                    setLegalModal(false);
                    showScroll();
                  }}
                >
                  <CloseIcon />
                </button>
                <p>{parse(footer?.legal)}</p>
              </div>
            </div>
          </div>
        ))}

        {footer?.footer?.slice(1).map((links, index) => (
          <div className="terms" key={index}>
            <Link href={`/${links.slug}`} passHref>
              <p>{links.title}</p>
            </Link>
          </div>
        ))}

        <div className="icons">
          {`${footer?.socials?.tw}` ? (
            <a href={`${footer?.socials?.tw}`}>
              <TwitterIcon />
            </a>
          ) : (
            ""
          )}
          {`${footer?.socials?.in}` ? (
            <a href={`${footer?.socials?.in}`}>
              <InstaIcon />
            </a>
          ) : (
            ""
          )}
          {`${footer?.socials?.fb}` ? (
            <a href={`${footer?.socials?.fb}`}>
              <FbIcon />
            </a>
          ) : (
            ""
          )}
        </div>
      </div>
    </div>
  );
}

export default Footer;

Zerion Mini Shell 1.0