Skip to content

Commit 3e493ef

Browse files
feat(core): add custom top menu & tooltips ✨
1 parent 85c8b99 commit 3e493ef

File tree

2 files changed

+75
-11
lines changed

2 files changed

+75
-11
lines changed

src/modules/_core/components/core.header.component.vue

Lines changed: 66 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,36 @@
2424
<router-link to="/">{{ config.app.title }}</router-link>
2525
</v-toolbar-title>
2626
<div class="flex-grow-1"></div>
27-
<v-btn v-if="!isLoggedIn" icon>
28-
<router-link to="/signin">
29-
<v-icon :style="{color: config.vuetify.theme.themes[theme].onPrimary}">fa-user</v-icon>
30-
</router-link>
31-
</v-btn>
32-
<v-btn v-else @click="signout" icon>
33-
<v-icon :style="{color: config.vuetify.theme.themes[theme].onPrimary}">fa-arrow-right</v-icon>
34-
</v-btn>
27+
<!-- custom menu -->
28+
<v-tooltip v-for="({ icon, title, link }, i) in links" :key="i" bottom>
29+
<template v-slot:activator="{ on, attrs }">
30+
<v-btn v-bind="attrs" v-on="on" min-width="50" min-height="50" x-small icon>
31+
<a :href="link">
32+
<v-icon :style="{color: config.vuetify.theme.themes[theme].onPrimary}">{{icon}}</v-icon>
33+
</a>
34+
</v-btn>
35+
</template>
36+
<span>{{title}}</span>
37+
</v-tooltip>
38+
<!-- user menu -->
39+
<v-tooltip bottom>
40+
<template v-slot:activator="{ on, attrs }">
41+
<v-btn v-if="!isLoggedIn" v-bind="attrs" v-on="on" min-width="50" min-height="50" x-small icon>
42+
<router-link to="/signin">
43+
<v-icon :style="{color: config.vuetify.theme.themes[theme].onPrimary}">fa-user</v-icon>
44+
</router-link>
45+
</v-btn>
46+
</template>
47+
<span>Sign In</span>
48+
</v-tooltip>
49+
<v-tooltip bottom>
50+
<template v-slot:activator="{ on, attrs }">
51+
<v-btn v-if="isLoggedIn" @click="signout" v-bind="attrs" v-on="on" min-width="50" min-height="50" x-small icon>
52+
<v-icon :style="{color: config.vuetify.theme.themes[theme].onPrimary}">fa-arrow-right</v-icon>
53+
</v-btn>
54+
</template>
55+
<span>Sign Out</span>
56+
</v-tooltip>
3557
</v-app-bar>
3658
</template>
3759
<script>
@@ -45,6 +67,42 @@ import { mapGetters } from 'vuex';
4567
*/
4668
export default {
4769
name: 'waosHeader',
70+
data() {
71+
return {
72+
links: [
73+
{
74+
icon: 'fab fa-github',
75+
title: 'Github',
76+
link: 'https://github.com/weareopensource/',
77+
},
78+
{
79+
icon: 'fab fa-docker',
80+
title: 'Docker Hub',
81+
link: 'https://hub.docker.com/orgs/weareopensource/repositories',
82+
},
83+
{
84+
icon: 'fab fa-github-alt',
85+
title: 'Github projects',
86+
link: 'https://github.com/WeAreOpenSourceProjects',
87+
},
88+
{
89+
icon: 'fab fa-discord',
90+
title: 'Discord',
91+
link: 'https://discord.gg/U2a2vVm',
92+
},
93+
{
94+
icon: 'fab fa-slack',
95+
title: 'Slack',
96+
link: 'https://join.slack.com/t/weareopensource/shared_invite/zt-62p1qxna-PEQn289qx6mmHobzKW8QFw',
97+
},
98+
{
99+
icon: 'fab fa-twitter',
100+
title: 'Twitter',
101+
link: 'https://twitter.com/waos_io',
102+
},
103+
],
104+
};
105+
},
48106
computed: {
49107
...mapGetters(['theme', 'isLoggedIn']),
50108
drawer: {

src/modules/_core/components/core.nav.component.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@
2121
<v-list-item-action
2222
:style="(config.vuetify.theme.navigation.selectBorder && testRoute(item.path, $route.path)) ? 'margin-left: -4px;' : 'margin-left: -4px;'"
2323
>
24-
<v-icon
25-
:style="{color: config.vuetify.theme.themes[theme].onPrimary}"
26-
>fa-{{ item.meta.icon }}</v-icon>
24+
<v-tooltip right>
25+
<template v-slot:activator="{ on, attrs }">
26+
<v-icon
27+
v-bind="attrs" v-on="on"
28+
:style="{color: config.vuetify.theme.themes[theme].onPrimary}"
29+
>fa-{{ item.meta.icon }}</v-icon>
30+
</template>
31+
<span>{{item.name}}</span>
32+
</v-tooltip>
2733
</v-list-item-action>
2834
<v-list-item-content>
2935
<v-list-item-title

0 commit comments

Comments
 (0)