perf: remove useless styles and code in comments.svelte.ts and Badge.svelte

This commit is contained in:
Xylight committed 2025-09-22 18:26:16 -07:00
1 parent 1345e2cba8
commit a2213643cf
3 files changed
+10 -25

No files matched your search

@@ -121,9 +121,3 @@ export function insertCommentIntoTree(
tree.unshift(node)
}
}
export async function buildCommentsTreeAsync(comments: CommentView[]) {
const result = buildCommentsTree(comments)
return result
}
+10 -19
View File
@@ -1,23 +1,14 @@
<script lang="ts">
const badgeColor = {
red: 'bg-red-500 text-white ring-transparent',
green: 'bg-green-500 text-white dark:text-black ring-transparent',
yellow: 'bg-yellow-500 text-black ring-transparent',
gray: 'bg-gray-600 text-white ring-transparent',
blue: 'bg-blue-500 text-white ring-transparent',
purple: 'bg-purple-500 text-white ring-transparent',
'red-subtle': `bg-red-100 dark:bg-red-500/20 text-red-600 dark:text-red-400
ring-red-400 dark:ring-red-500/30`,
'green-subtle': `bg-green-100 dark:bg-green-500/20 text-green-700 dark:text-green-400
ring-green-400 dark:ring-green-500/30`,
'yellow-subtle': `bg-yellow-100 dark:bg-yellow-500/20 text-yellow-700 dark:text-yellow-400
ring-yellow-400 dark:ring-yellow-500/30`,
'gray-subtle': `bg-gray-100 dark:bg-gray-500/20 text-gray-700 dark:text-gray-300
ring-gray-400 dark:ring-gray-400/30`,
'blue-subtle': `bg-blue-100 dark:bg-blue-500/20 text-blue-700 dark:text-blue-300
ring-blue-400 dark:ring-blue-400/30`,
'purple-subtle': `bg-purple-100 dark:bg-purple-500/20 text-purple-700 dark:text-purple-400
ring-purple-400 dark:ring-purple-500/30`,
'red-subtle':
'bg-red-100 dark:bg-red-500/20 text-red-600 dark:text-red-400',
'green-subtle': `bg-green-100 dark:bg-green-500/20 text-green-700 dark:text-green-400`,
'yellow-subtle':
'bg-yellow-100 dark:bg-yellow-500/20 text-yellow-700 dark:text-yellow-400',
'gray-subtle':
'bg-gray-100 dark:bg-gray-500/20 text-gray-700 dark:text-gray-300',
'blue-subtle':
'bg-blue-100 dark:bg-blue-500/20 text-blue-700 dark:text-blue-300',
custom: '',
}
@@ -56,7 +47,7 @@
{...rest}
class={[
allowIconOnly && 'max-md:px-1.5 max-md:py-1.5',
'text-xs font-medium flex items-center gap-1 ring-1 ring-inset px-2 py-1',
'text-xs font-medium flex items-center gap-1 ring-1 ring-black/20 dark:ring-white/20 ring-inset px-2 py-1',
badgeRoundness[rounding],
badgeColor[color],
clazz,
View File
Whitespace-only changes.