Fix link to direct profile on event page when external

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-08-09 11:32:14 +02:00
parent 8f31beb0fb
commit f5355b1be9
4 changed files with 30 additions and 8 deletions

View File

@@ -0,0 +1,21 @@
<template>
<span>
<router-link v-if="actor.domain === null"
:to="{name: 'Profile', params: { name: actor.preferredUsername } }"
>
<slot></slot>
</router-link>
<a v-else :href="actor.url">
<slot></slot>
</a>
</span>
</template>
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import { IActor } from '@/types/actor';
@Component
export default class ActorLink extends Vue {
@Prop() actor!: IActor;
}
</script>