misc: Change the way buttons are handled
This commit is contained in:
1 parent
d8ac0d807a
commit
e243848e17
30 files changed
+215
-152
No files matched your search
@@ -51,6 +51,7 @@
|
||||
<FormattedNumber number={site.counts.communities} />
|
||||
</span>
|
||||
</div>
|
||||
<p class="text-sm">{site.site.description}</p>
|
||||
<p>{site.site.description}</p>
|
||||
<hr class="border-slate-300 dark:border-zinc-700" />
|
||||
<Markdown source={site.site.sidebar} />
|
||||
</StickyCard>
|
||||
@@ -17,9 +17,7 @@
|
||||
</script>
|
||||
|
||||
<li
|
||||
class="py-2 {$page.url.hash == `#${node.comment_view.comment.id}`
|
||||
? 'bg-slate-200 dark:bg-zinc-800'
|
||||
: ''} {node.depth == 0
|
||||
class="py-2 {node.depth == 0
|
||||
? 'border-b border-slate-200 dark:border-zinc-800'
|
||||
: ''}"
|
||||
id="#{node.comment_view.comment.id.toString()}"
|
||||
@@ -83,7 +81,7 @@
|
||||
node.children = [
|
||||
{
|
||||
children: [],
|
||||
depth: node.depth,
|
||||
depth: node.depth + 1,
|
||||
comment_view: e.detail.comment_view,
|
||||
},
|
||||
...node.children,
|
||||
|
||||
@@ -55,15 +55,14 @@
|
||||
class="bg-slate-100 dark:bg-zinc-900"
|
||||
bind:value={newComment}
|
||||
/>
|
||||
<div
|
||||
class="w-full ml-auto flex flex-row gap-2 md:w-24 md:absolute md:bottom-0 md:right-0 md:m-2"
|
||||
>
|
||||
<div class="sm:ml-auto sm:w-28">
|
||||
<Button
|
||||
large
|
||||
on:click={submit}
|
||||
color={Color.accent}
|
||||
color="primary"
|
||||
size="lg"
|
||||
class="w-full"
|
||||
{loading}
|
||||
disabled={loading}
|
||||
>
|
||||
Submit
|
||||
</Button>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
if (isParent && $page.url.hash) {
|
||||
document.getElementById($page.url.hash)?.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'center',
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -80,7 +81,7 @@
|
||||
disabled={loadingChildren}
|
||||
on:click={() => fetchChildren(node)}
|
||||
>
|
||||
<Icon src={ChevronDown} width={16} mini />
|
||||
<Icon src={ChevronDown} width={16} mini slot="icon" />
|
||||
{node.comment_view.counts.child_count} more
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -62,13 +62,23 @@
|
||||
<div class="flex flex-row gap-2 items-center">
|
||||
<PostVote post={post.post} vote={post.my_vote} score={post.counts.score} />
|
||||
|
||||
<Link color={Color.border} href="/post/{getInstance()}/{post.post.id}">
|
||||
<Button
|
||||
color="elevated"
|
||||
size="sm"
|
||||
href="/post/{getInstance()}/{post.post.id}"
|
||||
>
|
||||
<Icon slot="icon" src={ChatBubbleOvalLeft} mini width={16} height={16} />
|
||||
<FormattedNumber number={post.counts.comments} />
|
||||
</Link>
|
||||
</Button>
|
||||
<Menu alignment="bottom-right" class="ml-auto overflow-auto" let:toggleOpen>
|
||||
<Button slot="button" label="Post actions" on:click={toggleOpen}>
|
||||
<Icon src={EllipsisHorizontal} width={16} mini />
|
||||
<Button
|
||||
slot="button"
|
||||
label="Post actions"
|
||||
on:click={toggleOpen}
|
||||
class="!p-1.5"
|
||||
color="secondary"
|
||||
>
|
||||
<Icon slot="icon" src={EllipsisHorizontal} width={16} mini />
|
||||
</Button>
|
||||
<li class="mx-4 text-xs opacity-80 text-left my-1 py-1">Creator</li>
|
||||
<MenuButton
|
||||
|
||||
@@ -10,13 +10,15 @@
|
||||
<!-- svelte-ignore a11y-missing-attribute -->
|
||||
<img
|
||||
src={thumbnail_url}
|
||||
class="rounded-md max-h-[16rem] w-full aspect-[16/9] object-cover"
|
||||
class="rounded-md max-h-[16rem] w-full aspect-[16/9] object-cover bg-slate-200 dark:bg-zinc-800"
|
||||
width={600}
|
||||
height={400}
|
||||
/>
|
||||
<span
|
||||
class="w-full px-4 py-2 overflow-hidden
|
||||
whitespace-nowrap text-ellipsis text-sm group-hover:underline bg-slate-100 border
|
||||
dark:border-zinc-700
|
||||
dark:bg-zinc-800 absolute bottom-0 rounded-b-md flex flex-row gap-1 items-center h-10"
|
||||
class="w-full px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis
|
||||
text-sm group-hover:underline bg-slate-100 border dark:border-zinc-700
|
||||
dark:bg-zinc-800 absolute bottom-0 rounded-b-md flex flex-row gap-1
|
||||
items-center h-10"
|
||||
>
|
||||
<Icon src={Link} width={16} mini />
|
||||
{new URL(url).hostname}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import Button from '$lib/components/input/Button.svelte'
|
||||
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
||||
import { authData, getClient } from '$lib/lemmy'
|
||||
import { userSettings } from '$lib/settings.js'
|
||||
@@ -65,8 +66,7 @@
|
||||
|
||||
<slot {upvote} {downvote} {vote} {score}>
|
||||
<div
|
||||
class="{Color.border} text-sm gap-0.5 rounded-md flex flex-row items-center px-1
|
||||
py-0.5
|
||||
class="{Color.border} text-sm gap-0.5 rounded-md flex flex-row items-center
|
||||
transition-colors cursor-pointer bg-slate-100 dark:bg-zinc-800
|
||||
hover:bg-slate-200 dark:hover:bg-zinc-700"
|
||||
>
|
||||
@@ -74,7 +74,7 @@
|
||||
aria-label="Upvote"
|
||||
class:text-orange-500={vote == 1 && $userSettings.revertColors}
|
||||
class:text-blue-500={vote == 1 && !$userSettings.revertColors}
|
||||
class="p-0.5 px-1"
|
||||
class="py-1 pr-0.5 pl-2"
|
||||
on:click={upvote}
|
||||
>
|
||||
<Icon src={ChevronUp} mini width={20} height={20} />
|
||||
@@ -84,7 +84,7 @@
|
||||
aria-label="Downvote"
|
||||
class:text-blue-500={vote == -1 && $userSettings.revertColors}
|
||||
class:text-red-500={vote == -1 && !$userSettings.revertColors}
|
||||
class="p-0.5 px-1"
|
||||
class="py-1 pl-0.5 pr-2"
|
||||
on:click={downvote}
|
||||
>
|
||||
<Icon src={ChevronDown} mini width={20} height={20} />
|
||||
|
||||
Reference in new issue
Block a user