fix: header and nav types
This commit is contained in:
parent
0bfe900bab
commit
4a3b9a0a22
@ -1,9 +1,10 @@
|
|||||||
import HeaderNav from "@/components/HeaderNav";
|
import HeaderNav from "@/components/HeaderNav";
|
||||||
|
import { navMenuData } from "@/data/menu";
|
||||||
import { toggleMobileMenu } from "@/utils/toggleMobileMenu";
|
import { toggleMobileMenu } from "@/utils/toggleMobileMenu";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
export default function Header1Multipage({ links }: any) {
|
export default function Header({ links }: { links: typeof navMenuData }) {
|
||||||
return (
|
return (
|
||||||
<div className="main-nav-sub full-wrapper">
|
<div className="main-nav-sub full-wrapper">
|
||||||
{/* Logo (* Add your text or image to the link tag. Use SVG or PNG image format.
|
{/* Logo (* Add your text or image to the link tag. Use SVG or PNG image format.
|
||||||
|
@ -4,10 +4,11 @@ import addScrollspy from "@/utils/addScroll";
|
|||||||
import { init_classic_menu_resize } from "@/utils/menuToggle";
|
import { init_classic_menu_resize } from "@/utils/menuToggle";
|
||||||
import { scrollToElement } from "@/utils/scrollToElement";
|
import { scrollToElement } from "@/utils/scrollToElement";
|
||||||
import { closeMobileMenu, toggleMobileMenu } from "@/utils/toggleMobileMenu";
|
import { closeMobileMenu, toggleMobileMenu } from "@/utils/toggleMobileMenu";
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { Fragment, useEffect, useRef, useState } from "react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { navMenuData } from "@/data/menu";
|
||||||
|
|
||||||
export default function HeaderNav({ links, animateY = false }: any) {
|
export default function HeaderNav({ links, animateY = false }: { links: typeof navMenuData; animateY?: boolean }) {
|
||||||
const [isDropdownOpen, setIsDropdownOpen] = useState([""]);
|
const [isDropdownOpen, setIsDropdownOpen] = useState([""]);
|
||||||
const dropdownRef = useRef(null);
|
const dropdownRef = useRef(null);
|
||||||
|
|
||||||
@ -36,8 +37,8 @@ export default function HeaderNav({ links, animateY = false }: any) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{links[0].href?.includes("/") &&
|
{links[0].href?.includes("/") &&
|
||||||
links.map((link: any, index: any) => (
|
links.map((link, index) => (
|
||||||
<>
|
<Fragment key={index}>
|
||||||
<li>
|
<li>
|
||||||
{!Array.isArray(link?.child) && (
|
{!Array.isArray(link?.child) && (
|
||||||
<Link href={link.href}>
|
<Link href={link.href}>
|
||||||
@ -98,7 +99,7 @@ export default function HeaderNav({ links, animateY = false }: any) {
|
|||||||
{index != links.length - 1 && (
|
{index != links.length - 1 && (
|
||||||
<div className="text-white h-[25px] mx-2 opacity-[0.3]" style={{ border: "1px solid white" }} />
|
<div className="text-white h-[25px] mx-2 opacity-[0.3]" style={{ border: "1px solid white" }} />
|
||||||
)}
|
)}
|
||||||
</>
|
</Fragment>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
{!links[0].href?.includes("/") &&
|
{!links[0].href?.includes("/") &&
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import Testimonials from "./Testimonials";
|
|
||||||
import About from "./About";
|
import About from "./About";
|
||||||
import Contact from "./Contacts/Contact";
|
import Contact from "./Contacts/Contact";
|
||||||
|
|
||||||
export default function homepage({ onePage = false, dark = false }) {
|
export default function homepage({ dark = false }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<hr className={`mt-0 mb-0 ${dark ? "white" : ""} `} />
|
<hr className={`mt-0 mb-0 ${dark ? "white" : ""} `} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user