Make Challenge Owner's Name Clickable (#9283)

This commit is contained in:
Marvin Rabe
2018-05-01 17:23:02 +02:00
parent 4e4181a394
commit 88b14592c5
5 changed files with 36 additions and 23 deletions

View File

@@ -0,0 +1,21 @@
<template lang="pug">
b-link(
v-if='user && user.profile',
@click.prevent='showProfile(user)'
) {{user.profile.name}}
</template>
<script>
export default {
props: ['user'],
methods: {
async showProfile (user) {
let heroDetails = await this.$store.dispatch('members:fetchMember', { memberId: user._id });
this.$root.$emit('habitica:show-profile', {
user: heroDetails.data.data,
startingPage: 'profile',
});
},
},
};
</script>