cleanup: delete unused files
This commit is contained in:
18 files changed
+64
-309
No files matched your search
@@ -82,7 +82,7 @@
|
||||
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
import { userLink } from '$lib/lemmy/generic'
|
||||
import { userLink } from '$lib/util.svelte'
|
||||
import { addSubscription } from '$lib/lemmy/user.js'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import { fullCommunityName } from '$lib/util.svelte.js'
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { formatRelativeDate } from '$lib/components/util/RelativeDate.svelte'
|
||||
import { publishedToDate } from '$lib/components/util/date'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { userLink } from '$lib/lemmy/generic'
|
||||
import { userLink } from '$lib/util.svelte'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import { fullCommunityName } from '$lib/util.svelte'
|
||||
import type {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
import { addSubscription } from '$lib/lemmy/user.js'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import { fullCommunityName, isSubscribed } from '$lib/util.svelte.js'
|
||||
import { fullCommunityName } from '$lib/util.svelte.js'
|
||||
import type { CommunityView } from '$lib/client/types'
|
||||
import { Button, modal } from 'mono-svelte'
|
||||
import type { Snippet } from 'svelte'
|
||||
@@ -158,7 +158,9 @@
|
||||
</Button>
|
||||
<Subscribe {community}>
|
||||
{#snippet children({ subscribe, subscribing })}
|
||||
{@const subscribed = isSubscribed(community.subscribed)}
|
||||
{@const subscribed =
|
||||
community.subscribed == 'Subscribed' ||
|
||||
community.subscribed == 'Pending'}
|
||||
<Button
|
||||
disabled={subscribing || !profile.current?.jwt}
|
||||
loading={subscribing}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import { communityLink } from '$lib/lemmy/generic'
|
||||
import { communityLink } from '$lib/util.svelte'
|
||||
import { settings } from '$lib/settings.svelte.js'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import type { Community } from '$lib/client/types'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { userLink } from '$lib/lemmy/generic'
|
||||
import { userLink } from '$lib/util.svelte'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import type { PersonView, SiteView, Tagline } from '$lib/client/types'
|
||||
import { Badge } from 'mono-svelte'
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { preventDefault } from 'svelte/legacy'
|
||||
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import type { Person } from '$lib/client/types'
|
||||
import { Button, Modal, toast } from 'mono-svelte'
|
||||
import { Icon, PaperAirplane } from 'svelte-hero-icons'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
|
||||
interface Props {
|
||||
open?: boolean
|
||||
user: Person
|
||||
}
|
||||
|
||||
let { open = $bindable(false), user }: Props = $props()
|
||||
|
||||
let message = $state('')
|
||||
|
||||
let loading = $state(false)
|
||||
|
||||
async function sendMessage() {
|
||||
if (!profile.current?.jwt || message == '') return
|
||||
|
||||
loading = true
|
||||
|
||||
try {
|
||||
await getClient().createPrivateMessage({
|
||||
content: message,
|
||||
recipient_id: user.id,
|
||||
})
|
||||
|
||||
toast({
|
||||
content: $t('toast.sentMessage'),
|
||||
type: 'success',
|
||||
})
|
||||
|
||||
open = false
|
||||
} catch (err) {
|
||||
toast({
|
||||
content: errorMessage(err as string),
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
|
||||
loading = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<Modal bind:open>
|
||||
{#snippet customTitle()}
|
||||
<h1 class="text-2xl font-bold">Message</h1>
|
||||
{/snippet}
|
||||
<form onsubmit={preventDefault(sendMessage)} class="flex flex-col gap-4">
|
||||
<p class="inline-flex flex-row gap-2 items-center">
|
||||
<Icon src={PaperAirplane} size="16" mini />
|
||||
<UserLink avatar {user} />
|
||||
</p>
|
||||
<MarkdownEditor
|
||||
bind:value={message}
|
||||
label={$t('content.message')}
|
||||
rows={4}
|
||||
/>
|
||||
<Button color="primary" size="lg" submit {loading} disabled={loading}>
|
||||
{$t('common.send')}
|
||||
</Button>
|
||||
</form>
|
||||
</Modal>
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import LabelStat from '$lib/components/ui/LabelStat.svelte'
|
||||
import { userLink } from '$lib/lemmy/generic'
|
||||
import { userLink } from '$lib/util.svelte'
|
||||
import type { PersonView } from '$lib/client/types'
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -21,16 +21,16 @@
|
||||
</script>
|
||||
|
||||
{#if content != '-1'}
|
||||
<div class="flex flex-col {clazz}">
|
||||
<span class="text-slate-600 dark:text-zinc-400 text-xs {labelClass}">
|
||||
<dl class={['flex flex-col', clazz]}>
|
||||
<dt class={['text-slate-600 dark:text-zinc-400 text-xs', labelClass]}>
|
||||
{label}
|
||||
</span>
|
||||
<span class="text-base {contentClass}">
|
||||
</dt>
|
||||
<dd class={['text-base', contentClass]}>
|
||||
{#if formatted}
|
||||
<FormattedNumber number={Number(content)} />
|
||||
{:else}
|
||||
{content}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
{/if}
|
||||
@@ -4,7 +4,7 @@
|
||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { communityLink } from '$lib/lemmy/generic'
|
||||
import { communityLink } from '$lib/util.svelte'
|
||||
import { settings } from '$lib/settings.svelte.js'
|
||||
import { theme } from '$lib/ui/theme/theme.svelte'
|
||||
import { Badge, Option, Select } from 'mono-svelte'
|
||||
|
||||
Reference in new issue
Block a user