TC-98 | Add ProposalComments component with tab filters

This commit is contained in:
Andrey Pastukhov 2022-07-29 14:57:40 +10:00
parent 3cef4c4d5b
commit 6e01a677ae
No known key found for this signature in database
GPG key ID: A841818F95ED6301
14 changed files with 876 additions and 336 deletions

View file

@ -52,11 +52,25 @@
</div>
</div>
<b-button v-if="support" type="is-primary" icon-left="check" outlined @click="onCastVote(true)">
<b-button
v-if="support"
:disabled="!isValid"
type="is-primary"
icon-left="check"
outlined
@click="onCastVote(true)"
>
{{ $t('for') }}
</b-button>
<b-button v-else type="is-danger" icon-left="close" outlined @click="onCastVote(false)">
<b-button
v-else
:disabled="!isValid"
type="is-danger"
icon-left="close"
outlined
@click="onCastVote(false)"
>
{{ $t('against') }}
</b-button>
</div>
@ -88,6 +102,11 @@ export default {
message: ''
}
}),
computed: {
isValid() {
return this.validate()
}
},
methods: {
validate() {
const { form, fields, support } = this
@ -100,9 +119,7 @@ export default {
return fields.contact && fields.message
},
onCastVote() {
const isValid = this.validate()
if (isValid) {
if (this.isValid) {
this.$emit('castVote', this.form)
this.$emit('close')
}