Skip to content
Snippets Groups Projects
Sidebar.vue 1.44 KiB
Newer Older
Pierre-Jean CHANCELLIER's avatar
Pierre-Jean CHANCELLIER committed
<template>
    <aside class="menu shadow position-fixed">
        <div class="nav_header pb-3 mb-4">
Pierre-Jean CHANCELLIER's avatar
Pierre-Jean CHANCELLIER committed
            <nuxt-link :to="localePath('/')" class="d-flex">
                <img src="@/assets/img/logo.png" alt="Accueil" class="logo">
Pierre-Jean CHANCELLIER's avatar
Pierre-Jean CHANCELLIER committed
                <div><h1 class="h2">Wotwizard</h1><small class="text-muted">{{ $t('slogan') }}</small></div>
            </nuxt-link>
            <div class="d-flex text-info justify-content-between align-items-baseline mt-3 mx-2">
                <div class="">v0.02</div>
Benoît Besnard's avatar
Benoît Besnard committed
                <div class="small" v-if="countMax">Bloc n°<span class="font-weight-bold">{{ countMax.number }}</span> ({{ $d(new Date(countMax.utc0*1000), 'short') }} {{ $t('time.a') }} {{ $d(new Date(countMax.utc0*1000), 'time') }})</div>
Pierre-Jean CHANCELLIER's avatar
Pierre-Jean CHANCELLIER committed
            <button type="button" class="close position-absolute d-xl-none" aria-label="Close" @click="toggleMenu">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
            <NavigationMenuGroup v-for="menu in menus" :key="menu.title" :menu="menu"/>
Pierre-Jean CHANCELLIER's avatar
Pierre-Jean CHANCELLIER committed
        </nav>
    </aside>
</template>

<script>
import {LAST_BLOCK} from '@/graphql/queries.js'

Pierre-Jean CHANCELLIER's avatar
Pierre-Jean CHANCELLIER committed
export default {
Pierre-Jean CHANCELLIER's avatar
Pierre-Jean CHANCELLIER committed
    props: {
        menus: Array
Pierre-Jean CHANCELLIER's avatar
Pierre-Jean CHANCELLIER committed
    },
    methods: {
        toggleMenu() {
            this.$emit('toggleMenu')
        }
    },
    apollo: {
        countMax : {
            query: LAST_BLOCK,
            error (err) {this.error = err.message}
        }
    },
Pierre-Jean CHANCELLIER's avatar
Pierre-Jean CHANCELLIER committed
}