chore: header bar component

This commit is contained in:
Ramires Viana
2021-02-25 18:37:07 +00:00
parent 62fff5ca60
commit 95811e99bc
17 changed files with 415 additions and 448 deletions

View File

@@ -0,0 +1,17 @@
<template>
<button @click="$emit('action')" :aria-label="label" :title="label" class="action">
<i class="material-icons">{{ icon }}</i>
<span>{{ label }}</span>
</button>
</template>
<script>
export default {
name: 'action',
props: [ 'icon', 'label' ]
}
</script>
<style>
</style>

View File

@@ -0,0 +1,47 @@
<template>
<header>
<img v-if="showLogo !== undefined" :src="logoURL" />
<action v-if="showMenu !== undefined" class="menu-button" icon="menu" :label="$t('buttons.toggleSidebar')" @action="openSidebar()" />
<slot />
<div id="dropdown" :class="{ active: this.$store.state.show === 'more' }">
<slot name="actions" />
</div>
<action v-if="this.$slots.actions" id="more" icon="more_vert" :label="$t('buttons.more')" @action="$store.commit('showHover', 'more')" />
<div class="overlay" v-show="this.$store.state.show == 'more'" @click="$store.commit('closeHovers')" />
</header>
</template>
<script>
import { logoURL } from '@/utils/constants'
import Action from '@/components/header/Action'
export default {
name: 'header-bar',
props: [
'showLogo',
'showMenu',
],
components: {
Action
},
data: function () {
return {
logoURL
}
},
methods: {
openSidebar () {
this.$store.commit('showHover', 'sidebar')
}
}
}
</script>
<style>
</style>