add a Login button to CoachesList
This commit is contained in:
parent
752117e552
commit
4754507838
|
@ -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'];
|
||||
},
|
||||
|
|
|
@ -4,5 +4,8 @@ export default {
|
|||
},
|
||||
token(state) {
|
||||
return state.token;
|
||||
},
|
||||
isAuthenticated(state) {
|
||||
return !!state.token;
|
||||
}
|
||||
};
|
||||
|
|
Reference in New Issue