diff --git a/src/lib/components/lemmy/community/CommunityItem.svelte b/src/lib/components/lemmy/community/CommunityItem.svelte index be642f95..53c3368d 100644 --- a/src/lib/components/lemmy/community/CommunityItem.svelte +++ b/src/lib/components/lemmy/community/CommunityItem.svelte @@ -20,12 +20,14 @@ import { SvelteURL } from 'svelte/reactivity' import Subscribe from '../../../../routes/communities/Subscribe.svelte' import CommunityCard from './CommunityCard.svelte' + import type { Snippet } from 'svelte' interface Props { community: CommunityView view?: 'cozy' | 'compact' showCounts?: boolean resolveObject?: boolean + children?: Snippet } let { @@ -33,6 +35,7 @@ view = 'compact', showCounts = true, resolveObject, + children, }: Props = $props() @@ -52,104 +55,111 @@ : ''}" orientation={view == 'cozy' ? 'vertical' : 'horizontal'} > - {#if community.community.deleted} - - {/if} - {#if community.community.nsfw} - - {/if} - {#if community.banned_from_community} - - {/if} - {#if community.community.visibility == 'LocalOnly'} - - {/if} - - - {#snippet children({ subscribe, subscribing })} - {@const subscribed = - community.subscribed == 'Subscribed' || - community.subscribed == 'Pending'} - + + {#snippet children({ subscribe, subscribing })} + {@const subscribed = + community.subscribed == 'Subscribed' || + community.subscribed == 'Pending'} + - {/snippet} - + community.subscribed = newSubscribed + addSubscription( + community.community, + newSubscribed == 'Subscribed', + ) + } + }} + size="custom" + title={subscribed + ? $t('cards.community.subscribed') + : $t('cards.community.subscribe')} + color={subscribed ? 'secondary' : 'primary'} + rounding="xl" + class={[ + subscribed && 'text-slate-600 dark:text-zinc-400', + ' h-8.5 rounded-full', + view == 'compact' + ? 'aspect-square @md:px-2 @md:min-w-30 @md:aspect-auto' + : 'px-3', + ]} + icon={subscribed ? Check : Plus} + > + + {#if subscribed} + {$t('cards.community.subscribed')} + {:else} + {$t('cards.community.subscribe')} + {/if} + + + {/snippet} + + {:else} + {@render children?.()} + {/if} diff --git a/src/lib/components/markdown/MdTree.svelte b/src/lib/components/markdown/MdTree.svelte index a7938992..fc546376 100644 --- a/src/lib/components/markdown/MdTree.svelte +++ b/src/lib/components/markdown/MdTree.svelte @@ -35,7 +35,6 @@ if (header) { type = 'tablecell' - console.log(type) } @@ -97,7 +96,6 @@ {/each} {/if} - {console.log($state.snapshot(token))} {/if} {/each} diff --git a/src/lib/components/ui/sidebar/SidebarButton.svelte b/src/lib/components/ui/sidebar/SidebarButton.svelte index 56468597..587df1ca 100644 --- a/src/lib/components/ui/sidebar/SidebarButton.svelte +++ b/src/lib/components/ui/sidebar/SidebarButton.svelte @@ -32,8 +32,8 @@ rounding="xl" {...rest} {href} + weight="none" class={[ - 'font-normal block', 'hover:text-slate-900 hover:dark:text-zinc-50', selected ? 'text-primary-900 dark:text-primary-100' diff --git a/src/lib/i18n/translations.ts b/src/lib/i18n/translations.ts index 61f35d20..dacf4204 100644 --- a/src/lib/i18n/translations.ts +++ b/src/lib/i18n/translations.ts @@ -97,11 +97,6 @@ const config: Config = { key: '', loader: async () => (await import('./zh-Hant.json')).default, }, - { - locale: 'tok', - key: '', - loader: async () => (await import('./tok.json')).default, - }, ], fallbackLocale: 'en', } diff --git a/src/lib/lemmy/feeds/feed.svelte.ts b/src/lib/lemmy/feeds/feed.svelte.ts index 4a2e642c..18331c10 100644 --- a/src/lib/lemmy/feeds/feed.svelte.ts +++ b/src/lib/lemmy/feeds/feed.svelte.ts @@ -32,8 +32,9 @@ export class Feed { this.#lastParams && params && !recursiveEqual(params, this.#lastParams) - ) + ) { this.#data = undefined + } this.#lastParams = params if (this.#data == null) this.#data = await this.#fetch(params) @@ -56,7 +57,7 @@ export interface FeedTypes { { posts: PostView[] next_page?: string - params: GetPostss & { page_cursor: string } + params: GetPosts & { page_cursor: string } client: { itemHeights?: (number | null)[] lastSeen?: number diff --git a/src/lib/mono/button/Button.svelte b/src/lib/mono/button/Button.svelte index 42a3fa9a..b91d0b0e 100644 --- a/src/lib/mono/button/Button.svelte +++ b/src/lib/mono/button/Button.svelte @@ -52,6 +52,12 @@ } type ButtonRoundness = keyof typeof buttonRounding + const buttonWeight = { + md: 'font-medium', + none: '', + } + type ButtonWeight = keyof typeof buttonWeight + interface Props extends Omit { loading?: boolean @@ -70,6 +76,7 @@ suffix?: Snippet onclick?: HTMLButtonAttributes['onclick'] icon?: IconSource + weight?: ButtonWeight } export type { Props as ButtonProps } @@ -103,6 +110,7 @@ children, suffix, icon, + weight = 'md', ...rest }: Props = $props() @@ -120,6 +128,7 @@ buttonShadow[shadow], buttonColor[color], buttonAlignment[alignment], + buttonWeight[weight], (disabled || loading) && 'btn-disabled', alignment == 'center' ? 'origin-center' @@ -163,7 +172,6 @@ align-items: center; font-size: var(--text-sm); gap: calc(var(--spacing) * 1.5); - font-weight: var(--font-weight-medium); transition: 75ms linear; diff --git a/src/lib/mono/forms/select/Select.svelte b/src/lib/mono/forms/select/Select.svelte index bbcfb160..099d4cb5 100644 --- a/src/lib/mono/forms/select/Select.svelte +++ b/src/lib/mono/forms/select/Select.svelte @@ -43,11 +43,7 @@ } from 'svelte-hero-icons' import type { Attachment } from 'svelte/attachments' import type { ClassValue, HTMLSelectAttributes } from 'svelte/elements' - import { - buttonColor, - buttonShadow, - buttonSize, - } from '../../button/Button.svelte' + import { buttonSize } from '../../button/Button.svelte' import Menu from '../../popover/Menu.svelte' import MenuButton from '../../popover/MenuButton.svelte' import Label from '../Label.svelte' diff --git a/src/routes/inbox/+page.svelte b/src/routes/inbox/+page.svelte index 866396bd..34340614 100644 --- a/src/routes/inbox/+page.svelte +++ b/src/routes/inbox/+page.svelte @@ -47,7 +47,7 @@
{$t('routes.inbox.title')} -
+