Skip to content

Commit

Permalink
dynamic underline in NavDesktopTopHat
Browse files Browse the repository at this point in the history
  • Loading branch information
stephiescastle committed Sep 20, 2024
1 parent ac0d944 commit 2340c27
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/vue/src/components/NavDesktop/NavDesktopTopHat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@
:class="{ '-ml-3': index === 0 }"
>
<span
class="can-hover:group-hover:border-jpl-red-light inline-block py-2 border-b-2"
:class="index === 0 ? 'border-jpl-red-light' : 'border-transparent'"
class="can-hover:group-hover:border-jpl-red inline-block py-2 border-b-2"
:class="
(getLinkText(item) === 'JPL' && !themeStore.isEdu) ||
(getLinkText(item) === 'Education' && themeStore.isEdu)
? 'border-jpl-red'
: 'border-transparent'
"
>
{{ getLinkText(item) }}
</span>
Expand All @@ -29,6 +34,8 @@
<script lang="ts">
import { defineComponent } from 'vue'
import { mixinGetRouterLink, mixinGetLinkText } from './../../utils/mixins'
import { mapStores } from 'pinia'
import { useThemeStore } from './../../store/theme'
import BaseLink from './../BaseLink/BaseLink.vue'
import type { LinkObject } from './../../utils/mixins'
import type { PropType } from 'vue'
Expand All @@ -51,6 +58,9 @@ export default defineComponent({
getLinkText(link: LinkObject): string | undefined {
return mixinGetLinkText(link)
}
},
computed: {
...mapStores(useThemeStore)
}
})
</script>

0 comments on commit 2340c27

Please sign in to comment.