fix: update base menu
This commit is contained in:
@@ -1,51 +1,45 @@
|
||||
import s from './styles.module.scss';
|
||||
import Image from 'next/image';
|
||||
import dtrLogo from '@public/images/dtr-logo-eagle.png';
|
||||
import { baseMenu, TMenu } from '@core/constants/menu';
|
||||
import { Icons } from '@shared/ui/icon';
|
||||
import Link from 'next/link';
|
||||
|
||||
function BaseMenu() {
|
||||
const Menu = ({ list }: { list: TMenu }) => {
|
||||
const nodeList = (list: TMenu) => {
|
||||
return list.map((item, index) => {
|
||||
if (item.children && item.children.length) {
|
||||
return (
|
||||
<li key={index} className={s.Parent}>
|
||||
<div className={s.Row}>
|
||||
{item.name}
|
||||
<Icons.MenuArrow className={s.Expand} />
|
||||
</div>
|
||||
<ul className={s.Child}>{nodeList(item.children)}</ul>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<li key={index}>
|
||||
<Link href={item.link!}>{item.name}</Link>
|
||||
</li>
|
||||
);
|
||||
});
|
||||
};
|
||||
return (
|
||||
<nav className={s.Nav}>
|
||||
<ul className={s.Menu}>{nodeList(list)}</ul>
|
||||
</nav>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<section className={s.ContainerNavbar}>
|
||||
<div className={s.Navbar}>
|
||||
<Image src={dtrLogo} alt={'ДиТрасо'} quality={75} priority />
|
||||
<nav className={s.Nav}>
|
||||
<ul className={s.Menu}>
|
||||
<li>
|
||||
<a href='#'>Экспертиза</a>
|
||||
</li>
|
||||
<li className={s.Parent}>
|
||||
<a href='#'>Оценка</a> <span className={s.Expand}>🢒</span>
|
||||
<ul className={s.Child}>
|
||||
<li>
|
||||
<a href='#'>Link1</a>
|
||||
</li>
|
||||
<li className={s.Parent}>
|
||||
<a href='#'>Link2</a>{' '}
|
||||
<span className={s.Expand}>🢒</span>
|
||||
<ul className={s.Child}>
|
||||
<li>
|
||||
<a href='#'>SubLink 1 asdasd</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='#'>SubLink 2 asdasdasd</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='#'>SubLink 3 xczzxcc</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href='#'>Юрист</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='#'>Эксперты</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='#'>Контакты</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<Menu list={baseMenu} />
|
||||
<div className={s.Invite}>
|
||||
<button>+7 (999) 123-45-67</button>
|
||||
</div>
|
||||
@@ -55,81 +49,3 @@ function BaseMenu() {
|
||||
}
|
||||
|
||||
export { BaseMenu };
|
||||
|
||||
const Menu = [
|
||||
{
|
||||
menuItem: {
|
||||
name: 'Home',
|
||||
link: '/home',
|
||||
},
|
||||
},
|
||||
{
|
||||
menuItem: {
|
||||
name: 'Link1',
|
||||
children: [
|
||||
{
|
||||
menuItem: {
|
||||
name: 'link1-1',
|
||||
link: '/home',
|
||||
},
|
||||
},
|
||||
{
|
||||
menuItem: {
|
||||
name: 'link1-2',
|
||||
link: '/home',
|
||||
},
|
||||
},
|
||||
{
|
||||
menuItem: {
|
||||
name: 'link1-3',
|
||||
link: '/home',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
menuItem: {
|
||||
name: 'Link2',
|
||||
children: [
|
||||
{
|
||||
menuItem: {
|
||||
name: 'link2-1',
|
||||
link: '/home',
|
||||
},
|
||||
},
|
||||
{
|
||||
menuItem: {
|
||||
name: 'link2-2',
|
||||
children: [
|
||||
{
|
||||
menuItem: {
|
||||
name: 'link2-1',
|
||||
link: '/home',
|
||||
},
|
||||
},
|
||||
{
|
||||
menuItem: {
|
||||
name: 'link2-2',
|
||||
link: '/home',
|
||||
},
|
||||
},
|
||||
{
|
||||
menuItem: {
|
||||
name: 'link2-3',
|
||||
link: '/home',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
menuItem: {
|
||||
name: 'link2-3',
|
||||
link: '/home',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user