summaryrefslogtreecommitdiff
path: root/src/client/app/desktop/views/pages/deck/deck.note-column.vue
blob: 43db32c854cb76c3e8911c1fe9d6987209fccc47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<template>
<x-column>
	<span slot="header">
		<fa :icon="['far', 'comment-alt']"/><span>{{ title }}</span>
	</span>

	<div class="rvtscbadixhhbsczoorqoaygovdeecsx" v-if="note">
		<div class="is-remote" v-if="note.user.host != null">
			<details>
				<summary><fa icon="exclamation-triangle"/> {{ $t('@.is-remote-post') }}</summary>
				<a :href="note.url || note.uri" target="_blank">{{ $t('@.view-on-remote') }}</a>
			</details>
		</div>
		<x-note :note="note" :detail="true" :mini="true"/>
	</div>
</x-column>
</template>

<script lang="ts">
import Vue from 'vue';
import i18n from '../../../../i18n';
import XColumn from './deck.column.vue';
import XNotes from './deck.notes.vue';
import XNote from '../../components/note.vue';

export default Vue.extend({
	i18n: i18n(),
	components: {
		XColumn,
		XNotes,
		XNote
	},

	props: {
		noteId: {
			type: String,
			required: true
		}
	},

	data() {
		return {
			note: null,
			fetching: true
		};
	},

	computed: {
		title(): string {
			return this.note ? Vue.filter('userName')(this.note.user) : '';
		}
	},

	created() {
		this.$root.api('notes/show', { noteId: this.noteId }).then(note => {
			this.note = note;
			this.fetching = false;
		});
	}
});
</script>

<style lang="stylus" scoped>
.rvtscbadixhhbsczoorqoaygovdeecsx
	> .is-remote
		padding 8px 16px
		font-size 12px

		&.is-remote
			color var(--remoteInfoFg)
			background var(--remoteInfoBg)

		> a
			font-weight bold

</style>