Skip to content

Commit

Permalink
Add logic to toggle button visual when voting
Browse files Browse the repository at this point in the history
  • Loading branch information
jengu288 committed Jan 18, 2024
1 parent c3190eb commit 918f947
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
5 changes: 3 additions & 2 deletions client/src/components/endRound/EndRound.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<player-chooser v-model="selectedId" class="w-50 w-lg-25 fs-4 mb-3" />
<button
class="btn btn-orange w-75 w-lg-50 w-xl-25 fs-4 mb-3 position-relative"
:class="{ 'btn-blue': !startNextRoundNext }"
:class="{ 'btn-blue': !pressedVote }"
@click="sendVote">
{{ hasNextRound ? $t('startNextRound') : $t('viewResults') }}
<notification-count
Expand Down Expand Up @@ -41,7 +41,8 @@ export default defineComponent({
data() {
return {
responsesId: '',
selectedId: ''
selectedId: '',
pressedVote: false
}
},
computed: {
Expand Down
8 changes: 5 additions & 3 deletions client/src/components/promptResponse/VoteSkip.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<a
v-tooltip.right="$t('tooltip.voteSkip')"
class="btn btn-sm btn-orange text-white ratio-1x1 position-relative d-inline-flex justify-content-center align-items-center"
:class="{ 'btn-blue': !skipVoteNext }"
class="btn btn-sm btn-orange text-white ratio-1x1 position-relative d-inline-flex justify-content-center align-items-center active"
:class="{ 'btn-blue': !pressedVote }"
@click="sendVote">
<i class="bi-hand-thumbs-down fs-3 p-0 lh-sm" />

Expand Down Expand Up @@ -31,14 +31,16 @@ export default defineComponent({
},
data() {
return {
tooltips: []
tooltips: [],
pressedVote: false
}
},
computed: {
...mapState(useGameStore, ['skipVoteCount', 'skipVoteNext'])
},
methods: {
sendVote() {
this.pressedVote = !this.pressedVote
new AudioWrap(ClickMp3).play()
socket.emit('pollVote', 'skipPrompt')
}
Expand Down
5 changes: 3 additions & 2 deletions client/src/components/responseMatching/DisputeIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<button
v-tooltip="{ title: $t('tooltip.dispute', { response }), placement }"
class="btn btn-sm btn-orange text-white ratio-1x1 position-relative d-inline-flex justify-content-center align-items-center"
:class="{ 'btn-blue': !sikeDisputeNext }"
:class="{ 'btn-blue': !pressedVote }"
:disabled="disabled"
@click="sendVote">
<i class="bi-hand-thumbs-down fs-5 lh-sm" />
Expand Down Expand Up @@ -45,7 +45,8 @@ export default defineComponent({
},
data() {
return {
tooltips: []
tooltips: [],
pressedVote: false
}
},
computed: {
Expand Down
16 changes: 8 additions & 8 deletions server/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
require('@rushstack/eslint-patch/modern-module-resolution')
require('@rushstack/eslint-patch/modern-module-resolution');

module.exports = {
env: {
'es2022': true,
'node': true
es2022: true,
node: true
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended-type-checked', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
'ecmaVersion': 'latest',
'sourceType': 'module',
'project': true,
'tsconfigRootDir': '.'
ecmaVersion: 'latest',
sourceType: 'module',
project: true,
tsconfigRootDir: '.'
},
plugins: ['@typescript-eslint', 'prettier'],
rules: {
'prettier/prettier': 2
},
ignorePatterns: ['/*', '!/src', '!/tests']
}
};

0 comments on commit 918f947

Please sign in to comment.