refactor: prefer barrel exports

This commit is contained in:
James Xylight committed 2025-09-07 09:50:01 -07:00
1 parent cbd27a38a0
commit 0281e6f56a
64 files changed
+181 -249

No files matched your search

@@ -3,25 +3,25 @@
import { profile } from '$lib/auth.svelte.js'
import ImageInputUpload from '$lib/components/form/ImageInputUpload.svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import SectionTitle from '$lib/components/ui/SectionTitle.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 { addSubscription } from '$lib/lemmy/user.js'
import {
Badge,
Button,
Label,
MenuButton,
Switch,
TextInput,
toast,
Option,
Select,
Material,
Menu
} from 'mono-svelte'
import Option from 'mono-svelte/forms/select/Option.svelte'
import Select from 'mono-svelte/forms/select/Select.svelte'
import Material from 'mono-svelte/materials/Material.svelte'
import Menu from 'mono-svelte/popover/Menu.svelte'
import { GlobeAlt, Icon, MapPin, Plus } from 'svelte-hero-icons'
import { Header } from '$lib/components/ui/layout'
interface Props {
/**
@@ -68,7 +68,7 @@
try {
const res = edit
? await getClient().editCommunity({
? await client().editCommunity({
title: formData.displayName,
description: formData.sidebar,
nsfw: formData.nsfw,
@@ -79,7 +79,7 @@
visibility: formData.visibility,
discussion_languages: formData.languages,
})
: await getClient().createCommunity({
: await client().createCommunity({
name: formData.name,
title: formData.displayName,
description: formData.sidebar,
@@ -146,7 +146,7 @@
class="flex flex-col gap-4 h-full w-full"
>
{#if formtitle}{@render formtitle()}{:else}
<Header>{$t('routes.createCommunity')}</Header>
<Header>{$t('form.post.community')}</Header>
{/if}
<TextInput
required
@@ -188,7 +188,7 @@
</Select>
<div class="space-y-1">
<SectionTitle>{$t('form.profile.languages.title')}</SectionTitle>
<Label>{$t('form.profile.languages.title')}</Label>
<Material rounding="xl" color="uniform" class="dark:bg-zinc-950">
{#if site.data}
<div class="flex gap-2 flex-wrap flex-row">
@@ -1,6 +1,5 @@
<script lang="ts">
import { profile } from '$lib/auth.svelte.js'
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte'
import LabelStat from '$lib/components/ui/LabelStat.svelte'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
@@ -23,6 +22,7 @@
Trash,
} from 'svelte-hero-icons'
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
import { CommunityCard } from '.'
interface Props {
community: CommunityView
@@ -0,0 +1,7 @@
export { default as CommunityCard } from './CommunityCard.svelte'
export { default as CommunityFlair } from './CommunityFlair.svelte'
export { default as CommunityForm } from './CommunityForm.svelte'
export { default as CommunityHeader } from './CommunityHeader.svelte'
export { default as CommunityItem } from './CommunityItem.svelte'
export { default as CommunityLink } from './CommunityLink.svelte'
export { default as CommunityTitle } from './CommunityTitle.svelte'