<template>
  <div class="main-layout is-h5" :class="{ 'is-fixed': isFixed }">
    <app-header />
    <div v-show="!isFixed">
      <Nuxt />
      <app-footer />
    </div>
  </div>
</template>

<script>
import AppHeader from './Header'
import AppFooter from './Footer'
export default {
  components: { AppHeader, AppFooter },
  computed: {
    isFixed() {
      const { searchVisible, menuVisible } = this.$store.state
      return searchVisible || menuVisible
    }
  }
}
</script>

<style lang="scss">
.is-h5 {
  &.main-layout {
    max-width: 750px;
    min-height: 100vh;
    margin: 0 auto;
    overflow: hidden;
    background-color: #f9f8f8;
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.04);
  }
}
</style>