Add more to subnotecontent if detailed

This commit is contained in:
Freeplay 2023-02-17 11:31:48 -05:00
parent da648e1517
commit 650a62953d
2 changed files with 9 additions and 4 deletions

View File

@ -13,7 +13,7 @@
<XCwButton v-model="showContent" :note="note"/>
</p>
<div v-show="note.cw == null || showContent" class="content" @click="router.push(notePage(note))">
<MkSubNoteContent class="text" :note="note"/>
<MkSubNoteContent class="text" :note="note" :detailed="true"/>
</div>
</div>
<MkNoteFooter :note="note" :conversation="conversation"></MkNoteFooter>

View File

@ -5,7 +5,12 @@
<MkA v-if="note.replyId" class="reply" :to="`/notes/${note.replyId}`"><i class="ph-arrow-bend-up-left-bold ph-lg"></i></MkA>
<Mfm v-if="note.text" :text="note.text" :author="note.user" :i="$i" :custom-emojis="note.emojis"/>
<MkA v-if="note.renoteId" class="rp" :to="`/notes/${note.renoteId}`">{{ i18n.ts.quoteAttached }}: ...</MkA>
<MkUrlPreview v-for="url in urls" :key="url" :url="url" :compact="true" :detail="false" class="url-preview"/>
<template v-if="detailed">
<!-- <div v-if="note.renoteId" class="renote">
<XNoteSimple :note="note.renote"/>
</div> -->
<MkUrlPreview v-for="url in urls" :key="url" :url="url" :compact="true" :detail="false" class="url-preview"/>
</template>
</div>
<div v-if="note.files.length > 0">
<XMediaList :media-list="note.files"/>
@ -27,6 +32,7 @@
import { } from 'vue';
import * as misskey from 'calckey-js';
import * as mfm from 'mfm-js';
import XNoteSimple from '@/components/MkNoteSimple.vue';
import XMediaList from '@/components/MkMediaList.vue';
import XPoll from '@/components/MkPoll.vue';
import MkUrlPreview from '@/components/MkUrlPreview.vue';
@ -35,9 +41,9 @@ import { i18n } from '@/i18n';
const props = defineProps<{
note: misskey.entities.Note;
detailed?: boolean;
}>();
const isLong = (
props.note.cw == null && props.note.text != null && (
(props.note.text.split('\n').length > 9) ||
@ -46,7 +52,6 @@ const isLong = (
);
const collapsed = $ref(props.note.cw == null && isLong);
const urls = props.note.text ? extractUrlFromMfm(mfm.parse(props.note.text)) : null;
console.log(props.note.text);
</script>