misc: Minor tweaks
This commit is contained in:
1 parent
12d4a9d9de
commit
f3c3982eff
4 files changed
+27
-10
No files matched your search
@@ -2,6 +2,7 @@
|
|||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import { Color } from '$lib/ui/colors.js'
|
import { Color } from '$lib/ui/colors.js'
|
||||||
import Loading from '$lib/components/ui/loader/Loading.svelte'
|
import Loading from '$lib/components/ui/loader/Loading.svelte'
|
||||||
|
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
|
||||||
|
|
||||||
export let color: Color = Color.secondary
|
export let color: Color = Color.secondary
|
||||||
export let loading = false
|
export let loading = false
|
||||||
@@ -9,6 +10,7 @@
|
|||||||
export let disabled = false
|
export let disabled = false
|
||||||
export let submit = false
|
export let submit = false
|
||||||
export let label: string = ''
|
export let label: string = ''
|
||||||
|
export let spinner = false
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
</script>
|
</script>
|
||||||
@@ -29,5 +31,13 @@
|
|||||||
<slot name="icon" />
|
<slot name="icon" />
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
<div class="mx-auto py-2" class:hidden={!loading}><Loading /></div>
|
<div class="mx-auto" class:hidden={!loading}>
|
||||||
|
{#if spinner}
|
||||||
|
<Spinner />
|
||||||
|
{:else}
|
||||||
|
<div class="py-2">
|
||||||
|
<Loading />
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
</button>
|
</button>
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
import type { Post } from 'lemmy-js-client'
|
import type { Post } from 'lemmy-js-client'
|
||||||
import { Color } from '$lib/ui/colors.js'
|
import { Color } from '$lib/ui/colors.js'
|
||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
|
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
|
||||||
|
|
||||||
export let nodes: CommentNodeI[]
|
export let nodes: CommentNodeI[]
|
||||||
export let isParent: boolean
|
export let isParent: boolean
|
||||||
@@ -73,7 +74,7 @@
|
|||||||
<svelte:self {post} nodes={node.children} isParent={false} />
|
<svelte:self {post} nodes={node.children} isParent={false} />
|
||||||
{/if}
|
{/if}
|
||||||
{#if node.comment_view.counts.child_count > 0 && node.children.length == 0}
|
{#if node.comment_view.counts.child_count > 0 && node.children.length == 0}
|
||||||
<div class="my-2 min-w-[9rem] w-max h-8 border-l border-black/10 pl-2">
|
<div class="my-2 min-w-[7rem] w-max h-8 border-l border-black/10 pl-2">
|
||||||
<Button
|
<Button
|
||||||
loading={loadingChildren}
|
loading={loadingChildren}
|
||||||
disabled={loadingChildren}
|
disabled={loadingChildren}
|
||||||
@@ -81,7 +82,7 @@
|
|||||||
on:click={() => fetchChildren(node)}
|
on:click={() => fetchChildren(node)}
|
||||||
>
|
>
|
||||||
<Icon src={ChevronDown} width={16} mini />
|
<Icon src={ChevronDown} width={16} mini />
|
||||||
Load {node.comment_view.counts.child_count} more
|
{node.comment_view.counts.child_count} more
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -32,25 +32,34 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.markdown :global(a) {
|
.markdown :global(a) {
|
||||||
@apply text-sky-400 hover:underline;
|
@apply text-sky-500 hover:underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown :global(ul) {
|
.markdown :global(ul) {
|
||||||
@apply list-disc pl-4;
|
@apply list-disc pl-4;
|
||||||
line-height: 0.75rem;
|
line-height: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown :global(ol) {
|
.markdown :global(ol) {
|
||||||
@apply list-decimal pl-4;
|
@apply list-decimal pl-4;
|
||||||
line-height: 0.75rem;
|
line-height: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown :global(li) {
|
.markdown :global(li) {
|
||||||
@apply m-0 !important;
|
@apply m-0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown :global(li > *) {
|
||||||
|
@apply m-0 !important;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown :global(blockquote) {
|
.markdown :global(blockquote) {
|
||||||
@apply border-l-2 border-black/20 dark:border-white/20 pl-2 my-1 h-max;
|
@apply border-l-2 border-black/20 dark:border-white/20 pl-2 my-1 h-max;
|
||||||
|
line-height: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown :global(blockquote > *) {
|
||||||
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let width: number = 40
|
export let width: number = 28
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="spinner" style="width: {width}px; height: {width}px;">
|
<div class="spinner" style="width: {width}px; height: {width}px;">
|
||||||
@@ -21,9 +21,6 @@
|
|||||||
div.spinner {
|
div.spinner {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-left: 50%;
|
|
||||||
margin-right: 50%;
|
|
||||||
padding: 10px;
|
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user