<!--
SPDX-FileCopyrightText: WTF Kooperative eG <https://wtf-eg.de/>

SPDX-License-Identifier: AGPL-3.0-or-later
-->

<template>
  <header v-if="this.$route.path.includes('/s/')">
    <Navbar />
  </header>
  <router-view />
  <Footer />
</template>
<script>
import Footer from '@/views/partials/Footer.vue'
import Navbar from '@/views/partials/Navbar.vue'

export default {
  name: "App",
  components: {
    Footer,
    Navbar,
  },
  data() {
    return {
      showMobileNavbar: false,
      memberId: null,
      searchText: "",
    };
  },
  created() {
    this.memberId = localStorage.getItem("user_id");
  },
  updated() {
    this.memberId = localStorage.getItem("user_id");
  },
  methods: {
    logout() {
      localStorage.clear();
      this.$router.push({ path: "/" });
    },
    searchRedirect() {
      this.$router.push({ path: `/s/search?text`, query: { query: this.searchText } } );
    },
  },
};
</script>
