mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Vote imporvements
This commit is contained in:
parent
d22e20b79e
commit
5611fd8d66
2 changed files with 25 additions and 21 deletions
|
@ -9,6 +9,7 @@ export default function UpDownVote({
|
|||
upvotes,
|
||||
downvotes,
|
||||
userId,
|
||||
disabled,
|
||||
}) {
|
||||
const upvoted = upvotes.includes(userId)
|
||||
const downvoted = downvotes.includes(userId)
|
||||
|
@ -19,6 +20,9 @@ export default function UpDownVote({
|
|||
className={styles.action}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
if (disabled) {
|
||||
return
|
||||
}
|
||||
if (!upvoted) {
|
||||
onUp()
|
||||
} else {
|
||||
|
@ -33,6 +37,9 @@ export default function UpDownVote({
|
|||
className={styles.action}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
if (disabled) {
|
||||
return
|
||||
}
|
||||
if (!downvoted) {
|
||||
onDown()
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue