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