diff --git a/packages/frontend/src/components/MkDriveFileThumbnail.vue b/packages/frontend/src/components/MkDriveFileThumbnail.vue index 3933421fc0..0440a474f8 100644 --- a/packages/frontend/src/components/MkDriveFileThumbnail.vue +++ b/packages/frontend/src/components/MkDriveFileThumbnail.vue @@ -29,14 +29,7 @@ SPDX-License-Identifier: AGPL-3.0-only :class="$style.thumbnail" :style="{ objectFit: fit }" /> - - - - - - - - + @@ -46,6 +39,7 @@ SPDX-License-Identifier: AGPL-3.0-only import { computed } from 'vue'; import * as Misskey from 'misskey-js'; import MkImgWithBlurhash from '@/components/MkImgWithBlurhash.vue'; +import { getFileType, getFileTypeIcon } from '@/utility/file-type.js'; import { prefer } from '@/preferences.js'; const props = defineProps<{ @@ -56,27 +50,8 @@ const props = defineProps<{ large?: boolean; }>(); -const is = computed(() => { - if (props.file.type.startsWith('image/')) return 'image'; - if (props.file.type.startsWith('video/')) return 'video'; - if (props.file.type === 'audio/midi') return 'midi'; - if (props.file.type.startsWith('audio/')) return 'audio'; - if (props.file.type.endsWith('/csv')) return 'csv'; - if (props.file.type.endsWith('/pdf')) return 'pdf'; - if (props.file.type.startsWith('text/')) return 'textfile'; - if ([ - 'application/zip', - 'application/x-cpio', - 'application/x-bzip', - 'application/x-bzip2', - 'application/java-archive', - 'application/x-rar-compressed', - 'application/x-tar', - 'application/gzip', - 'application/x-7z-compressed', - ].some(archiveType => archiveType === props.file.type)) return 'archive'; - return 'unknown'; -}); +const is = computed(() => getFileType(props.file.type)); +const fileIcon = computed(() => getFileTypeIcon(is.value)); const isThumbnailAvailable = computed(() => { return props.file.thumbnailUrl diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 17f93a4ec8..0def3f834d 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -72,22 +72,22 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ maxTextLength - textLength }}
- -
- - {{ i18n.ts._postForm.uploaderTip }} - - -
+