2023-07-27 14:31:52 +09:00
|
|
|
<!--
|
2024-02-13 15:59:27 +00:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 14:31:52 +09:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
-->
|
|
|
|
|
|
2019-04-29 09:11:57 +09:00
|
|
|
<template>
|
2024-03-18 18:21:27 +09:00
|
|
|
<div :class="$style.root">
|
|
|
|
|
<MkMediaList v-if="image" :mediaList="[image]" :class="$style.mediaList"/>
|
2019-04-29 09:11:57 +09:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2022-05-19 13:41:47 +02:00
|
|
|
<script lang="ts" setup>
|
2024-01-30 19:53:53 +09:00
|
|
|
import { onMounted, ref } from 'vue';
|
2023-05-14 10:50:21 +09:00
|
|
|
import * as Misskey from 'misskey-js';
|
2024-03-18 18:21:27 +09:00
|
|
|
import MkMediaList from '@/components/MkMediaList.vue';
|
2019-04-29 09:11:57 +09:00
|
|
|
|
2022-05-19 13:41:47 +02:00
|
|
|
const props = defineProps<{
|
2024-01-30 19:53:53 +09:00
|
|
|
block: Misskey.entities.PageBlock,
|
2023-05-14 10:50:21 +09:00
|
|
|
page: Misskey.entities.Page,
|
2022-05-19 13:41:47 +02:00
|
|
|
}>();
|
2021-01-30 10:59:05 +09:00
|
|
|
|
2024-01-30 19:53:53 +09:00
|
|
|
const image = ref<Misskey.entities.DriveFile | null>(null);
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
image.value = props.page.attachedFiles.find(x => x.id === props.block.fileId) ?? null;
|
|
|
|
|
});
|
2019-04-29 09:11:57 +09:00
|
|
|
</script>
|
2024-03-18 18:21:27 +09:00
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
|
.root {
|
|
|
|
|
border: 1px solid var(--divider);
|
|
|
|
|
border-radius: var(--radius);
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
.mediaList {
|
|
|
|
|
// MkMediaList 内の上部マージン 4px
|
|
|
|
|
margin-top: -4px;
|
|
|
|
|
height: calc(100% + 4px);
|
|
|
|
|
}
|
|
|
|
|
</style>
|