add a Login button to CoachesList

This commit is contained in:
Andreas Zweili 2021-07-29 17:00:54 +02:00
parent 752117e552
commit 4754507838
2 changed files with 11 additions and 1 deletions

View File

@ -16,7 +16,11 @@
<base-button mode="outline" @click="loadCoaches(true)"
>Refresh</base-button
>
<base-button v-if="!isCoach && !isLoading" link to="/register"
<base-button link to="/auth" v-if="!isLogggedIn">Login</base-button>
<base-button
v-if="isLogggedIn && !isCoach && !isLoading"
link
to="/register"
>Register as Coach</base-button
>
</div>
@ -58,6 +62,9 @@ export default {
};
},
computed: {
isLogggedIn() {
return this.$store.getters.isAuthenticated;
},
isCoach() {
return this.$store.getters['coaches/isCoach'];
},

View File

@ -4,5 +4,8 @@ export default {
},
token(state) {
return state.token;
},
isAuthenticated(state) {
return !!state.token;
}
};