0
0
Fork 0

Use the button labels from the store rather than hard-coded values.

This commit is contained in:
Oliver-Akins 2020-12-19 16:56:34 -07:00
parent bf63077f67
commit 02cecebbae

View file

@ -13,15 +13,7 @@
class="card-button clickable"
@click.stop="sendCard(cardIndex)"
>
<span v-if="isGuesser" >
Ask {{ $store.state.writer_name }}
</span>
<span v-else-if="isWriter" >
Answer Question
</span>
<span v-else >
Unknown Role
</span>
{{ buttonLabel }}
</button>
</div>
</div>
@ -44,6 +36,15 @@ export default {
isWriter() {
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: {
sendCard(cardIndex) {