cleanup: remove list mode

This commit is contained in:
James Xylight committed 2025-02-03 20:25:48 -08:00
1 parent 6ce5dc86fb
commit 87672a667c
7 files changed
+15 -46

No files matched your search

+5 -16
View File
@@ -3,15 +3,13 @@
import { isImage, isVideo } from '$lib/ui/image.js'
import { getInstance } from '$lib/lemmy.js'
import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
import { settings } from '$lib/settings.svelte.js'
import { settings, type View } from '$lib/settings.svelte.js'
import PostLink from '$lib/components/lemmy/post/link/PostLink.svelte'
import PostMeta, {
parseTags,
type Tag,
} from '$lib/components/lemmy/post/PostMeta.svelte'
import { Badge, Material, toast } from 'mono-svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte'
import ExpandableImage from '$lib/components/ui/ExpandableImage.svelte'
import {
bestImageURL,
mediaType,
@@ -19,12 +17,7 @@
} from '$lib/components/lemmy/post/helpers.js'
import Empty from '$lib/components/helper/Empty.svelte'
import { publishedToDate } from '$lib/components/util/date.js'
import {
ArrowUp,
ChatBubbleOvalLeft,
Icon,
VideoCamera,
} from 'svelte-hero-icons'
import { ArrowUp, ChatBubbleOvalLeft, Icon } from 'svelte-hero-icons'
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
import PostMediaCompact from '$lib/components/lemmy/post/media/PostMediaCompact.svelte'
import PostBody from './PostBody.svelte'
@@ -58,7 +51,7 @@
post: PostView
actions?: boolean
hideCommunity?: boolean
view?: any
view?: View
style?: string
class?: string
badges?: import('svelte').Snippet
@@ -105,7 +98,6 @@
group
{settings.leftAlign ? 'left-align' : ''}
{view == 'compact' ? 'py-3 list-type compact' : ''}
{view == 'list' ? 'py-5 list-type' : ''}
{view == 'cozy' ? 'py-5 flex flex-col gap-2' : ''}
{clazz ?? ''}"
id={post.post.id.toString()}
@@ -152,10 +144,7 @@
{/snippet}
</PostMeta>
{#key post.post.url}
<div
style="grid-area:embed;"
class={view == 'list' || view == 'compact' ? '' : 'contents'}
>
<div style="grid-area:embed;" class={view == 'compact' ? '' : 'contents'}>
{#if rule != 'hide'}
<PostMedia
post={post.post}
@@ -165,7 +154,7 @@
/>
{/if}
</div>
{#if view == 'list' || view == 'compact'}
{#if view == 'compact'}
<PostMediaCompact
post={post.post}
{type}
@@ -4,14 +4,14 @@
import { Button } from 'mono-svelte'
import { ChevronDown, Icon } from 'svelte-hero-icons'
const MAX_HEIGHT = 192
let element = $state<Element>()
function isOverflown(element: Element) {
if (!element) return false
return (
element.scrollHeight > element.clientHeight ||
element.scrollWidth > element.clientWidth
)
return element.scrollHeight > MAX_HEIGHT
}
interface Props {
@@ -34,7 +34,7 @@
let overflows = $derived(element ? isOverflown(element) : false)
let expanded = $state(true)
let expanded = $state(false)
$effect(() => {
expanded = !overflows
})
@@ -46,8 +46,7 @@
class="{!expanded
? ` overflow-hidden
bg-gradient-to-b text-transparent from-slate-600 via-slate-600
dark:from-zinc-400 dark:via-zinc-400 bg-clip-text z-0
${view == 'list' ? `max-h-24` : 'max-h-48'}`
dark:from-zinc-400 dark:via-zinc-400 bg-clip-text z-0 max-h-48`
: 'text-slate-600 dark:text-zinc-400 max-h-full'} text-base {clazz}"
class:pointer-events-none={!clickThrough}
bind:this={element}