refactor: use icon prop instead of snippet prefix
This commit is contained in:
56 files changed
+409
-595
No files matched your search
@@ -54,28 +54,23 @@
|
||||
class="rounded-2xl h-9 aspect-square"
|
||||
rounding="none"
|
||||
aria-label={$t('common.refresh')}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ArrowPath} size="16" mini />
|
||||
{/snippet}
|
||||
</Button>
|
||||
icon={ArrowPath}
|
||||
></Button>
|
||||
<Button
|
||||
onclick={markAllAsRead}
|
||||
loading={markingAsRead}
|
||||
disabled={markingAsRead || data.inbox.value.length == 0}
|
||||
rounding="pill"
|
||||
color="primary"
|
||||
icon={Check}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={Check} size="16" mini />
|
||||
{/snippet}
|
||||
{$t('routes.inbox.markAsRead')}
|
||||
</Button>
|
||||
</div>
|
||||
</Header>
|
||||
|
||||
<Select
|
||||
class="relative w-max"
|
||||
class="relative"
|
||||
bind:value={
|
||||
() => data.unreadOnly.value.toString(),
|
||||
(v) => (data.unreadOnly.value = v == 'true')
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<script lang="ts">
|
||||
import { notifications, profile } from '$lib/auth.svelte.js'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import { CommentItem } from '$lib/components/lemmy/comment'
|
||||
import PrivateMessage from '$lib/components/lemmy/inbox/PrivateMessage.svelte'
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||
import { publishedToDate } from '$lib/components/util/date.js'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import type { InboxItem } from '$lib/lemmy/inbox.js'
|
||||
import { escapeHtml } from '$lib/util.svelte'
|
||||
import { Button } from 'mono-svelte'
|
||||
import { Eye, EyeSlash, Icon } from 'svelte-hero-icons'
|
||||
import { CommentItem } from '$lib/components/lemmy/comment'
|
||||
import { Eye, EyeSlash } from 'svelte-hero-icons'
|
||||
|
||||
interface Props {
|
||||
item: InboxItem
|
||||
@@ -99,10 +99,8 @@
|
||||
size="sm"
|
||||
rounding="pill"
|
||||
class="shrink-0"
|
||||
icon={item.read ? EyeSlash : Eye}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={item.read ? EyeSlash : Eye} size="16" micro />
|
||||
{/snippet}
|
||||
{item.read
|
||||
? $t('post.actions.more.markUnread')
|
||||
: $t('post.actions.more.markRead')}
|
||||
@@ -132,10 +130,8 @@
|
||||
}}
|
||||
size="sm"
|
||||
rounding="pill"
|
||||
icon={item.read ? EyeSlash : Eye}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={item.read ? EyeSlash : Eye} size="16" micro />
|
||||
{/snippet}
|
||||
{item.read
|
||||
? $t('post.actions.more.markUnread')
|
||||
: $t('post.actions.more.markRead')}
|
||||
|
||||
@@ -109,11 +109,12 @@
|
||||
{$t('filter.inbox.messages')}
|
||||
{#snippet extended()}
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<Button size="square-md" href="." title={$t('common.back')}>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ArrowLeft} micro size="16" />
|
||||
{/snippet}
|
||||
</Button>
|
||||
<Button
|
||||
size="square-md"
|
||||
href="."
|
||||
title={$t('common.back')}
|
||||
icon={ArrowLeft}
|
||||
></Button>
|
||||
<UserLink avatar user={data.creator.value.person_view.person} />
|
||||
</div>
|
||||
{/snippet}
|
||||
@@ -239,11 +240,8 @@
|
||||
submit
|
||||
loading={textbox.loading}
|
||||
disabled={textbox.loading}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={PaperAirplane} size="18" micro />
|
||||
{/snippet}
|
||||
</Button>
|
||||
icon={PaperAirplane}
|
||||
></Button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -64,17 +64,19 @@
|
||||
</Button>
|
||||
{/snippet}
|
||||
{#if primary}
|
||||
<MenuButton color="danger-subtle" onclick={() => ondelete?.(true)}>
|
||||
{#snippet prefix()}
|
||||
<Icon src={Trash} size="16" micro />
|
||||
{/snippet}
|
||||
<MenuButton
|
||||
color="danger-subtle"
|
||||
onclick={() => ondelete?.(true)}
|
||||
icon={Trash}
|
||||
>
|
||||
{$t('post.actions.more.delete')}
|
||||
</MenuButton>
|
||||
{:else}
|
||||
<MenuButton color="danger-subtle" onclick={() => onreport?.(true)}>
|
||||
{#snippet prefix()}
|
||||
<Icon src={Flag} size="16" micro />
|
||||
{/snippet}
|
||||
<MenuButton
|
||||
color="danger-subtle"
|
||||
onclick={() => onreport?.(true)}
|
||||
icon={Flag}
|
||||
>
|
||||
{$t('moderation.report')}
|
||||
</MenuButton>
|
||||
{/if}
|
||||
|
||||
Reference in new issue
Block a user