2020-05-17 21:41:38 +00:00
|
|
|
<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-17 21:41:38 +00:00
|
|
|
|
2020-05-18 18:10:34 +00:00
|
|
|
<b-navbar-toggle target="nav-collapse"></b-navbar-toggle>
|
2020-05-17 21:41:38 +00:00
|
|
|
|
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-17 21:41:38 +00:00
|
|
|
|
2020-05-18 18:10:34 +00:00
|
|
|
<!-- Right aligned nav items -->
|
|
|
|
<b-navbar-nav class="ml-auto">
|
2020-05-17 21:41:38 +00:00
|
|
|
<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>
|
2020-05-20 05:08:42 +00:00
|
|
|
<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>
|
2020-05-17 21:41:38 +00:00
|
|
|
</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>
|
2020-05-17 21:41:38 +00:00
|
|
|
</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: {
|
2020-05-17 21:41:38 +00:00
|
|
|
...mapState('user', ['loggedIn']),
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions('user', ['logout']),
|
2020-05-18 18:10:34 +00:00
|
|
|
},
|
|
|
|
};
|
2020-05-17 21:41:38 +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-17 21:41:38 +00:00
|
|
|
}
|
|
|
|
|
2020-05-18 18:10:34 +00:00
|
|
|
.navbar-brand-title {
|
|
|
|
padding-left: 0.5em;
|
2020-05-17 21:41:38 +00:00
|
|
|
}
|
2020-05-18 16:19:45 +00:00
|
|
|
|
|
|
|
.nav-link:active {
|
2020-05-17 21:41:38 +00:00
|
|
|
color: white;
|
|
|
|
}
|
2020-05-18 18:10:34 +00:00
|
|
|
</style>
|