Browse Source

Hide demo and signin button on authenticated state

pull/341/head
Hironsan 5 years ago
parent
commit
5064c66261
1 changed files with 13 additions and 2 deletions
  1. 15
      frontend/components/organisms/TheHeader.vue

15
frontend/components/organisms/TheHeader.vue

@ -12,12 +12,17 @@
</v-toolbar-title> </v-toolbar-title>
<div class="flex-grow-1" /> <div class="flex-grow-1" />
<v-btn <v-btn
v-if="isAuthenticated"
text text
@click="$router.push('/projects')" @click="$router.push('/projects')"
> >
Projects Projects
</v-btn> </v-btn>
<v-menu open-on-hover offset-y>
<v-menu
v-if="!isAuthenticated"
open-on-hover
offset-y
>
<template v-slot:activator="{ on }"> <template v-slot:activator="{ on }">
<v-btn <v-btn
text text
@ -38,16 +43,18 @@
</v-list> </v-list>
</v-menu> </v-menu>
<v-btn <v-btn
v-if="!isAuthenticated"
outlined outlined
@click="$router.push('/auth')" @click="$router.push('/auth')"
> >
Sign in Sign in
</v-btn> </v-btn>
<the-top-menu />
<the-top-menu v-if="isAuthenticated" />
</v-app-bar> </v-app-bar>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
import TheTopMenu from '@/components/organisms/TheTopMenu' import TheTopMenu from '@/components/organisms/TheTopMenu'
export default { export default {
@ -64,6 +71,10 @@ export default {
{ title: 'Text to SQL', link: 'text-to-sql' } { title: 'Text to SQL', link: 'text-to-sql' }
] ]
} }
},
computed: {
...mapGetters('auth', ['isAuthenticated'])
} }
} }
</script> </script>

Loading…
Cancel
Save