Skip to content

Commit

Permalink
Merge pull request #90 from casper-network/navigation-enhancement
Browse files Browse the repository at this point in the history
ADDED: call-to-action property
  • Loading branch information
sd-ditoy authored Apr 25, 2024
2 parents 7c12395 + 297b957 commit 7472974
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
11 changes: 4 additions & 7 deletions src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<ul>
<li
class="nav-item"
:class="(item.class) ? item.class : ''"
v-for="(item, index) in computedNavigation" :key="`navitem-${index}`"
:class="{ special: item.special }"
:data-has-sub="!!(item.children)"
>
<div v-if="item.url && !item.children">
Expand Down Expand Up @@ -116,11 +116,13 @@ export default {
//---------------------------------------------------
computed: {
computedNavigation() {
let navigation = this.$store.state.navigations?.main_navigation || [];
const navigation = this.$store.state.navigations?.main_navigation || [];
navigation.forEach((o) => {
if (o.url) {
// eslint-disable-next-line no-param-reassign
o.type = o.url.includes('http') ? 'ext' : 'int';
// eslint-disable-next-line no-param-reassign
o.special = o.cta === true;
}
if (o.children) {
o.children.forEach((oo) => {
Expand All @@ -131,11 +133,6 @@ export default {
});
}
});
const path = 'navigation';
if (this.$i18n.te(path)) {
navigation = navigation.concat(this.$i18n.t(path));
}
return navigation;
},
},
Expand Down
8 changes: 0 additions & 8 deletions src/locales/en-us.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,6 @@ export default {
telegram: 'https://t.me/casperblockchain',
github: 'https://github.com/casper-network',
},
navigation: [
{
label: 'Get started',
url: 'get-started',
class: 'special',
type: 'int',
},
],
footer: {
socialTitle: 'Join our<br/><span>Community</span>',
metanav: [
Expand Down

0 comments on commit 7472974

Please sign in to comment.