diff --git a/components/nav/navItemWithSmallDropdown.tsx b/components/nav/navItemWithSmallDropdown.tsx index 4c4a8d8d..c1b2a53e 100644 --- a/components/nav/navItemWithSmallDropdown.tsx +++ b/components/nav/navItemWithSmallDropdown.tsx @@ -1,79 +1,80 @@ -import React, {useState} from "react"; +import React, { useState } from "react"; import Link from "next/link"; -import {UpIcon} from "./UpIcon" +import { UpIcon } from "./UpIcon" import DownIcon from "./DownIcon" import Image from "next/image"; export interface NavItemWithSmallDropdownProps { - heading: string; - dropdownData: DropdowndataInterface[]; - } + heading: string; + dropdownData: DropdowndataInterface[]; +} - export interface DropdowndataInterface{ - heading:string; - links:LinkDatainterface[] +export interface DropdowndataInterface { + heading: string; + links: LinkDatainterface[] +} +export interface LinkDatainterface { + pagelink: string; + pageName: string; +} +export default function NavItemWithSmallDropdown({ heading, dropdownData }: NavItemWithSmallDropdownProps) { + const [openDropdown, setShowDropdown] = useState(false) + const showDropdown = () => { + setShowDropdown(true) + } + const hideDropdown = () => { + setShowDropdown(false) } - export interface LinkDatainterface{ - pagelink:string; - pageName:string; + const toggleDropdown = () => { + setShowDropdown(!openDropdown) } -export default function NavItemWithSmallDropdown({heading,dropdownData}:NavItemWithSmallDropdownProps){ - const [openDropdown,setShowDropdown] = useState(false) - const showDropdown = ()=>{ - setShowDropdown(true) - } - const hideDropdown = ()=>{ - setShowDropdown(false) - } - const toggleDropdown =()=>{ - setShowDropdown(!openDropdown) - } - return( + return ( +
+
+
+ Resources +
+
+ {openDropdown ? : } +
+
+ {openDropdown && (
-
-
- Resources + className="absolute top-full pb-0 bg-[#F5F5F5] pb-8 z-10 border border-gray-300 rounded-lg" + >
+
+ {dropdownData.map((lists) => ( +
+ {" "} + + {lists.heading} + +
    + {lists.links.map((link) => ( +
  • + {" "} + {/* Ensure to add a key for list items when mapping */} + + {link.pageName} + +
  • + ))} +
-
- {openDropdown ? : } -
- {openDropdown && ( -
-
-
- {dropdownData.map((lists) => ( -
- {" "} - - {lists.heading} - -
    - {lists.links.map((link) => ( -
  • - {" "} - {/* Ensure to add a key for list items when mapping */} - - {link.pageName} - -
  • - ))} -
-
- ))} -
-
-
- )} -
- ) + ))} +
+
+
+ )} +
+ ) } \ No newline at end of file