Skip to content

Commit

Permalink
TC-98 | Add ProposalComments component with tab filters
Browse files Browse the repository at this point in the history
  • Loading branch information
tyllo committed Aug 5, 2022
1 parent 3cef4c4 commit 6e01a67
Show file tree
Hide file tree
Showing 14 changed files with 873 additions and 333 deletions.
9 changes: 9 additions & 0 deletions app/router.scrollBehavior.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const routerScrollBehavior = (to, from, savedPosition) => {
if (to.name === 'governance-id') {
return { x: 0, y: 0 }
}

return savedPosition || { x: 0, y: 0 }
}

export default routerScrollBehavior
27 changes: 22 additions & 5 deletions components/ProposalCommentFormModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -88,6 +102,11 @@ export default {
message: ''
}
}),
computed: {
isValid() {
return this.validate()
}
},
methods: {
validate() {
const { form, fields, support } = this
Expand All @@ -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')
}
Expand Down
Loading

0 comments on commit 6e01a67

Please sign in to comment.