Sharkey/src/client/components/sub-note-content.vue

72 lines
1.6 KiB
Vue
Raw Normal View History

<template>
2020-02-15 11:33:12 +01:00
<div class="wrmlmaau" ref="i">
<div class="body">
<span v-if="note.isHidden" style="opacity: 0.5">({{ $t('private') }})</span>
<span v-if="note.deletedAt" style="opacity: 0.5">({{ $t('deleted') }})</span>
<router-link class="reply" v-if="note.replyId" :to="`/notes/${note.replyId}`"><fa :icon="faReply"/></router-link>
<mfm v-if="note.text" :text="note.text" :author="note.user" :i="$store.state.i" :custom-emojis="note.emojis"/>
<router-link class="rp" v-if="note.renoteId" :to="`/notes/${note.renoteId}`">RN: ...</router-link>
</div>
<details v-if="note.files.length > 0">
<summary>({{ $t('withNFiles', { n: note.files.length }) }})</summary>
2020-02-15 11:33:12 +01:00
<x-media-list :media-list="note.files" :width="width"/>
</details>
<details v-if="note.poll">
<summary>{{ $t('poll') }}</summary>
<x-poll :note="note"/>
</details>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
import { faReply } from '@fortawesome/free-solid-svg-icons';
import i18n from '../i18n';
import XPoll from './poll.vue';
import XMediaList from './media-list.vue';
export default Vue.extend({
i18n,
components: {
XPoll,
XMediaList,
},
props: {
note: {
type: Object,
required: true
}
},
data() {
return {
2020-02-15 11:33:12 +01:00
width: 0,
faReply
};
2020-02-15 11:33:12 +01:00
},
mounted() {
2020-02-15 12:18:37 +01:00
// for Safari bug
2020-02-15 11:34:30 +01:00
this.width = this.$refs.i.getBoundingClientRect().width;
}
});
</script>
<style lang="scss" scoped>
.wrmlmaau {
overflow-wrap: break-word;
> .body {
> .reply {
margin-right: 6px;
color: var(--accent);
}
> .rp {
margin-left: 4px;
font-style: oblique;
color: var(--renote);
}
}
}
</style>