feat: add support for piefed new types
This commit is contained in:
1 parent
46e40abeee
commit
1a948281a8
6 files changed
+3816
-4349
No files matched your search
@@ -50,7 +50,21 @@
|
||||
onhide,
|
||||
}: Props = $props()
|
||||
|
||||
let tags = $derived(parseTags(post.post.name))
|
||||
let tags = $derived.by<{ title?: string; tags: Tag[] }>(() => {
|
||||
const parsed = parseTags(post.post.name)
|
||||
|
||||
return {
|
||||
title: parsed.title,
|
||||
tags: [
|
||||
...parsed.tags,
|
||||
...(post.flair_list?.map((i) => ({
|
||||
content: i.flair_title,
|
||||
color: i.background_color,
|
||||
icon: null,
|
||||
})) ?? []),
|
||||
],
|
||||
}
|
||||
})
|
||||
let type = $derived(mediaType(post.post.url))
|
||||
let rule = $derived(getTagRule(tags.tags))
|
||||
let hideTitle = $derived(
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
export interface Tag {
|
||||
content: string
|
||||
color?: string
|
||||
icon?: IconSource
|
||||
icon?: IconSource | null
|
||||
}
|
||||
|
||||
export const textToTag: Map<string, Tag> = new Map<string, Tag>([
|
||||
@@ -323,7 +323,7 @@
|
||||
{#snippet icon()}
|
||||
{#if tag.icon}
|
||||
<Icon src={tag.icon} micro size="14" />
|
||||
{:else}
|
||||
{:else if tag !== null}
|
||||
<Icon src={Tag} micro size="14" />
|
||||
{/if}
|
||||
{/snippet}
|
||||
|
||||
Reference in new issue
Block a user