From f6f093107169a136071910cc8c6f01f9fc6052c0 Mon Sep 17 00:00:00 2001 From: Adeola David Adelakun Date: Fri, 24 Nov 2023 13:36:05 +0100 Subject: [PATCH] Responsive services image --- components/shared/blog-header.jsx | 33 ++++++++++++++++--------------- components/shared/header.jsx | 31 ++++++++--------------------- containers/Services.jsx | 2 +- 3 files changed, 26 insertions(+), 40 deletions(-) diff --git a/components/shared/blog-header.jsx b/components/shared/blog-header.jsx index 590363f..aaddfbc 100644 --- a/components/shared/blog-header.jsx +++ b/components/shared/blog-header.jsx @@ -3,6 +3,7 @@ import Image from 'next/image'; import Link from "next/link" import { MdMenu, MdOutlineKeyboardArrowDown } from "react-icons/md" +// import { useSelectedLayoutSegment } from "next/navigation"; import React, { useState, useRef, useEffect } from "react"; const links = [ @@ -39,18 +40,19 @@ const links = [ ]; export default function Header() { - const [showResource, setShowResource] = useState(false) + // const segment = useSelectedLayoutSegment(); + const [showResource, setShowResource] = useState(false); - const [isOpen, setIsOpen] = useState(false); + const [isOpen, setisOpen] = useState(false); const dropdownRef = useRef(null); - const toggleDropdown = () => { - setIsOpen(!isOpen); + const toggleMenu = () => { + setisOpen(!isOpen); }; const handleOutsideClick = (event) => { if (dropdownRef.current && !dropdownRef.current.contains(event.target)) { - setIsOpen(false); + setisOpen(false); } }; @@ -72,7 +74,7 @@ export default function Header() {
Element removebg preview ( idx !== 2 ? ( {link.text} ) : (
setShowResource(showResource => !showResource)} @@ -107,20 +109,20 @@ export default function Header() { Request Demo - -
- - {isOpen && ( -
    +
+ {isOpen && ( +
    {links.map((link) => (
  • {link.text} @@ -132,8 +134,7 @@ export default function Header() {
  • ))}
- )} -
+ )}
diff --git a/components/shared/header.jsx b/components/shared/header.jsx index c94a791..8623554 100644 --- a/components/shared/header.jsx +++ b/components/shared/header.jsx @@ -41,23 +41,18 @@ const links = [ export default function Header() { const segment = useSelectedLayoutSegment(); - const [showResource, setShowResource] = useState(false) - const [menuOpen, setMenuOpen] = useState(false); + const [showResource, setShowResource] = useState(false); - const toggleMenu = () => { - setMenuOpen(!menuOpen); - }; - - const [isOpen, setIsOpen] = useState(false); + const [isOpen, setisOpen] = useState(false); const dropdownRef = useRef(null); - const toggleDropdown = () => { - setIsOpen(!isOpen); + const toggleMenu = () => { + setisOpen(!isOpen); }; const handleOutsideClick = (event) => { if (dropdownRef.current && !dropdownRef.current.contains(event.target)) { - setIsOpen(false); + setisOpen(false); } }; @@ -113,24 +108,14 @@ export default function Header() { -
- -
+
- -
- {menuOpen && ( -