impr: hide features when unsupported
This commit is contained in:
8 files changed
+41
-14
No files matched your search
@@ -41,6 +41,7 @@
|
||||
import { amMod, isAdmin } from '../moderation/moderation'
|
||||
import { block, blockInstance, purgeCommunity } from './CommunityCard.svelte'
|
||||
import CommunityFlair from './CommunityFlair.svelte'
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
|
||||
interface Props {
|
||||
community: Community
|
||||
@@ -176,6 +177,7 @@
|
||||
{/snippet}
|
||||
</Subscribe>
|
||||
|
||||
{#if client().setFlair}
|
||||
<Button
|
||||
size="custom"
|
||||
class="h-9 aspect-square"
|
||||
@@ -186,6 +188,7 @@
|
||||
<Icon src={Tag} size="16" micro />
|
||||
</Button>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{#if profile.current?.user && profile.current.user.moderates
|
||||
.map((c) => c.community.id)
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
let { children } = $props()
|
||||
|
||||
const options = getContext('options')
|
||||
|
||||
console.log(options.noStyle)
|
||||
</script>
|
||||
|
||||
<p class={[!options.noStyle && 'leading-[1.7] break-words max-w']}>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
alignment="left"
|
||||
size="md"
|
||||
rounding="xl"
|
||||
class="flex flex-row gap-2 items-center"
|
||||
class="flex flex-row gap-2! items-center"
|
||||
aria-label={$t('aria.sidebar.accounts')}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
@@ -48,9 +48,9 @@
|
||||
<div class="font-medium">{profile.current.username}</div>
|
||||
{#if !LINKED_INSTANCE_URL}
|
||||
<div class="text-xs text-slate-500 dark:text-zinc-500">
|
||||
<span class="capitalize"
|
||||
>{profile.current.client?.name ?? DEFAULT_CLIENT_TYPE.name}</span
|
||||
>
|
||||
<span class="capitalize">
|
||||
{profile.current.client?.name ?? DEFAULT_CLIENT_TYPE.name}
|
||||
</span>
|
||||
• {profile.current.instance}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -69,7 +69,7 @@
|
||||
{@const selected = profile.meta.profile == p.id}
|
||||
<MenuButton
|
||||
onclick={() => switchTo(p.id)}
|
||||
class={[selected && 'bg-slate-100! dark:bg-zinc-800!']}
|
||||
class={[selected && 'bg-slate-100! dark:bg-zinc-800!', 'gap-2!']}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Avatar url={p.avatar} alt={p.username} width={24} />
|
||||
@@ -78,9 +78,9 @@
|
||||
<div class="font-medium text-sm">{p.username}</div>
|
||||
{#if !LINKED_INSTANCE_URL}
|
||||
<div class="text-xs text-slate-500 dark:text-zinc-500">
|
||||
<span class="capitalize"
|
||||
>{p.client?.name ?? DEFAULT_CLIENT_TYPE.name}</span
|
||||
>
|
||||
<span class="capitalize">
|
||||
{p.client?.name ?? DEFAULT_CLIENT_TYPE.name}
|
||||
</span>
|
||||
• {p.instance}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -265,6 +265,11 @@
|
||||
},
|
||||
"translators": "Translators",
|
||||
"accounts": "Accounts",
|
||||
"accounts.placeholder": {
|
||||
"title": "Not logged in",
|
||||
"description": "You aren't logged in. You can sign up or log in here.",
|
||||
"descriptionWithGuest": "You aren't logged in. You can log in, sign up, or add a new guest account here."
|
||||
},
|
||||
"explore": {
|
||||
"title": "Explore",
|
||||
"feeds": "Feeds",
|
||||
|
||||
@@ -318,6 +318,10 @@
|
||||
pointer-events: none;
|
||||
filter: brightness(90%);
|
||||
cursor: normal;
|
||||
|
||||
@variant dark {
|
||||
filter: brightness(70%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,11 +1,15 @@
|
||||
<script lang="ts">
|
||||
import { Header } from '$comp/ui/layout'
|
||||
import CommonList from '$comp/ui/layout/CommonList.svelte'
|
||||
import Placeholder from '$comp/ui/Placeholder.svelte'
|
||||
import DebugObject from '$comp/util/debug/DebugObject.svelte'
|
||||
import { profile, type ProfileInfo } from '$lib/auth.svelte.js'
|
||||
import { DEFAULT_CLIENT_TYPE } from '$lib/client/base'
|
||||
import CommonList from '$comp/ui/layout/CommonList.svelte'
|
||||
import { Header } from '$comp/ui/layout'
|
||||
import DebugObject from '$comp/util/debug/DebugObject.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { LINKED_INSTANCE_URL } from '$lib/instance.svelte.js'
|
||||
import {
|
||||
DEFAULT_INSTANCE_URL,
|
||||
LINKED_INSTANCE_URL,
|
||||
} from '$lib/instance.svelte.js'
|
||||
import ProfileAvatar from '$lib/lemmy/ProfileAvatar.svelte'
|
||||
import { settings } from '$lib/settings.svelte.js'
|
||||
import { Badge, Button, Menu, MenuButton, Modal } from 'mono-svelte'
|
||||
@@ -118,6 +122,16 @@
|
||||
</div>
|
||||
{/snippet}
|
||||
</Header>
|
||||
{#if profile.meta.profiles.length == 1 && !profile.current.jwt && profile.current.instance == DEFAULT_INSTANCE_URL}
|
||||
<Placeholder
|
||||
icon={Identification}
|
||||
title={$t('routes.accounts.placeholder.title')}
|
||||
description={LINKED_INSTANCE_URL
|
||||
? $t('routes.accounts.placeholder.description')
|
||||
: $t('routes.accounts.placeholder.descriptionWithGuest')}
|
||||
class="my-auto"
|
||||
/>
|
||||
{:else}
|
||||
<form class="accounts-grid gap-4">
|
||||
<CommonList
|
||||
selected={(p) => p.id == profile.meta.profile}
|
||||
@@ -226,6 +240,7 @@
|
||||
{/snippet}
|
||||
</CommonList>
|
||||
</form>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.accounts-grid {
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
{#if icon}
|
||||
<Icon
|
||||
src={icon}
|
||||
mini
|
||||
size="32"
|
||||
class="bg-red-200/20 dark:bg-red-600/20 p-1.5 rounded-lg color
|
||||
text-red-500 dark:text-red-300 float-left mr-2 clear-both"
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
<Icon
|
||||
src={icon}
|
||||
size="32"
|
||||
mini
|
||||
class="bg-red-200/20 dark:bg-red-600/20 p-1.5 self-center
|
||||
rounded-lg color text-red-500 dark:text-red-300"
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user