impr: rewrite PostForm component to be stabler and more sustainable (#684)
* impr: rewrite PostForm component into extracted state class * fix: use base community as PostFormState * fix: add else clause to ensure 'unset' unsets the language
This commit is contained in:
1 parent
6f7501ffc5
commit
e4507cbf91
16 files changed
+506
-586
No files matched your search
@@ -64,7 +64,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<form class="space-y-2">
|
||||
<form class="space-y-2" onsubmit={() => castVote(selected!)}>
|
||||
<CommonList class="">
|
||||
{#each options.toSorted((a, b) => a.sort_order - b.sort_order) as choice}
|
||||
{@const active = selected == choice.id}
|
||||
@@ -125,9 +125,10 @@
|
||||
{#if (selected && canVote) || loading}
|
||||
<Button
|
||||
class="w-24"
|
||||
onclick={() => castVote(selected!)}
|
||||
color="primary"
|
||||
submit
|
||||
{loading}
|
||||
disabled={loading}
|
||||
>
|
||||
{$t('form.submit')}
|
||||
</Button>
|
||||
|
||||
Reference in new issue
Block a user