diff --git a/components/pages/posts/post/PostComponent.vue b/components/pages/posts/post/PostComponent.vue index 0338471b..ca5fa933 100644 --- a/components/pages/posts/post/PostComponent.vue +++ b/components/pages/posts/post/PostComponent.vue @@ -29,6 +29,17 @@ const { isPremium } = useUserData() const areTagsOpen = ref(false) + const isCollapsed = ref(false) + + function toggleCollapsedState() { + isCollapsed.value = !isCollapsed.value + + if (!isCollapsed.value) { + return + } + + areTagsOpen.value = false + } const mediaFile = computed(() => { const stripFragment = (url?: string | null) => url?.split('#')[0] ?? null @@ -96,19 +107,42 @@ const tagTypesWithTags = computed(() => { return Object.keys(props.post.tags).filter((tagType) => props.post.tags[tagType].length > 0) }) + + const collapsedSummary = computed(() => { + const mediaLabel = props.post.media_type === 'animated' ? 'animation' : props.post.media_type + + return `${mediaLabel} #${props.post.id} hidden` + })