migrate: convert most components to svelte 5
This commit is contained in:
1 parent
d670f39f0a
commit
10ef4123da
225 files changed
+5441
-3341
No files matched your search
@@ -5,25 +5,37 @@
|
||||
import type { Community } from 'lemmy-js-client'
|
||||
import { ExclamationTriangle, Icon } from 'svelte-hero-icons'
|
||||
|
||||
export let community: Community
|
||||
|
||||
export let avatar: boolean = false
|
||||
export let name: boolean = true
|
||||
export let avatarSize: number = 24
|
||||
export let showInstance: boolean = $userSettings.showInstances.community
|
||||
export let displayName: boolean = true
|
||||
|
||||
export let badges = {
|
||||
nsfw: false,
|
||||
interface Props {
|
||||
community: Community
|
||||
avatar?: boolean
|
||||
name?: boolean
|
||||
avatarSize?: number
|
||||
showInstance?: boolean
|
||||
displayName?: boolean
|
||||
badges?: any
|
||||
class?: string
|
||||
instanceClass?: string
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
let clazz: string = ''
|
||||
export let instanceClass: string = ''
|
||||
export { clazz as class }
|
||||
let {
|
||||
community,
|
||||
avatar = false,
|
||||
name = true,
|
||||
avatarSize = 24,
|
||||
showInstance = $userSettings.showInstances.community,
|
||||
displayName = true,
|
||||
badges = {
|
||||
nsfw: false,
|
||||
},
|
||||
class: clazz = '',
|
||||
instanceClass = '',
|
||||
...rest
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
<a
|
||||
{...$$restProps}
|
||||
{...rest}
|
||||
class="items-center flex flex-row gap-2 hover:underline max-w-full min-w-0 {clazz}"
|
||||
href="/c/{community.name}@{new URL(community.actor_id).hostname}"
|
||||
data-sveltekit-preload-data="tap"
|
||||
|
||||
Reference in new issue
Block a user