-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathHeader.vue
More file actions
153 lines (153 loc) · 4.35 KB
/
Header.vue
File metadata and controls
153 lines (153 loc) · 4.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<template>
<v-app-bar app color="rgb(56, 56, 56)" dark>
<v-toolbar-title>
<div class="d-flex justify-space-between align-center">
<nuxt-link to="/">
<img
src="@/assets/images/LightningNetworkStores.svg"
class="nav-logo"
/>
</nuxt-link>
<v-menu v-if="sisterSites.length" v-model="showMenu" offset-y bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon large color="grey lighten-1" v-bind="attrs" v-on="on">
mdi-chevron-down
</v-icon>
</template>
<v-list id="networkWebSite" color="#383838">
<v-list-item v-for="site in sisterSites" :key="site.url">
<v-list-item-title>
<a :href="site.url">
<img :src="site.svgPath" class="nav-logo" />
</a>
</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</div>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-toolbar-items class="hidden-sm-and-down">
<v-btn text v-for="route in routes" :key="route.text" :to="route.url">
<v-badge
v-if="isDiscussionNotificationShowed && route.text === 'Discuss'"
color="orange"
dot
inline
left
>
{{ route.text }}
</v-badge>
<div v-else>
{{ route.text }}
</div>
</v-btn>
<v-btn
icon
href="https://twitter.com/bitcoinLNS"
class="hidden-sm-and-down"
>
<v-icon>fab fa-twitter</v-icon>
</v-btn>
</v-toolbar-items>
<v-menu class="hidden-md-and-up">
<template v-slot:activator="{ on, attrs }">
<v-app-bar-nav-icon class="hidden-md-and-up" v-bind="attrs" v-on="on">
<template #default>
<v-badge
v-if="isDiscussionNotificationShowed"
color="orange"
dot
overlap
>
<v-icon>mdi-menu</v-icon>
</v-badge>
<v-icon v-else>mdi-menu</v-icon>
</template>
</v-app-bar-nav-icon>
</template>
<v-list>
<v-list-item v-for="route in routes" :key="route.text" :to="route.url">
<v-list-item>
<v-list-item-title>
<v-badge
v-if="
isDiscussionNotificationShowed && route.text === 'Discuss'
"
color="orange"
dot
>
{{ route.text }}
</v-badge>
<div v-else>
{{ route.text }}
</div>
</v-list-item-title>
</v-list-item>
</v-list-item>
<v-list-item href="https://twitter.com/bitcoinLNS">
<v-list-item>
<v-list-item-title>Twitter</v-list-item-title>
</v-list-item>
</v-list-item>
</v-list>
</v-menu>
</v-app-bar>
</template>
<script>
import { mapState } from 'vuex'
export default {
data() {
return {
routes: [
{ url: '/discuss', text: 'Discuss' },
{ url: '/faucet', text: 'Faucet' },
{ url: '/stats', text: 'Statistics' },
//{ url: '/wallets', text: 'Wallets' },
//{ url: '/donations', text: 'Donations' },
{ url: '/about', text: 'About' },
],
sisterSites: [
{
url: 'https://bitcoin-stores.com',
svgPath: 'https://bitcoin-stores.com/bitcoin-stores.com.svg',
},
{
url: 'nostr.bitcoin-stores.com',
svgPath: 'https://bitcoin-stores.com/nostr.bitcoin-stores.com.svg',
},
{
url: 'yp.bitcoin-stores.com',
svgPath: 'https://bitcoin-stores.com/yp.bitcoin-stores.com.svg',
},
],
showMenu: false,
}
},
computed: {
...mapState({
isDiscussionNotificationShowed(state) {
return state.lastActivity - 500 > state.lastCommentSeenTimestamp
},
}),
},
methods: {
toggleDarkmode() {
this.$cookies.set('darkMode', !this.$vuetify.theme.dark, '3y')
this.$vuetify.theme.dark = !this.$vuetify.theme.dark
this.$vuetify.theme.dark = false // turn it off always
},
},
}
</script>
<style>
.v-toolbar__content {
height: 64px !important;
}
.nav-logo {
height: 55px;
}
.btndarkmode .v-btn__content {
font-size: 2em !important;
}
</style>