switch to mono-svelte Button component

This commit is contained in:
Xyphyn committed 2023-09-03 17:05:45 -07:00
1 parent c4a1f143cb
commit d02d8556d5
61 files changed
+298 -348

No files matched your search

@@ -1,5 +1,4 @@
<script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import TextArea from '$lib/components/input/TextArea.svelte'
import UserItem from '$lib/components/lemmy/user/UserItem.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte'
@@ -10,6 +9,7 @@
import TextInput from '$lib/components/input/TextInput.svelte'
import { profile } from '$lib/auth.js'
import Checkbox from '$lib/components/input/Checkbox.svelte'
import { Button } from 'mono-svelte'
export let open = false
let item: Person | undefined
@@ -8,19 +8,20 @@
} from 'lemmy-js-client'
import { amMod, ban, isAdmin, remove } from './moderation'
import Menu from '$lib/components/ui/menu/Menu.svelte'
import Button from '$lib/components/input/Button.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import { Fire, Icon, ShieldExclamation, Trash } from 'svelte-hero-icons'
import { Color } from '$lib/ui/colors.js'
import { isCommentView } from '$lib/lemmy/item.js'
import { profile } from '$lib/auth.js'
import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte'
import { Button } from 'mono-svelte'
export let item: PostView | CommentView
</script>
<Menu let:toggleOpen alignment="bottom-center" class="top-0 h-[26px] w-[26px] ">
<Menu alignment="bottom-center" class="top-0 h-[26px] w-[26px] ">
<Button
let:toggleOpen
class="w-[26px] h-[26px] hover:!text-green-500 dark:text-zinc-400 text-slate-600"
size="square-md"
on:click={toggleOpen}
@@ -32,7 +33,9 @@
</Button>
{#if ($profile?.user && amMod($profile.user, item.community)) || ($profile?.user && isAdmin($profile.user))}
<li class="px-4 py-1 my-1 text-xs text-slate-600 dark:text-zinc-400">
Moderation {#if (!item.community.local && !amMod($profile.user, item.community)) } (Instance Only) {/if}
Moderation {#if !item.community.local && !amMod($profile.user, item.community)}
(Instance Only)
{/if}
</li>
<MenuButton color="success" on:click={() => remove(item)}>
<Icon src={Trash} size="16" mini />
@@ -44,7 +47,9 @@
</MenuButton>
{#if $profile?.user && $profile.user?.local_user_view.person.id != item.creator.id}
<span class="px-4 py-1 my-1 text-xs text-slate-600 dark:text-zinc-400">
User {#if (!item.community.local && !amMod($profile.user, item.community)) } (Instance Only) {/if}
User {#if !item.community.local && !amMod($profile.user, item.community)}
(Instance Only)
{/if}
</span>
<MenuButton
color="dangerSecondary"
@@ -3,7 +3,6 @@
import type { CommentView, Community, PostView } from 'lemmy-js-client'
import { amMod, ban, isAdmin, remove } from './moderation'
import Menu from '$lib/components/ui/menu/Menu.svelte'
import Button from '$lib/components/input/Button.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import {
Fire,
@@ -19,6 +18,7 @@
import { isCommentView, isPostView } from '$lib/lemmy/item.js'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { profile } from '$lib/auth.js'
import { Button } from 'mono-svelte'
export let item: PostView | CommentView
@@ -88,8 +88,9 @@
}
</script>
<Menu let:toggleOpen alignment="bottom-right">
<Menu alignment="bottom-right">
<Button
let:toggleOpen
class="hover:text-green-500 dark:text-zinc-400 text-slate-500"
on:click={toggleOpen}
slot="button"
@@ -103,7 +104,7 @@
viewBox="0 0 20 22"
fill="none"
xmlns="http://www.w3.org/2000/svg"
slot="icon"
slot="prefix"
>
<path
fill-rule="evenodd"
@@ -115,7 +116,9 @@
</Button>
{#if ($profile?.user && amMod($profile.user, item.community)) || ($profile?.user && isAdmin($profile.user))}
<span class="px-4 py-1 my-1 text-xs text-slate-600 dark:text-zinc-400">
Moderation {#if !item.community.local && !amMod($profile.user, item.community)} (Instance Only) {/if}
Moderation {#if !item.community.local && !amMod($profile.user, item.community)}
(Instance Only)
{/if}
</span>
<MenuButton
color="warning"
@@ -159,7 +162,9 @@
</MenuButton>
{#if $profile?.user && $profile.user.local_user_view.person.id != item.creator.id}
<span class="px-4 py-1 my-1 text-xs text-slate-600 dark:text-zinc-400">
User {#if !item.community.local && !amMod($profile.user, item.community)} (Instance Only) {/if}
User {#if !item.community.local && !amMod($profile.user, item.community)}
(Instance Only)
{/if}
</span>
<MenuButton
color="dangerSecondary"
@@ -1,5 +1,4 @@
<script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import TextArea from '$lib/components/input/TextArea.svelte'
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import Post from '$lib/components/lemmy/post/Post.svelte'
@@ -17,6 +16,7 @@
import { userSettings } from '$lib/settings.js'
import { fullCommunityName } from '$lib/util.js'
import { amMod, isAdmin } from './moderation'
import { Button } from 'mono-svelte'
export let open: boolean
export let item: PostView | CommentView | undefined = undefined
@@ -202,7 +202,7 @@
bind:value={reason}
/>
{#if !removed && ( amMod($profile.user, item.community) || (isAdmin($profile.user) && item.community.local))}
{#if !removed && $profile?.user && ( amMod($profile.user, item.community) || (isAdmin($profile.user) && item.community.local))}
<Checkbox bind:checked={commentReason}>Reply with reason</Checkbox>
{#if commentReason}
@@ -227,7 +227,7 @@
disabled={loading}
submit
>
<Icon src={purge ? Fire : Trash} mini size="16" slot="icon" />
<Icon src={purge ? Fire : Trash} mini size="16" slot="prefix" />
{#if purge}
Purge
{:else}
@@ -1,5 +1,4 @@
<script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import TextArea from '$lib/components/input/TextArea.svelte'
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import Post from '$lib/components/lemmy/post/Post.svelte'
@@ -8,6 +7,7 @@
import { getClient } from '$lib/lemmy.js'
import type { CommentView, PostView } from 'lemmy-js-client'
import { profile } from '$lib/auth.js'
import { Button } from 'mono-svelte'
export let open: boolean
export let item: PostView | CommentView | undefined = undefined