From 8644f3fff280fd5197c051699b67ffb61dfc4c3f Mon Sep 17 00:00:00 2001 From: James Xylight Date: Sun, 2 Feb 2025 17:56:41 -0800 Subject: [PATCH] cleanup: remove post link sources --- .../lemmy/post/link/PostLink.svelte | 86 +++++-------------- .../lemmy/post/link/PostLinkSources.svelte | 78 ----------------- 2 files changed, 23 insertions(+), 141 deletions(-) delete mode 100644 src/lib/components/lemmy/post/link/PostLinkSources.svelte diff --git a/src/lib/components/lemmy/post/link/PostLink.svelte b/src/lib/components/lemmy/post/link/PostLink.svelte index 64b7d198..dcea3e92 100644 --- a/src/lib/components/lemmy/post/link/PostLink.svelte +++ b/src/lib/components/lemmy/post/link/PostLink.svelte @@ -8,7 +8,6 @@ Link as LinkIcon, } from 'svelte-hero-icons' import { optimizeImageURL } from '../helpers' - import PostLinkSources from './PostLinkSources.svelte' import { t } from '$lib/translations' import type { View } from '$lib/settings.svelte' @@ -111,68 +110,29 @@ {/if} -
- - {#snippet target()} - - {/snippet} - -
{:else} -
- - {#snippet target()} - - {/snippet} - - -
+ size="xs" + color="ghost" + rounding="pill" + > + {#if richURL} +
+ {richURL.hostname} + {#if richURL.pathname != '/'} + + {richURL.pathname} + + {/if} +
+ {:else} + {url} + {/if} + {/if} diff --git a/src/lib/components/lemmy/post/link/PostLinkSources.svelte b/src/lib/components/lemmy/post/link/PostLinkSources.svelte deleted file mode 100644 index 2ed98dde..00000000 --- a/src/lib/components/lemmy/post/link/PostLinkSources.svelte +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - {$t('post.actions.link.title')} - {#each sources as source} - {#if source.type == type} - - {source.name} - - {/if} - {/each} - {$t('post.actions.link.actions')} - { - navigator?.share?.({ url: url }) ?? navigator?.clipboard?.writeText?.(url) - - toast({ content: $t('toast.copied') }) - }} - > - {#snippet prefix()} - - {/snippet} - {$t('post.actions.more.share')} - -