diff --git a/components/MobileNavbar.js b/components/MobileNavbar.js
index f96a60e..7547cbe 100644
--- a/components/MobileNavbar.js
+++ b/components/MobileNavbar.js
@@ -129,87 +129,84 @@ const SocialBlock = () => {
);
};
+const NavbarItem = ({ name, arrow, toggleSection, children }) => {
+ return (
+
+
+ {children}
+
+ );
+};
+
export const MobileNavbar = () => {
const [isOpened, setIsOpened] = useState(false);
function toggle() {
setIsOpened(!isOpened);
-
const icon = document.getElementById("navbar-bottom");
- if (isOpened) {
- icon.style.visibility = "visible";
- } else {
- icon.style.visibility = "hidden";
- }
+ isOpened ? (icon.style.visibility = "visible") : (icon.style.visibility = "hidden");
}
const [arrowOpen, setArrowOpen] = useState(false);
const [prevArrowId, setPrevArrowId] = useState("");
- const [ProductsIsOpened, setProductsIsOpened] = useState(false);
- const [ServicesIsOpened, setServicesIsOpened] = useState(false);
- const [LearnIsOpened, setLearnIsOpened] = useState(false);
- const [CompanyIsOpened, setCompanyIsOpened] = useState(false);
+ const [isOpen, setIsOpen] = useState({
+ Products: false,
+ Services: false,
+ Learn: false,
+ Company: false,
+ });
+
+ function toggleSection(section, arrowId) {
+ setIsOpen((prevState) => ({
+ Products: section === "Products" ? !prevState.Products : false,
+ Services: section === "Services" ? !prevState.Services : false,
+ Learn: section === "Learn" ? !prevState.Learn : false,
+ Company: section === "Company" ? !prevState.Company : false,
+ }));
+ rotateArrow(arrowId);
+ }
function rotateArrow(element) {
const icon = document.getElementById(element);
+ console.log(icon);
const prevIcon = document.getElementById(prevArrowId);
+ const rotate0 = "rotate(0deg)";
+ const rotate180 = "rotate(180deg)";
+ const transformLinear = "transform 0.2s linear";
if (prevArrowId === element) {
if (arrowOpen) {
- icon.style.transform = "rotate(0deg)";
- icon.style.transition = "transform 0.2s linear";
+ icon.style.transform = rotate0;
+ icon.style.transition = transformLinear;
setArrowOpen(!arrowOpen);
} else {
- icon.style.transform = "rotate(180deg)";
- icon.style.transition = "transform 0.2s linear";
+ icon.style.transform = rotate180;
+ icon.style.transition = transformLinear;
setArrowOpen(!arrowOpen);
}
} else if (arrowOpen) {
- prevIcon.style.transform = "rotate(0deg)";
- prevIcon.style.transition = "transform 0.2s linear";
- icon.style.transform = "rotate(180deg)";
- icon.style.transition = "transform 0.2s linear";
+ prevIcon.style.transform = rotate0;
+ prevIcon.style.transition = transformLinear;
+ icon.style.transform = rotate180;
+ icon.style.transition = transformLinear;
} else {
- icon.style.transform = "rotate(180deg)";
- icon.style.transition = "transform 0.2s linear";
+ icon.style.transform = rotate180;
+ icon.style.transition = transformLinear;
setArrowOpen(!arrowOpen);
}
setPrevArrowId(element);
}
- function setProducts() {
- setProductsIsOpened(!ProductsIsOpened);
- setServicesIsOpened(false);
- setLearnIsOpened(false);
- setCompanyIsOpened(false);
- rotateArrow("arrow1");
- }
-
- function setServices() {
- setProductsIsOpened(false);
- setServicesIsOpened(!ServicesIsOpened);
- setLearnIsOpened(false);
- setCompanyIsOpened(false);
- rotateArrow("arrow2");
- }
-
- function setLearn() {
- setProductsIsOpened(false);
- setServicesIsOpened(false);
- setLearnIsOpened(!LearnIsOpened);
- setCompanyIsOpened(false);
- rotateArrow("arrow3");
- }
-
- function setCompany() {
- setProductsIsOpened(false);
- setServicesIsOpened(false);
- setLearnIsOpened(false);
- setCompanyIsOpened(!CompanyIsOpened);
- rotateArrow("arrow4");
- }
-
return (
@@ -235,37 +232,19 @@ export const MobileNavbar = () => {
-
-
- {ProductsIsOpened ?
: null}
-
-
-
-
- {ServicesIsOpened ?
: null}
-
-
-
-
- {LearnIsOpened ?
: null}
-
-
-
- {CompanyIsOpened ?
: null}
-
+
+ {isOpen.Products ? : null}
+
+
+ {isOpen.Services ? : null}
+
+
+ {isOpen.Learn ? : null}
+
+
+ {isOpen.Company ? : null}
+
diff --git a/sections/security-audits/Process.js b/sections/security-audits/Process.js
index 0193c50..42a567f 100644
--- a/sections/security-audits/Process.js
+++ b/sections/security-audits/Process.js
@@ -5,7 +5,10 @@ export default function Process() {
);
}