paricafe/packages/frontend/src/components/page/page.image.vue
かっこかり b668d161a9
refactor(frontend): prefix css variables (UI) (#14739)
* refactor(frontend): prefix css variables

* `MI_UI` -> `MI`

* fix

* `stickyBottom`

* stickyTop
2024-10-10 16:12:16 +09:00

40 lines
925 B
Vue

<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<div :class="$style.root">
<MkMediaList v-if="image" :mediaList="[image]" :class="$style.mediaList"/>
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import * as Misskey from 'misskey-js';
import MkMediaList from '@/components/MkMediaList.vue';
const props = defineProps<{
block: Misskey.entities.PageBlock,
page: Misskey.entities.Page,
}>();
const image = ref<Misskey.entities.DriveFile | null>(null);
onMounted(() => {
image.value = props.page.attachedFiles.find(x => x.id === props.block.fileId) ?? null;
});
</script>
<style lang="scss" module>
.root {
border: 1px solid var(--MI_THEME-divider);
border-radius: var(--MI-radius);
overflow: hidden;
}
.mediaList {
// MkMediaList 内の上部マージン 4px
margin-top: -4px;
height: calc(100% + 4px);
}
</style>