From 51b6a012a55eba9c0e902f6034cb1ded27aa9299 Mon Sep 17 00:00:00 2001 From: syuilo <Syuilotan@yahoo.co.jp> Date: Tue, 10 Oct 2023 19:49:25 +0900 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E3=83=A6=E3=83=BC=E3=82=B6?= =?UTF-8?q?=E3=83=BC=E3=83=97=E3=83=AD=E3=83=95=E3=82=A3=E3=83=BC=E3=83=AB?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=A7=E3=82=BB=E3=83=B3=E3=82=B7?= =?UTF-8?q?=E3=83=86=E3=82=A3=E3=83=96=E3=81=AA=E3=83=A1=E3=83=87=E3=82=A3?= =?UTF-8?q?=E3=82=A2=E3=81=8C=E9=9A=A0=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/pages/user/index.files.vue | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/packages/frontend/src/pages/user/index.files.vue b/packages/frontend/src/pages/user/index.files.vue index 205da5071d..43d6d91fc9 100644 --- a/packages/frontend/src/pages/user/index.files.vue +++ b/packages/frontend/src/pages/user/index.files.vue @@ -10,15 +10,18 @@ SPDX-License-Identifier: AGPL-3.0-only <div :class="$style.root"> <MkLoading v-if="fetching"/> <div v-if="!fetching && files.length > 0" :class="$style.stream"> - <MkA - v-for="file in files" - :key="file.note.id + file.file.id" - :class="$style.img" - :to="notePage(file.note)" - > - <!-- TODO: 画像以外のファイルに対応 --> - <ImgWithBlurhash :hash="file.file.blurhash" :src="thumbnail(file.file)" :title="file.file.name"/> - </MkA> + <template v-for="file in files" :key="file.note.id + file.file.id"> + <div v-if="file.file.isSensitive && !showingFiles.includes(file.file.id)" :class="$style.sensitive" @click="showingFiles.push(file.file.id)"> + <div> + <div><i class="ti ti-eye-exclamation"></i> {{ i18n.ts.sensitive }}</div> + <div>{{ i18n.ts.clickToShow }}</div> + </div> + </div> + <MkA v-else :class="$style.img" :to="notePage(file.note)"> + <!-- TODO: 画像以外のファイルに対応 --> + <ImgWithBlurhash :hash="file.file.blurhash" :src="thumbnail(file.file)" :title="file.file.name"/> + </MkA> + </template> </div> <p v-if="!fetching && files.length == 0" :class="$style.empty">{{ i18n.ts.nothing }}</p> </div> @@ -45,6 +48,7 @@ let files = $ref<{ note: Misskey.entities.Note; file: Misskey.entities.DriveFile; }[]>([]); +let showingFiles = $ref<string[]>([]); function thumbnail(image: Misskey.entities.DriveFile): string { return defaultStore.state.disableShowingAnimatedImages @@ -94,4 +98,9 @@ onMounted(() => { padding: 16px; text-align: center; } + +.sensitive { + display: grid; + place-items: center; +} </style>