refactor: switch headers to barrel

This commit is contained in:
James Xylight committed 2025-09-07 10:30:12 -07:00
1 parent bb30a86dc4
commit de26affacd
56 files changed
+96 -83

No files matched your search

@@ -1,7 +1,6 @@
<script lang="ts">
import { page } from '$app/state'
import { profile } from '$lib/auth.svelte.js'
import CommentActions from '$lib/components/lemmy/comment/CommentActions.svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte'
import { publishedToDate } from '$lib/components/util/date.js'
@@ -20,14 +19,14 @@
Minus,
Pencil,
Plus,
ShieldCheck,
Trash,
} from 'svelte-hero-icons'
import { expoOut } from 'svelte/easing'
import type { ClassValue } from 'svelte/elements'
import { slide } from 'svelte/transition'
import ShieldIcon from '../moderation/ShieldIcon.svelte'
import CommentForm from './CommentForm.svelte'
import type { CommentNodeI } from './comments.svelte'
import { CommentActions, CommentForm } from '.'
interface Props {
node: CommentNodeI
@@ -154,10 +153,22 @@
>
{#snippet extraBadges()}
{#if node.comment_view.creator_is_moderator}
<ShieldIcon filled width={14} class="text-green-500" />
<Icon
src={ShieldCheck}
size="14"
micro
class="text-green-500"
aria-label={$t('class.moderator')}
/>
{/if}
{#if node.comment_view.creator_is_admin}
<ShieldIcon filled width={14} class="text-red-500" />
<Icon
src={ShieldCheck}
size="16"
micro
class="text-red-500"
aria-label={$t('class.admin')}
/>
{/if}
{/snippet}
</UserLink>
@@ -1,6 +1,6 @@
<script lang="ts">
import { profile } from '$lib/auth.svelte.js'
import CommentVote from '$lib/components/lemmy/comment/CommentVote.svelte'
import type { CommentView } from '$lib/client/types'
import CommentModerationMenu from '$lib/components/lemmy/moderation/CommentModerationMenu.svelte'
import {
amMod,
@@ -10,7 +10,6 @@
import { t } from '$lib/i18n/translations'
import { deleteItem, save } from '$lib/lemmy/contentview.js'
import { settings } from '$lib/settings.svelte'
import type { CommentView } from '$lib/client/types'
import { Button, Menu, MenuButton } from 'mono-svelte'
import {
Bookmark,
@@ -23,6 +22,7 @@
Share,
Trash,
} from 'svelte-hero-icons'
import { CommentVote } from '.'
interface Props {
comment: CommentView
@@ -3,7 +3,7 @@
import Markdown from '$lib/components/markdown/Markdown.svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { t } from '$lib/i18n/translations'
import { getClient, site } from '$lib/client/lemmy.svelte'
import { client, site } from '$lib/client/lemmy.svelte'
import { errorMessage } from '$lib/lemmy/error'
import { placeholders } from '$lib/util.svelte.js'
import type { CommentResponse } from '$lib/client/types'
@@ -56,7 +56,7 @@
loading = true
try {
const response = await getClient().createComment({
const response = await client().createComment({
content: value,
post_id: postId,
parent_id: parentId,
@@ -1,5 +1,4 @@
<script lang="ts">
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import { publishedToDate } from '$lib/components/util/date.js'
import { t } from '$lib/i18n/translations'
import type { CommentView } from '$lib/client/types'
@@ -7,6 +6,7 @@
import { ArrowUturnUp, Icon } from 'svelte-hero-icons'
import type { ClassValue } from 'svelte/elements'
import { PostMeta } from '../post'
import { Comment } from '.'
interface Props {
comment: CommentView
@@ -1,9 +1,8 @@
<script lang="ts">
import { browser } from '$app/environment'
import { goto } from '$app/navigation'
import { page } from '$app/state'
import { t } from '$lib/i18n/translations'
import { getClient } from '$lib/client/lemmy.svelte'
import { client } from '$lib/client/lemmy.svelte'
import { errorMessage } from '$lib/lemmy/error'
import type { Post } from '$lib/client/types'
import { Button, toast } from 'mono-svelte'
@@ -34,7 +33,7 @@
try {
parent.loading = true
const newComments = await getClient(page.params.instance).getComments({
const newComments = await client().getComments({
max_depth: 5,
parent_id: parent.comment_view.comment.id,
type_: 'All',
@@ -0,0 +1,9 @@
export { default as Comment } from './Comment.svelte'
export { default as CommentActions } from './CommentActions.svelte'
export { default as CommentForm } from './CommentForm.svelte'
export { default as CommentItem } from './CommentItem.svelte'
export { default as CommentListVirtualizer } from './CommentListVirtualizer.svelte'
export { default as CommentTree } from './CommentTree.svelte'
export { default as CommentVote } from './CommentVote.svelte'
export * from './comments.svelte'