api-client/components/app/Sidenav.vue

89 lines
1.8 KiB
Vue
Raw Normal View History

2020-03-04 01:17:02 +00:00
<template>
2021-07-01 16:39:11 +00:00
<aside>
<nav class="flex flex-col flex-nowrap">
<nuxt-link
v-for="(navigation, index) in primaryNavigation"
:key="`navigation-${index}`"
:to="localePath(navigation.target)"
2021-07-07 23:28:42 +00:00
class="nav-link"
>
2021-07-30 08:22:43 +00:00
<i v-if="navigation.icon" class="material-icons">
{{ navigation.icon }}
</i>
<div v-if="navigation.svg" class="h-4 w-4">
<SmartIcon :name="navigation.svg" class="svg-icons" />
</div>
2021-07-07 23:28:42 +00:00
<span>{{ navigation.title }}</span>
2021-07-01 16:39:11 +00:00
</nuxt-link>
</nav>
</aside>
2020-03-04 01:17:02 +00:00
</template>
2021-05-18 06:26:59 +00:00
<script>
export default {
data() {
return {
2021-07-01 16:39:11 +00:00
primaryNavigation: [
2021-08-02 15:27:18 +00:00
{
target: "index",
icon: "settings_ethernet",
title: this.$t("navigation.rest"),
},
{
target: "graphql",
svg: "graphql",
title: this.$t("navigation.graphql"),
},
{
target: "realtime",
icon: "language",
title: this.$t("navigation.realtime"),
},
{
target: "documentation",
icon: "book",
title: this.$t("navigation.doc"),
},
{
target: "settings",
icon: "settings",
title: this.$t("navigation.settings"),
},
],
}
},
2021-05-18 06:26:59 +00:00
}
</script>
2020-06-19 17:37:40 +00:00
<style scoped lang="scss">
2021-07-07 23:28:42 +00:00
.nav-link {
@apply p-4;
2021-07-20 10:29:30 +00:00
@apply flex flex-col flex-1;
2021-07-07 23:28:42 +00:00
@apply items-center;
@apply justify-center;
@apply transition;
2021-07-20 10:29:30 +00:00
@apply hover:bg-primaryDark;
@apply hover:text-secondaryDark;
2021-07-07 23:28:42 +00:00
2021-07-30 08:22:43 +00:00
.material-icons,
.svg-icons {
2021-07-24 16:46:48 +00:00
@apply opacity-75;
2021-07-07 23:28:42 +00:00
}
span {
@apply mt-2;
@apply font-semibold;
}
2021-08-03 04:54:32 +00:00
&.exact-active-link {
2021-07-07 23:28:42 +00:00
@apply text-accent;
@apply hover:text-accent;
2021-07-30 08:22:43 +00:00
.material-icons,
.svg-icons {
2021-07-07 23:28:42 +00:00
@apply opacity-100;
}
}
2020-06-19 17:37:40 +00:00
}
</style>