diff --git a/src/lib/components/input/Link.svelte b/src/lib/components/input/Link.svelte index 5a7cbc1d..c4e59e65 100644 --- a/src/lib/components/input/Link.svelte +++ b/src/lib/components/input/Link.svelte @@ -14,7 +14,6 @@ interface Props extends HTMLAnchorAttributes { href: string highlight?: boolean - nowrap?: boolean children?: import('svelte').Snippet class?: string icon?: import('svelte').Snippet @@ -23,48 +22,22 @@ let { href, highlight = false, - nowrap = false, children, class: clazz = '', icon, ...rest }: Props = $props() - - let richURL = $derived(children ? undefined : parseURL(href)) {@render icon?.()} - {#if children}{@render children()}{:else} - - {#if richURL} - - {richURL.protocol}// - - - {richURL.hostname} - - - {richURL.pathname} - - {:else} - {href} - {/if} - - {/if} + {@render children?.()} diff --git a/src/lib/components/lemmy/community/CommunityItem.svelte b/src/lib/components/lemmy/community/CommunityItem.svelte index 0607e271..ec31d005 100644 --- a/src/lib/components/lemmy/community/CommunityItem.svelte +++ b/src/lib/components/lemmy/community/CommunityItem.svelte @@ -1,14 +1,11 @@ @@ -51,194 +42,116 @@ {/snippet} -
-
- -
- {#if icon} - {@render icon()} - {:else if community.community.nsfw && settings.nsfwBlur} -
- {:else} - - {/if} -
-
-

- {community.community.title} -

- {#if community.community.deleted} - - {/if} - {#if community.community.nsfw} - - {/if} - {#if community.banned_from_community} - - {/if} - {#if community.community.visibility == 'LocalOnly'} - - {/if} -
-
- - {new URL(community.community.actor_id).hostname} - - - {#if !showCounts} - • - - {/if} - -
-
-
-
- {#if children || !actions} - {@render children?.()} - {:else} -
- - - {#snippet children({ subscribe, subscribing })} - {@const subscribed = - community.subscribed == 'Subscribed' || - community.subscribed == 'Pending'} - - {/snippet} - -
- {/if} -
- {#if showCounts} -
- {#if community.counts.posts} - - {/if} - {#if community.counts.subscribers} - - {/if} - {#if community.counts.comments} - - {/if} -
+ + {#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} + + diff --git a/src/lib/components/ui/layout/CommonItem.svelte b/src/lib/components/ui/layout/CommonItem.svelte index 1d10bade..702ea7c6 100644 --- a/src/lib/components/ui/layout/CommonItem.svelte +++ b/src/lib/components/ui/layout/CommonItem.svelte @@ -7,13 +7,28 @@ icon?: string title: string detail?: string + orientation: 'vertical' | 'horizontal' children?: Snippet } - let { href, icon, title, detail, children }: Props = $props() + let { + href, + icon, + title, + detail, + children, + orientation = 'horizontal', + }: Props = $props() -
+

- {@render children?.()} +
+ {@render children?.()} +

diff --git a/src/lib/components/ui/sidebar/Sidebar.svelte b/src/lib/components/ui/sidebar/Sidebar.svelte index 784fdddc..4d8c7866 100644 --- a/src/lib/components/ui/sidebar/Sidebar.svelte +++ b/src/lib/components/ui/sidebar/Sidebar.svelte @@ -28,6 +28,7 @@ import ProfileSelection from './ProfileSelection.svelte' import Logo from '../Logo.svelte' import { env } from '$env/dynamic/public' + import Link from '$lib/components/input/Link.svelte' interface Props { style?: string @@ -181,18 +182,12 @@
{#if env.PUBLIC_XYLIGHT_MODE?.toLowerCase() == 'true'} - + {$t('nav.menu.source')} - - + + {$t('nav.menu.donate')} - + {/if} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 62955cf6..eeb905e2 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -18,6 +18,8 @@ $effect(() => { if (data.filters.value.sort) settings.defaultSort.sort = data.filters.value.sort + if (data.filters.value.type_) + settings.defaultSort.feed = data.filters.value.type_ }) const FeedComponent = $derived( diff --git a/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte b/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte index f3024fec..02729f19 100644 --- a/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte +++ b/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte @@ -116,7 +116,12 @@ { - comments.unshift(comment.comment_view) + tree.unshift({ + children: [], + depth: 1, + expanded: true, + comment_view: comment.comment_view, + }) }} onfocus={() => (commenting = true)} tools={commenting}