Use the button labels from the store rather than hard-coded values.
This commit is contained in:
parent
bf63077f67
commit
02cecebbae
1 changed files with 10 additions and 9 deletions
|
|
@ -13,15 +13,7 @@
|
||||||
class="card-button clickable"
|
class="card-button clickable"
|
||||||
@click.stop="sendCard(cardIndex)"
|
@click.stop="sendCard(cardIndex)"
|
||||||
>
|
>
|
||||||
<span v-if="isGuesser" >
|
{{ buttonLabel }}
|
||||||
Ask {{ $store.state.writer_name }}
|
|
||||||
</span>
|
|
||||||
<span v-else-if="isWriter" >
|
|
||||||
Answer Question
|
|
||||||
</span>
|
|
||||||
<span v-else >
|
|
||||||
Unknown Role
|
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -44,6 +36,15 @@ export default {
|
||||||
isWriter() {
|
isWriter() {
|
||||||
return this.userRole == this.$store.state.writer_name;
|
return this.userRole == this.$store.state.writer_name;
|
||||||
},
|
},
|
||||||
|
buttonLabel() {
|
||||||
|
if (this.isGuesser) {
|
||||||
|
return this.$store.state.guesser_card_button
|
||||||
|
} else if (this.isWriter) {
|
||||||
|
return this.$store.state.writer_card_button
|
||||||
|
} else {
|
||||||
|
return `Unknown Role`
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
sendCard(cardIndex) {
|
sendCard(cardIndex) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue