prep: replace $$props.class with props

This commit is contained in:
Xylight committed 2024-10-23 19:55:20 -07:00
1 parent 3ca72662ca
commit 0718c8e0c6
69 files changed
+383 -214

No files matched your search

+6 -2
View File
@@ -74,6 +74,10 @@
goto(postLink(post.post))
}
}
export let style: string = ''
let clazz: string = ''
export { clazz as class }
</script>
<!--
@@ -91,7 +95,7 @@
{view == 'compact' ? 'py-3 list-type compact' : ''}
{view == 'list' ? 'py-5 list-type' : ''}
{view == 'cozy' ? 'py-5 flex flex-col gap-2' : ''}
{$$props.class ?? ''}"
{clazz ?? ''}"
id={post.post.id.toString()}
on:click={(e) => {
onClick(e)
@@ -101,7 +105,7 @@
if (e.key == 'Enter') onClick(e)
}}
tabindex="0"
style={$$props.style ?? ''}
{style}
>
<PostMeta
community={post.community}
@@ -82,6 +82,8 @@
$: buttonHeight = view == 'compact' ? 'h-7' : 'h-8'
$: buttonSquare = view == 'compact' ? 'w-7 h-7' : 'w-8 h-8'
export let style: string = ''
</script>
{#if editing}
@@ -119,7 +121,7 @@
<footer
class="flex flex-row gap-2 items-center flex-shrink-0 {buttonHeight}"
class:flex-row-reverse={$userSettings.posts.reverseActions}
style={$$props.style ?? ''}
{style}
>
<PostVote
post={post.post}
@@ -27,18 +27,21 @@
}
$: overflows = isOverflown(element, body)
export let style: string = ''
let clazz: string = ''
export { clazz as class }
</script>
<svelte:element
this={htmlElement}
style={$$props.style ?? ''}
{style}
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'}`
: 'text-slate-600 dark:text-zinc-400 max-h-full'} text-base {$$props.class ??
''}"
: 'text-slate-600 dark:text-zinc-400 max-h-full'} text-base {clazz}"
class:pointer-events-none={!clickThrough}
bind:this={element}
>
@@ -98,6 +98,9 @@
export let tags: Tag[] = []
let popoverOpen = false
export let style: string = ''
export let titleClass: string = ''
</script>
<!--
@@ -109,7 +112,7 @@
? 'grid-rows-2'
: 'grid-rows-1'} text-xs min-w-0 max-w-full"
class:compact={view == 'compact'}
style={$$props.style ?? ''}
{style}
>
{#if showCommunity && community && subscribed && showCommunity}
<Popover bind:open={popoverOpen} manual>
@@ -280,7 +283,7 @@
hover:text-primary-900 hover:dark:text-primary-100 transition-colors max-[480px]:!mt-0
{$userSettings.font == 'satoshi/nunito'
? 'font-display font-semibold'
: 'font-medium'} {$$props.titleClass ?? ''}"
: 'font-medium'} {titleClass}"
class:text-slate-600={$userSettings.markReadPosts && read}
class:dark:text-zinc-400={$userSettings.markReadPosts && read}
class:text-base={view == 'compact'}
@@ -93,6 +93,9 @@
$: data = typeData(type)
$: embedUrl = urlToEmbed(url)
let clazz: string = ''
export { clazz as class }
</script>
<!--
@@ -102,7 +105,7 @@
{#if opened}
{#if type == 'video'}
<!-- svelte-ignore a11y-media-has-caption -->
<video {autoplay} controls class="rounded-xl aspect-video {$$props.class}">
<video {autoplay} controls class="rounded-xl aspect-video {clazz}">
<source src={url} />
</video>
{:else}
@@ -112,7 +115,7 @@
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen
class="aspect-video rounded-xl dark:bg-zinc-900 {$$props.class ?? ''}"
class="aspect-video rounded-xl dark:bg-zinc-900 {clazz ?? ''}"
/>
{/if}
{:else}
@@ -27,16 +27,17 @@
view == 'compact' ? 'w-22 h-22 sm:w-28' : 'w-24 h-24 sm:w-32'
$: size = thumbnailSize(view)
export let style: string = ''
let clazz: string = ''
export { clazz as class }
</script>
<!--
@component
Thumbnails for compact and list view posts.
-->
<div
class="{size} relative group/media {$$props.class ?? ''}"
style={$$props.style ?? ''}
>
<div class="{size} relative group/media {clazz ?? ''}" {style}>
{#if post.alt_text}
<Popover
openOnHover