classic-ui-dev/components/Navbar.vue

86 lines
2.3 KiB
Vue
Raw Normal View History

2022-04-21 23:05:56 -04:00
<template>
<b-navbar wrapper-class="container" class="header">
<template slot="brand">
2022-05-16 08:08:17 -04:00
<b-navbar-item tag="router-link" to="/" data-test="tornado_main_page" active-class="">
2022-04-21 23:05:56 -04:00
<Logo />
</b-navbar-item>
</template>
<template slot="start">
<b-navbar-item
v-if="isEnabledGovernance"
tag="router-link"
to="/governance"
2022-06-13 10:22:04 -04:00
data-test="voting_link"
2022-04-21 23:05:56 -04:00
:active="$route.path.includes('governance')"
class="has-tag"
>
{{ $t('governance') }} <span v-if="hasActiveProposals" class="navbar-item--tag"></span>
</b-navbar-item>
2022-06-13 10:22:04 -04:00
<b-navbar-item tag="router-link" to="/compliance" data-test="compliance_link">
2022-04-21 23:05:56 -04:00
{{ $t('compliance') }}
</b-navbar-item>
2022-06-06 10:26:00 -04:00
<b-navbar-item
href="https://docs.tornado.cash"
target="_blank"
2022-06-13 10:22:04 -04:00
data-test="docs_link"
2022-06-06 10:26:00 -04:00
rel="noopener noreferrer"
class="has-tag"
>
2022-04-21 23:05:56 -04:00
<b-icon icon="open-book" size="is-small" class="mr-1" />
<span>{{ $t('docs') }}</span>
</b-navbar-item>
</template>
<template slot="end">
<b-navbar-item tag="div">
<div class="buttons">
<network-navbar-icon />
2022-05-16 08:08:17 -04:00
<metamask-navbar-icon data-test="metamask_connection_state" />
<indicator data-test="note_account_connection_state" />
<b-button
icon-left="settings"
type="is-primary"
outlined
data-test="button_settings"
@mousedown.prevent
@click="onAccount"
>
2022-04-21 23:05:56 -04:00
{{ $t('settings') }}
</b-button>
</div>
</b-navbar-item>
</template>
</b-navbar>
</template>
<script>
import { mapState, mapGetters } from 'vuex'
import Logo from '@/components/Logo'
import { Indicator } from '@/modules/account'
import MetamaskNavbarIcon from '@/components/MetamaskNavbarIcon'
import NetworkNavbarIcon from '@/components/NetworkNavbarIcon'
export default {
components: {
Logo,
Indicator,
NetworkNavbarIcon,
MetamaskNavbarIcon
},
data() {
return {
isActive: false
}
},
computed: {
...mapGetters('metamask', ['netId', 'isLoggedIn']),
...mapGetters('governance/gov', ['isEnabledGovernance']),
...mapState('governance/gov', ['hasActiveProposals'])
},
methods: {
onAccount() {
this.$router.push('/account')
}
}
}
</script>