diff --git a/src/components/common/payout-amounts.vue b/src/components/common/payout-amounts.vue index dabd0f618..26c9dd02b 100644 --- a/src/components/common/payout-amounts.vue +++ b/src/components/common/payout-amounts.vue @@ -2,6 +2,7 @@ import { defineComponent } from 'vue' import { PropType } from 'vue/types/v3-component-props' import TokenValue from './token-value.vue' +import { TOKEN_TYPES } from '~/const' type TokenProps = Omit< InstanceType['$props'], @@ -44,6 +45,17 @@ export default defineComponent({ } else { return true } + }, + + settingsMultiplier(label) { + switch (label) { + case TOKEN_TYPES.CASH_TOKEN: + return this.$store.state.dao.settings.settings_treasuryTokenMultiplier_i + case TOKEN_TYPES.VOICE_TOKEN: + return this.$store.state.dao.settings.settings_voiceTokenMultiplier_i + case TOKEN_TYPES.UTILITY_TOKEN: + return this.$store.state.dao.settings.settings_utilityTokenMultiplier_i + } } } }) @@ -53,5 +65,5 @@ export default defineComponent({ .full-width(:class="{row: $q.platform.is.desktop}") template(v-for="token in tokens") .col(v-if="token.value" :class="{'col-12': stacked, 'q-mb-md': $q.platform.is.mobile}") - token-value(v-if="settingsHasToken(token.symbol)" :daoLogo="daoLogo" :multiplier="multiplier" v-bind="token") + token-value(v-if="settingsHasToken(token.symbol)" :daoLogo="daoLogo" :multiplier="settingsMultiplier(token.label)" v-bind="token") diff --git a/src/const.js b/src/const.js index f34a16653..4f1ac429e 100644 --- a/src/const.js +++ b/src/const.js @@ -91,5 +91,11 @@ export const PERIOD_NUMBERS = Object.freeze({ export const DEFAULT_TIER = 'Custom Reward' +export const TOKEN_TYPES = Object.freeze({ + CASH_TOKEN: 'Cash Token', + UTILITY_TOKEN: 'Utility Token', + VOICE_TOKEN: 'Voice Token' +}) + export const MIN_TOKEN_MULTIPLIER = 0 export const MAX_TOKEN_MULTIPLIER = 1 diff --git a/src/pages/proposals/create/StepPayout.vue b/src/pages/proposals/create/StepPayout.vue index f1925232e..a2b958bf8 100644 --- a/src/pages/proposals/create/StepPayout.vue +++ b/src/pages/proposals/create/StepPayout.vue @@ -265,13 +265,13 @@ export default { return (this.cycleDurationSec / this.daoSettings.periodDurationSec).toFixed(2) }, cashToken () { - return !this.toggle ? this.getFormatedTokenAmount(this.peg, Number.MAX_VALUE) : this.getFormatedTokenAmount((this.peg / this.periodsOnCycle).toFixed(2), Number.MAX_VALUE) + return !this.toggle ? this.getFormatedTokenAmount(this.peg * (this.$store.state.dao.settings.settings_treasuryTokenMultiplier_i ? this.$store.state.dao.settings.settings_treasuryTokenMultiplier_i : 1), Number.MAX_VALUE) : this.getFormatedTokenAmount((this.peg * (this.$store.state.dao.settings.settings_treasuryTokenMultiplier_i ? this.$store.state.dao.settings.settings_treasuryTokenMultiplier_i : 1) / this.periodsOnCycle).toFixed(2), Number.MAX_VALUE) }, utilityToken () { - return !this.toggle ? this.getFormatedTokenAmount(this.reward, Number.MAX_VALUE) : this.getFormatedTokenAmount((this.reward / this.periodsOnCycle).toFixed(2), Number.MAX_VALUE) + return !this.toggle ? this.getFormatedTokenAmount(this.reward * (this.$store.state.dao.settings.settings_utilityTokenMultiplier_i ? this.$store.state.dao.settings.settings_utilityTokenMultiplier_i : 1), Number.MAX_VALUE) : this.getFormatedTokenAmount((this.reward * (this.$store.state.dao.settings.settings_utilityTokenMultiplier_i ? this.$store.state.dao.settings.settings_utilityTokenMultiplier_i : 1) / this.periodsOnCycle).toFixed(2), Number.MAX_VALUE) }, voiceToken () { - return !this.toggle ? this.getFormatedTokenAmount(this.voice, Number.MAX_VALUE) : this.getFormatedTokenAmount((this.voice / this.periodsOnCycle).toFixed(2), Number.MAX_VALUE) + return !this.toggle ? this.getFormatedTokenAmount(this.voice * (this.$store.state.dao.settings.settings_voiceTokenMultiplier_i ? this.$store.state.dao.settings.settings_voiceTokenMultiplier_i : 1), Number.MAX_VALUE) : this.getFormatedTokenAmount((this.voice * (this.$store.state.dao.settings.settings_voiceTokenMultiplier_i ? this.$store.state.dao.settings.settings_voiceTokenMultiplier_i : 1) / this.periodsOnCycle).toFixed(2), Number.MAX_VALUE) }, isAssignment () { const proposalType = this.$store.state.proposals.draft.category.key