feat: add option to revert post vote design
This commit is contained in:
1 parent
c09460bd9b
commit
466b33a583
3 files changed
+39
-2
No files matched your search
@@ -84,6 +84,32 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<slot {upvote} {downvote} {vote} {score}>
|
<slot {upvote} {downvote} {vote} {score}>
|
||||||
|
{#if $userSettings.newVote}
|
||||||
|
<div class="flex items-center text-sm gap-1 rounded-md border-zinc-700">
|
||||||
|
<Button
|
||||||
|
aria-label="Upvote"
|
||||||
|
class={vote == 1 ? voteColor(vote) : ''}
|
||||||
|
on:click={upvote}
|
||||||
|
size="square-md"
|
||||||
|
color="tertiary"
|
||||||
|
alignment="center"
|
||||||
|
>
|
||||||
|
<Icon src={ArrowUpCircle} mini={vote == 1} size="20" />
|
||||||
|
</Button>
|
||||||
|
<span class="font-medium {voteColor(vote)}">
|
||||||
|
<FormattedNumber number={score} />
|
||||||
|
</span>
|
||||||
|
<Button
|
||||||
|
aria-label="Downvote"
|
||||||
|
class={vote == -1 ? voteColor(vote) : ''}
|
||||||
|
on:click={downvote}
|
||||||
|
size="square-md"
|
||||||
|
color="tertiary"
|
||||||
|
>
|
||||||
|
<Icon src={ArrowDownCircle} mini={vote == -1} size="20" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
<div
|
<div
|
||||||
class="flex items-center text-sm gap-1 rounded-md border border-slate-200
|
class="flex items-center text-sm gap-1 rounded-md border border-slate-200
|
||||||
dark:border-zinc-700 px-1 h-full duration-200"
|
dark:border-zinc-700 px-1 h-full duration-200"
|
||||||
@@ -98,7 +124,9 @@
|
|||||||
>
|
>
|
||||||
<Icon src={ChevronUp} mini size="18" />
|
<Icon src={ChevronUp} mini size="18" />
|
||||||
</Button>
|
</Button>
|
||||||
<span class="font-medium transition-colors duration-200 {voteColor(vote)}">
|
<span
|
||||||
|
class="font-medium transition-colors duration-200 {voteColor(vote)}"
|
||||||
|
>
|
||||||
<FormattedNumber number={score} />
|
<FormattedNumber number={score} />
|
||||||
</span>
|
</span>
|
||||||
<Button
|
<Button
|
||||||
@@ -111,4 +139,5 @@
|
|||||||
<Icon src={ChevronDown} mini size="18" />
|
<Icon src={ChevronDown} mini size="18" />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
</slot>
|
</slot>
|
||||||
@@ -35,6 +35,7 @@ interface Settings {
|
|||||||
moderation: {
|
moderation: {
|
||||||
removalReasonPreset: string
|
removalReasonPreset: string
|
||||||
}
|
}
|
||||||
|
newVote: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export const defaultSettings: Settings = {
|
export const defaultSettings: Settings = {
|
||||||
@@ -69,6 +70,7 @@ export const defaultSettings: Settings = {
|
|||||||
moderation: {
|
moderation: {
|
||||||
removalReasonPreset: `Your submission in *"{{post}}"* was removed for {{reason}}.`,
|
removalReasonPreset: `Your submission in *"{{post}}"* was removed for {{reason}}.`,
|
||||||
},
|
},
|
||||||
|
newVote: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const userSettings = writable(defaultSettings)
|
export const userSettings = writable(defaultSettings)
|
||||||
|
|||||||
@@ -95,8 +95,8 @@
|
|||||||
Show a user's display name instead of their account username.
|
Show a user's display name instead of their account username.
|
||||||
</span>
|
</span>
|
||||||
</Setting>
|
</Setting>
|
||||||
<SectionTitle class="mt-4">UI</SectionTitle>
|
|
||||||
|
|
||||||
|
<SectionTitle class="mt-4">UI</SectionTitle>
|
||||||
<Setting>
|
<Setting>
|
||||||
<Checkbox bind:checked={$userSettings.markReadPosts} slot="title">
|
<Checkbox bind:checked={$userSettings.markReadPosts} slot="title">
|
||||||
Mark read posts
|
Mark read posts
|
||||||
@@ -125,6 +125,12 @@
|
|||||||
</Checkbox>
|
</Checkbox>
|
||||||
<span slot="description">Blur images of NSFW content.</span>
|
<span slot="description">Blur images of NSFW content.</span>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting>
|
||||||
|
<Checkbox bind:checked={$userSettings.newVote} slot="title">
|
||||||
|
New vote design
|
||||||
|
</Checkbox>
|
||||||
|
<span slot="description">Alternate vote design</span>
|
||||||
|
</Setting>
|
||||||
|
|
||||||
<SectionTitle class="mt-4">Instances</SectionTitle>
|
<SectionTitle class="mt-4">Instances</SectionTitle>
|
||||||
<Setting>
|
<Setting>
|
||||||
|
|||||||
Reference in new issue
Block a user