2020-01-30 04:37:25 +09:00
|
|
|
<template>
|
2023-01-14 15:05:23 +09:00
|
|
|
<div :class="[$style.root, { [$style.collapsed]: collapsed }]">
|
|
|
|
<div :class="$style.body">
|
2022-07-20 22:24:26 +09:00
|
|
|
<span v-if="note.isHidden" style="opacity: 0.5">({{ i18n.ts.private }})</span>
|
|
|
|
<span v-if="note.deletedAt" style="opacity: 0.5">({{ i18n.ts.deleted }})</span>
|
2023-01-14 15:05:23 +09:00
|
|
|
<MkA v-if="note.replyId" :class="$style.reply" :to="`/notes/${note.replyId}`"><i class="ti ti-arrow-back-up"></i></MkA>
|
2023-01-26 15:48:12 +09:00
|
|
|
<Mfm v-if="note.text" v-once :text="note.text" :author="note.user" :i="$i" :emoji-urls="note.emojis"/>
|
2023-01-14 15:05:23 +09:00
|
|
|
<MkA v-if="note.renoteId" :class="$style.rp" :to="`/notes/${note.renoteId}`">RN: ...</MkA>
|
2020-01-30 04:37:25 +09:00
|
|
|
</div>
|
|
|
|
<details v-if="note.files.length > 0">
|
|
|
|
<summary>({{ $t('withNFiles', { n: note.files.length }) }})</summary>
|
2022-12-30 13:56:22 +09:00
|
|
|
<MkMediaList :media-list="note.files"/>
|
2020-01-30 04:37:25 +09:00
|
|
|
</details>
|
|
|
|
<details v-if="note.poll">
|
2022-07-20 22:24:26 +09:00
|
|
|
<summary>{{ i18n.ts.poll }}</summary>
|
2022-12-30 13:56:22 +09:00
|
|
|
<MkPoll :note="note"/>
|
2020-01-30 04:37:25 +09:00
|
|
|
</details>
|
2023-01-14 15:05:23 +09:00
|
|
|
<button v-if="collapsed" :class="$style.fade" class="_button" @click="collapsed = false">
|
|
|
|
<span :class="$style.fadeLabel">{{ i18n.ts.showMore }}</span>
|
2021-11-19 18:56:30 +09:00
|
|
|
</button>
|
2020-01-30 04:37:25 +09:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-01-14 12:02:10 +09:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
2022-07-20 22:24:26 +09:00
|
|
|
import * as misskey from 'misskey-js';
|
2022-12-30 13:56:22 +09:00
|
|
|
import MkMediaList from '@/components/MkMediaList.vue';
|
|
|
|
import MkPoll from '@/components/MkPoll.vue';
|
2022-07-20 22:24:26 +09:00
|
|
|
import { i18n } from '@/i18n';
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2022-01-14 12:02:10 +09:00
|
|
|
const props = defineProps<{
|
|
|
|
note: misskey.entities.Note;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const collapsed = $ref(
|
|
|
|
props.note.cw == null && props.note.text != null && (
|
|
|
|
(props.note.text.split('\n').length > 9) ||
|
|
|
|
(props.note.text.length > 500)
|
|
|
|
));
|
2020-01-30 04:37:25 +09:00
|
|
|
</script>
|
|
|
|
|
2023-01-14 15:05:23 +09:00
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
2020-01-30 04:37:25 +09:00
|
|
|
overflow-wrap: break-word;
|
|
|
|
|
2021-11-19 18:56:30 +09:00
|
|
|
&.collapsed {
|
|
|
|
position: relative;
|
|
|
|
max-height: 9em;
|
2023-01-02 12:15:26 +09:00
|
|
|
overflow: clip;
|
2021-11-19 18:56:30 +09:00
|
|
|
|
|
|
|
> .fade {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 64px;
|
|
|
|
background: linear-gradient(0deg, var(--panel), var(--X15));
|
|
|
|
|
2023-01-14 15:05:23 +09:00
|
|
|
> .fadeLabel {
|
2021-11-19 18:56:30 +09:00
|
|
|
display: inline-block;
|
|
|
|
background: var(--panel);
|
|
|
|
padding: 6px 10px;
|
|
|
|
font-size: 0.8em;
|
|
|
|
border-radius: 999px;
|
|
|
|
box-shadow: 0 2px 6px rgb(0 0 0 / 20%);
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
2023-01-14 15:05:23 +09:00
|
|
|
> .fadeLabel {
|
2021-11-19 18:56:30 +09:00
|
|
|
background: var(--panelHighlight);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
2023-01-14 15:05:23 +09:00
|
|
|
|
|
|
|
.body {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.reply {
|
|
|
|
margin-right: 6px;
|
|
|
|
color: var(--accent);
|
|
|
|
}
|
|
|
|
|
|
|
|
.rp {
|
|
|
|
margin-left: 4px;
|
|
|
|
font-style: oblique;
|
|
|
|
color: var(--renote);
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
</style>
|