Files
habitica/website/client/src/components/groupLink.vue
T
Tom Thorpe c00a1d74f9 Allow group links on challenge details to be opened in a new tab (#11889)
* - Use `router-link` in `groupLink` to make links that can be followed in a new tab

* - Add back the missing `if` statement that was removed in error
2020-02-29 18:46:41 +01:00

39 lines
597 B
Vue

<template>
<router-link
v-if="group"
:to="toPath"
>
{{ group.name }}
</router-link>
</template>
<script>
import { TAVERN_ID } from '@/../../common/script/constants';
export default {
props: ['group'],
computed: {
toPath () {
if (this.group._id === TAVERN_ID) {
return {
name: 'tavern',
};
}
if (this.group.type === 'party') {
return {
name: 'party',
};
}
return {
name: 'guild',
params: {
groupId: this.group._id,
},
};
},
},
};
</script>