Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

サムネイル画像の表示を修正 #4504

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
:channel-id="channelId"
:file-id="meta.id"
:is-large="showLargeImage"
:class="$style.imageItem"
/>
</div>
<message-file-list-video
Expand Down Expand Up @@ -59,13 +58,7 @@ const showLargeImage = computed(() => fileMetaDataState.images.length === 1)
.imageContainer {
display: flex;
flex-flow: row wrap;
}
.imageItem {
flex-shrink: 0;
margin-bottom: 16px;
&:not(:last-child) {
margin-right: 16px;
}
gap: 16px;
}
.item {
flex-shrink: 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
<template>
<div>
<template v-if="canShow">
<router-link v-if="isLarge" :to="fileLink" :class="$style.largeContainer">
<!--
<template v-if="canShow">
<router-link v-if="isLarge" :to="fileLink" :class="$style.largeContainer">
<!--

Check warning on line 4 in src/components/Main/MainView/MessageElement/MessageFileListImage.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageElement/MessageFileListImage.vue#L2-L4

Added lines #L2 - L4 were not covered by tests
height, widthはlayout shift対策
https://www.mizdra.net/entry/2020/05/31/192613
-->
<img
draggable="false"
:alt="name"
:src="fileThumbnailPath"
:height="fileThumbnailSize.height"
:width="fileThumbnailSize.width"
/>
<play-icon v-if="isAnimatedImage" :class="$style.playIcon" />
</router-link>
<router-link v-else :to="fileLink" :class="$style.container">
<!--
<img
draggable="false"
:alt="name"
:src="fileThumbnailPath"
:height="fileThumbnailSize.height"
:width="fileThumbnailSize.width"
/>
<play-icon v-if="isAnimatedImage" :class="$style.playIcon" />
</router-link>
<router-link v-else :to="fileLink" :class="$style.container">
<!--

Check warning on line 18 in src/components/Main/MainView/MessageElement/MessageFileListImage.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageElement/MessageFileListImage.vue#L8-L18

Added lines #L8 - L18 were not covered by tests
CSSで固定値指定なのでheight, widthはつけない
-->
<img draggable="false" :alt="name" :src="fileThumbnailPath" />
<play-icon v-if="isAnimatedImage" :class="$style.playIcon" />
</router-link>
</template>
<div v-else :class="$style.container">表示できない画像です</div>
</div>
<img draggable="false" :alt="name" :src="fileThumbnailPath" />
<play-icon v-if="isAnimatedImage" :class="$style.playIcon" />
</router-link>
</template>
<div v-else :class="$style.container">表示できない画像です</div>

Check warning on line 25 in src/components/Main/MainView/MessageElement/MessageFileListImage.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageElement/MessageFileListImage.vue#L21-L25

Added lines #L21 - L25 were not covered by tests
</template>

<script lang="ts" setup>
Expand Down Expand Up @@ -56,6 +54,7 @@

<style lang="scss" module>
.container {
flex-shrink: 0;
position: relative;
width: 240px;
max-width: 100%;
Expand All @@ -75,6 +74,7 @@
}
}
.largeContainer {
flex-shrink: 0;
position: relative;
display: flex;
border-radius: 6px;
Expand Down
Loading