2020-10-12 19:41:52 +02:00
|
|
|
<template>
|
|
|
|
<b-navbar wrapper-class="container" class="header">
|
|
|
|
<template slot="brand">
|
|
|
|
<b-navbar-item tag="router-link" to="/" active-class="">
|
|
|
|
<Logo />
|
|
|
|
</b-navbar-item>
|
|
|
|
</template>
|
2020-10-13 09:49:08 +02:00
|
|
|
<template slot="start">
|
2020-11-03 07:54:19 +01:00
|
|
|
<b-navbar-item>{{ $t('info') }}</b-navbar-item>
|
2020-10-13 09:49:08 +02:00
|
|
|
</template>
|
|
|
|
<template slot="end">
|
|
|
|
<b-navbar-item tag="div">
|
|
|
|
<div class="buttons">
|
|
|
|
<b-button
|
|
|
|
v-if="isLoggedIn"
|
|
|
|
type="is-primary"
|
|
|
|
outlined
|
|
|
|
icon-left="logout"
|
|
|
|
@click="onLogOut"
|
2020-11-03 07:54:19 +01:00
|
|
|
>{{ $t('logout') }}</b-button
|
2020-10-13 09:49:08 +02:00
|
|
|
>
|
|
|
|
<b-button
|
|
|
|
v-else
|
|
|
|
type="is-primary"
|
|
|
|
outlined
|
|
|
|
icon-left="wallet"
|
|
|
|
@click="onLogIn"
|
2020-11-03 07:54:19 +01:00
|
|
|
>{{ $t('connect') }}</b-button
|
2020-10-13 09:49:08 +02:00
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</b-navbar-item>
|
|
|
|
</template>
|
2020-10-12 19:41:52 +02:00
|
|
|
</b-navbar>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Logo from '@/components/Logo'
|
2020-10-30 09:01:41 +01:00
|
|
|
import Web3Connect from '@/components/Web3Connect'
|
2020-11-03 12:48:03 +01:00
|
|
|
import { mapGetters, mapActions } from 'vuex'
|
2020-10-12 19:41:52 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Logo,
|
|
|
|
},
|
2020-11-03 12:48:03 +01:00
|
|
|
computed: {
|
|
|
|
...mapGetters('provider', ['getProviderName']),
|
|
|
|
isLoggedIn() {
|
|
|
|
return !!this.getProviderName
|
|
|
|
},
|
2020-10-13 09:49:08 +02:00
|
|
|
},
|
|
|
|
methods: {
|
2020-11-03 12:48:03 +01:00
|
|
|
...mapActions('provider', ['clearState']),
|
2020-10-30 09:01:41 +01:00
|
|
|
onLogIn() {
|
|
|
|
this.$buefy.modal.open({
|
|
|
|
parent: this,
|
|
|
|
component: Web3Connect,
|
|
|
|
hasModalCard: true,
|
|
|
|
width: 440,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
onLogOut() {
|
2020-11-03 12:48:03 +01:00
|
|
|
this.clearState()
|
2020-10-30 09:01:41 +01:00
|
|
|
},
|
2020-10-13 09:49:08 +02:00
|
|
|
},
|
2020-10-12 19:41:52 +02:00
|
|
|
}
|
|
|
|
</script>
|