mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Vote imporvements
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user