Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ui enhancement for the sub components of venue #367

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 62 additions & 59 deletions components/Navbar/navDrop.js
Original file line number Diff line number Diff line change
@@ -1,62 +1,65 @@
import React,{useState,forwardRef} from 'react';
import links from '../../config/links.json';
import Link from 'next/link';
import Dropdown from '../illustration/dropdown';
import React, { useState, forwardRef } from "react";
import links from "../../config/links.json";
import Link from "next/link";
import Dropdown from "../illustration/dropdown";


const NavDrop = forwardRef((props, ref)=> {
const {setDrop}=props;
const [show, setShow] = useState(null);
const NavDrop = forwardRef((props, ref) => {
const { setDrop } = props;
const [show, setShow] = useState(null);
return (
<div ref ={ref} className='absolute ml-[-20px] top-16 w-full bg-[#1B1130]'>
<div className='flex flex-col p-5 pb-8 w-full'>
{links.map((link) => {
return (
<Link href={link.ref} key={link.title}>
<div
className='min-h-[50px] cursor-pointer'
onClick={() =>
show === link.title ? setShow(null) : setShow(link.title)
}
>
{link.subMenu ? (
<div>
<div className='flex items-center justify-between'>
<div className='text-white'>{link.title}</div>
<Dropdown
className={`transition-transform duration-700 ${
show === link.title ? 'rotate-0' : 'rotate-[-90deg]'
}`}
/>
</div>
{show && show === link.title && (
<div className='flex flex-col py-6 w-full'>
{link.subMenu.map((sub) => (
<Link href={sub.ref} key={sub.ref}>
<div
onClick={() => setDrop(false)}
className='h-[40px] flex navbg items-center p-6 hover:text-black text-white cursor-pointer'
>
{sub.title}
</div>
</Link>
))}
</div>
)}
</div>
) : (
<div className='text-white' onClick={() => setDrop(false)}>
{link.title}
</div>
)}
</div>
</Link>
);
})}
</div>
</div>
);
})
NavDrop.displayName = 'NavDrop';
<div ref={ref} className="absolute ml-[-20px] top-16 w-full bg-[#1B1130]">
<div className="flex flex-col p-5 pb-8 w-full">
{links.map((link) => {
return (
<Link href={link.ref} key={link.title}>
<div
className="min-h-[50px] cursor-pointer"
onClick={() =>
show === link.title ? setShow(null) : setShow(link.title)
}
>
{link.subMenu ? (
<div>
<div className="flex items-center justify-between">
<div className="text-white">{link.title}</div>
<Dropdown
className={`transition-transform duration-700 ${
show === link.title ? "rotate-0" : "rotate-[-90deg]"
}`}
/>
</div>
{show && show === link.title && (
<div className="flex flex-col py-6 w-full">
{link.subMenu.map((sub) => (
<Link href={sub.ref} key={sub.ref}>
<div
onClick={() => setDrop(false)}
className="h-[40px] flex navbg items-center p-6 hover:text-black text-white cursor-pointer"
>
<img
src="/img/mapIcon4.svg"
className="h-4 w-4 mr-2"
/>
{sub.title}
</div>
</Link>
))}
</div>
)}
</div>
) : (
<div className="text-white" onClick={() => setDrop(false)}>
{link.title}
</div>
)}
</div>
</Link>
);
})}
</div>
</div>
);
});
NavDrop.displayName = "NavDrop";

export default NavDrop;
export default NavDrop;
Loading
Loading