Skip to content

Commit

Permalink
Merge pull request #15 from deco-sites/feat/header
Browse files Browse the repository at this point in the history
fix: ajsutes links menu mobile
  • Loading branch information
RodolfoN1 authored Mar 21, 2024
2 parents fb71ff8 + 5ae7534 commit 556fd9b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
33 changes: 15 additions & 18 deletions components/header/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,17 @@ interface PropsMenuItem {
}

function MenuItem({ item }: PropsMenuItem) {
const existsChildren = item && item.children && item.children.length > 0
? true
: false;
const existsChildren = item && item.children && item.children.length > 0 ? true : false;

return (
<>
<div
class={`${
existsChildren ? "collapse collapse-arrow" : ""
} n1-menu-mobile`}
>
class={clx(`${existsChildren ? "collapse collapse-arrow" : ""} n1-menu-mobile`)}>
{existsChildren && (
<input class="n1-menu-mobile__input" type="checkbox" />
)}

<div
class={clx(
`${
existsChildren ? "is-children" : ""
} collapse-title mobile:font-black n1-menu-mobile__title flex items-center justify-between`,
)}
>
<div class={clx(`${existsChildren ? "is-children" : ""} collapse-title mobile:font-black n1-menu-mobile__title flex items-center justify-between`)}>
{item.name}

{item && item.children && item.children.length === 0 && (
Expand All @@ -51,9 +40,15 @@ function MenuItem({ item }: PropsMenuItem) {
}
{existsChildren && item && item.children &&
item.children.map((node) => {
console.log('node -------> ', node)
return (
<li>
<MenuItem item={node} />
<a
href={`${node?.url ? node?.url : "javascript:void(0)"}`}
style={{ pointerEvents: `${node?.url ? "all" : "none"}` }} >

<MenuItem item={node} />
</a>
</li>
);
})}
Expand All @@ -72,16 +67,18 @@ function Menu({ items, whatsapp }: Props) {
{items.map((item) => {
return (
<li class="pt-[16px]">
{/* <a href={`${item && item.children && item.children.length > 0 ? '' : item?.url }`}> */}
<a href="#">
<a
href={`${item?.url ? item?.url : "javascript:void(0)"}`}
style={{ pointerEvents: `${item?.url ? "all" : "none"}` }}>

<MenuItem item={item} />
</a>
</li>
);
})}
<Legend nameItemScape={itemLegend} mobile={true} />
</ul>
<div class="w-[90%] mx-auto">
<div class="n1-menu-mobile__whatsapp w-[90%] mx-auto">
{whatsapp && (
<LinkTelephoneWithOptionArrow
activeArrow={false}
Expand Down
4 changes: 1 addition & 3 deletions tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,7 @@

.animation-section-brand{animation: slide 20s linear infinite;}

/* .n1-text-top-width-carousel__dots{
gap: initial !important;
} */
.n1-menu-mobile__whatsapp a{width:100%}

.n1-text-icon-image__image.is-active:after{
top: 0;
Expand Down

0 comments on commit 556fd9b

Please sign in to comment.