feat: Add post uploading

This commit is contained in:
Xyphyn committed 2023-07-05 12:58:36 -07:00
1 parent 5f674d4691
commit 1842139af9
31 files changed
+560 -225

No files matched your search

+36 -34
View File
@@ -37,39 +37,41 @@
}
</script>
<div
class="flex flex-row items-center gap-1 rounded-md transition-colors
cursor-pointer border border-slate-200 dark:border-zinc-800
<slot {upvote} {downvote} {vote} {score}>
<div
class="flex flex-row items-center gap-1 rounded-md transition-colors
cursor-pointer border border-slate-200 dark:border-zinc-700 px-1 py-[2px]
{// upvote
vote == 1
? 'bg-orange-600/20 text-orange-500'
: // downvote
vote == -1
? 'bg-blue-600/40 text-blue-400'
: // no vote
'bg-slate-100 dark:bg-zinc-900 hover:bg-slate-200 dark:hover:bg-zinc-700'}"
>
<button
aria-label="Upvote"
class="p-1 px-1.5"
on:click={() => {
vote = vote == 1 ? 0 : 1
upvote()
}}
vote == 1
? 'bg-orange-600/20 text-orange-500'
: // downvote
vote == -1
? 'bg-blue-600/40 text-blue-400'
: // no vote
'bg-slate-100 dark:bg-zinc-800 hover:bg-slate-200 dark:hover:bg-zinc-700'}"
>
<Icon src={ChevronUp} mini width={20} height={20} />
</button>
<span class="text-sm">
<FormattedNumber number={score} />
</span>
<button
aria-label="Downvote"
class="p-1 px-1.5"
on:click={() => {
vote = vote == -1 ? 0 : -1
downvote()
}}
>
<Icon src={ChevronDown} mini width={20} height={20} />
</button>
</div>
<button
aria-label="Upvote"
class="p-0.5 px-1"
on:click={() => {
vote = vote == 1 ? 0 : 1
upvote()
}}
>
<Icon src={ChevronUp} mini width={20} height={20} />
</button>
<span class="text-sm">
<FormattedNumber number={score} />
</span>
<button
aria-label="Downvote"
class="p-0.5 px-1"
on:click={() => {
vote = vote == -1 ? 0 : -1
downvote()
}}
>
<Icon src={ChevronDown} mini width={20} height={20} />
</button>
</div>
</slot>