From 36a7838a471301de34e44240d0e3a4d518bc903d Mon Sep 17 00:00:00 2001 From: Xylight Date: Sat, 17 Aug 2024 14:06:09 -0700 Subject: [PATCH] misc: update how badges work --- src/lib/components/lemmy/user/UserLink.svelte | 70 ++++++++++++++++--- src/lib/components/ui/navbar/Profile.svelte | 17 ++--- 2 files changed, 69 insertions(+), 18 deletions(-) diff --git a/src/lib/components/lemmy/user/UserLink.svelte b/src/lib/components/lemmy/user/UserLink.svelte index a9b46848..590bb6c0 100644 --- a/src/lib/components/lemmy/user/UserLink.svelte +++ b/src/lib/components/lemmy/user/UserLink.svelte @@ -1,9 +1,48 @@ - + {displayName ? user.display_name || user.name : user.name} {#if showInstance} @@ -66,8 +107,17 @@ {#if user.bot_account}
BOT
{/if} - {#if photonBadge} - + {#if envBadge} + {#if envBadge.icon == 'photon'} + + {:else} + + {/if} {/if} {/if} diff --git a/src/lib/components/ui/navbar/Profile.svelte b/src/lib/components/ui/navbar/Profile.svelte index 90057170..1270520d 100644 --- a/src/lib/components/ui/navbar/Profile.svelte +++ b/src/lib/components/ui/navbar/Profile.svelte @@ -36,6 +36,7 @@ import { site } from '$lib/lemmy' import SiteCard from '$lib/components/lemmy/SiteCard.svelte' import { t } from '$lib/translations' + import UserLink from '$lib/components/lemmy/user/UserLink.svelte' let showInstance = false @@ -85,14 +86,14 @@ {/if} {#if $profile?.user} -
- - {$profile?.user?.local_user_view?.person.name} -
+ {:else} {$t('nav.menu.label')} {/if}