frequi_origin/src/components/layout/NavBar.vue

72 lines
1.7 KiB
Vue
Raw Normal View History

<template>
2020-05-18 18:10:34 +00:00
<div>
<b-navbar toggleable="lg" type="dark" variant="info">
<b-navbar-brand exact to="/">
<img class="logo" src="@/assets/freqtrade-logo.png" alt="Home Logo" />
<span class="navbar-brand-title">Freqtrade UI</span>
</b-navbar-brand>
2020-05-18 18:10:34 +00:00
<b-navbar-toggle target="nav-collapse"></b-navbar-toggle>
2020-05-18 18:10:34 +00:00
<b-collapse id="nav-collapse" is-nav>
<b-navbar-nav>
<b-nav-item to="/trade">Trade</b-nav-item>
<b-nav-item to="/about">About</b-nav-item>
</b-navbar-nav>
2020-05-18 18:10:34 +00:00
<!-- Right aligned nav items -->
<b-navbar-nav class="ml-auto">
<li class="nav-item" v-if="loggedIn">
<b-nav-item-dropdown right>
2020-05-18 18:10:34 +00:00
<template v-slot:button-content>
<b-avatar button src="https://placekitten.com/300/300"></b-avatar>
2020-05-18 18:10:34 +00:00
</template>
<b-dropdown-item to="/settings">Settings</b-dropdown-item>
<b-dropdown-item to="/" v-on:click.native="logout()">Sign Out</b-dropdown-item>
</b-nav-item-dropdown>
</li>
<li v-else>
<!-- should open Modal window! -->
<Login />
</li>
2020-05-18 18:10:34 +00:00
</b-navbar-nav>
</b-collapse>
</b-navbar>
</div>
</template>
<script>
import { mapActions, mapState } from 'vuex';
import Login from '@/views/Login.vue';
export default {
2020-05-18 18:10:34 +00:00
name: 'NavBar',
components: { Login },
computed: {
...mapState('user', ['loggedIn']),
},
methods: {
...mapActions('user', ['logout']),
2020-05-18 18:10:34 +00:00
},
};
</script>
<style>
.logo {
vertical-align: middle;
height: 30px;
}
.dropdown-toggle::after {
2020-05-18 18:10:34 +00:00
display: none;
}
2020-05-18 18:10:34 +00:00
.navbar-brand-title {
padding-left: 0.5em;
}
.nav-link:active {
color: white;
}
2020-05-18 18:10:34 +00:00
</style>