Skip to content

Commit

Permalink
style(NavigationZone): Add active style to dropdown button
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasevano committed Jun 11, 2021
1 parent d04e231 commit 11ede3a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions components/slices/NavigationZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<button
:dropdown-index="`${index}`"
class="dropdown-toggle navigation-zone__item links-group"
:class="{
'current-active-link': subIsActive(menuItem.subNavigationLinks),
}"
@click="toggleDropdown(`${index}`)"
@click.stop.prevent
>
Expand Down Expand Up @@ -89,6 +92,16 @@ export default {
this.openDropdownIndex = dropdownIndex
}
},
subIsActive(subNavigationLinks) {
const paths = subNavigationLinks.map((subNavigationLink) => {
const splittedLink = subNavigationLink.link.url.split('/')
const linkIndex = splittedLink.length - 1
return splittedLink[linkIndex]
})
return paths.some((path) => {
return this.$route.path.includes(path)
})
},
},
}
Expand Down Expand Up @@ -156,6 +169,10 @@ class Navigation {
align-items: center;
height: 100%;
.current-active-link {
color: $blue;
}
&__item {
color: $grey-60;
font-family: $font-roboto;
Expand Down

0 comments on commit 11ede3a

Please sign in to comment.