gamebrary/src/components/NavHeader/NavHeader.vue

89 lines
2 KiB
Vue
Raw Normal View History

2018-10-19 05:15:28 +00:00
<template lang="html">
<nav :class="{ 'logged-in': user}">
<div>
<router-link :to="{ name: 'home' }" class="logo">
GAMEBRARY
</router-link>
</div>
2018-10-19 05:15:28 +00:00
<div class="settings" v-if="user">
<div v-if="platform">
<span class="platform-name">
{{ platform.name }}
</span>
2018-10-19 05:15:28 +00:00
<router-link
tag="button"
class="info"
:to="{ name: 'platforms' }"
>
<i class="fas fa-exchange-alt" />
2018-10-19 05:15:28 +00:00
</router-link>
</div>
2018-10-19 05:15:28 +00:00
<router-link
tag="button"
class="info"
:to="{ name: 'settings' }"
>
<i class="fas fa-cog" />
</router-link>
2018-10-19 05:15:28 +00:00
</div>
</nav>
</template>
<script>
import { mapState } from 'vuex';
2018-10-19 05:15:28 +00:00
export default {
computed: {
...mapState(['user', 'platform']),
isHome() {
return this.$route.name === 'home';
},
2018-10-19 05:15:28 +00:00
},
};
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
@import "~styles/styles.scss";
nav {
height: $navHeight;
width: 100%;
background: $color-dark-gray;
padding-right: 4px;
display: flex;
align-items: center;
justify-content: space-around;
color: $color-white;
&.logged-in {
justify-content: space-between;
}
.platform-name {
color: $color-light-gray;
cursor: default;
}
2018-10-19 05:15:28 +00:00
a {
color: $color-white;
text-decoration: none;
&.logo {
padding: 0 0 0 $gp;
text-transform: uppercase;
font-size: 18px;
font-weight: bold;
}
2018-10-19 05:15:28 +00:00
}
.settings {
display: flex;
align-items: center;
2018-10-19 05:15:28 +00:00
}
}
</style>