keanu-weblite/src/components/YouAre.vue

60 lines
1.5 KiB
Vue
Raw Normal View History

2021-07-06 13:27:15 +02:00
<template>
2025-01-14 11:14:11 +00:00
<div>
2021-07-06 13:27:15 +02:00
<v-chip
@click="viewProfile"
class="ma-2 white-space-pre"
2021-07-06 13:27:15 +02:00
:color="dark ? 'black' : '#ededed'"
:text-color="dark ? 'white' : 'black'"
2025-05-08 11:52:39 +02:00
:variant="!dark ? 'ouelined' : 'tonal'"
2021-07-06 13:27:15 +02:00
>{{ $t("profile_info_popup.you_are") }}&nbsp;
<span v-if="$matrix.currentUser.is_guest">
2025-05-06 09:27:53 +02:00
<i18n-t keypath="profile_info_popup.identity_temporary" tag="span">
2021-07-06 13:27:15 +02:00
<template v-slot:displayName>
<b>{{ displayName }}</b>
</template>
2025-05-06 09:27:53 +02:00
</i18n-t>
2021-07-06 13:27:15 +02:00
</span>
<span v-else>
2025-05-06 09:27:53 +02:00
<i18n-t keypath="profile_info_popup.identity" tag="span">
2021-07-06 13:27:15 +02:00
<template v-slot:displayName>
<b>{{ displayName }}</b>
</template>
2025-05-06 09:27:53 +02:00
</i18n-t>
2021-07-06 13:27:15 +02:00
</span>
<v-avatar color="#e0e0e0" right @click.stop="viewProfile">
2025-03-31 16:33:54 +02:00
<AuthedImage v-if="userAvatar" :src="userAvatar" />
2025-05-06 10:53:34 +02:00
<span v-else class="text-white">{{ userAvatarLetter }}</span>
2021-07-06 13:27:15 +02:00
</v-avatar>
</v-chip>
</div>
</template>
<script>
import profileInfoMixin from "./profileInfoMixin";
2025-03-31 16:33:54 +02:00
import AuthedImage from "./AuthedImage.vue";
2021-07-06 13:27:15 +02:00
export default {
name: "YouAre",
mixins: [profileInfoMixin],
2025-03-31 16:33:54 +02:00
components: { AuthedImage },
2021-07-06 13:27:15 +02:00
props: {
dark: {
type: Boolean,
default: function () {
return false;
},
},
},
data() {
return {};
},
methods: {
viewProfile() {
this.$navigation.push({ name: "Profile" }, 1);
},
},
};
</script>
<style lang="scss">
@import "@/assets/css/chat.scss";
</style>