Skip to content

Commit 09db11f

Browse files
committed
fix(gov): switch from constants.gov
1 parent e45ef22 commit 09db11f

3 files changed

Lines changed: 15 additions & 30 deletions

File tree

components/modules/proposal/ProposalOverview.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ const handleViewRawVotes = () => {
189189
The minimum deposit was not reached
190190
</Text>
191191
<Text v-else-if="proposal.status === 'rejected'" size="13" weight="600" color="primary">
192-
The quorum {{ appStore.constants.gov.quorum * 100 }}% was not reached
192+
The quorum {{ Number(proposal.quorum) * 100 }}% was not reached
193193
</Text>
194194
</Flex>
195195
</Flex>
@@ -287,7 +287,7 @@ const handleViewRawVotes = () => {
287287
</Flex>
288288

289289
<AmountInCurrency
290-
:amount="{ value: appStore.constants.gov.min_deposit.replace('utia', ''), decimal: 6 }"
290+
:amount="{ value: proposal.min_deposit.replace('utia', ''), decimal: 6 }"
291291
:styles="{ amount: { color: 'secondary' }, currency: { color: 'tertiary' } }"
292292
/>
293293
</Flex>

components/modules/proposal/ProposalTimeline.vue

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ const props = defineProps({
2020
})
2121
2222
const expand = ref(["inactive", "active"].includes(props.proposal.status))
23-
24-
const votingPeriod = ref(appStore.constants.gov.voting_period.replace("s", ""))
2523
</script>
2624

2725
<template>
@@ -40,12 +38,11 @@ const votingPeriod = ref(appStore.constants.gov.voting_period.replace("s", ""))
4038

4139
<div v-for="dot in 4" class="dot" />
4240

43-
<Flex v-if="isMainnet()" align="center" gap="6">
41+
<Flex align="center" gap="6">
4442
<Icon name="time" size="12" color="secondary" />
4543
<Text size="12" weight="600" color="primary">
4644
{{
47-
DateTime.fromISO(proposal.activation_time)
48-
.plus({ seconds: votingPeriod })
45+
DateTime.fromISO(proposal.end_time)
4946
.diff(DateTime.fromISO(proposal.activation_time), "days")
5047
.toObject()
5148
.days.toFixed(0)
@@ -56,15 +53,14 @@ const votingPeriod = ref(appStore.constants.gov.voting_period.replace("s", ""))
5653

5754
<div v-for="dot in 4" class="dot" />
5855

59-
<Text v-if="isMainnet()" size="12" weight="600" color="secondary" align="right">
56+
<Text size="12" weight="600" color="secondary" align="right">
6057
{{
61-
DateTime.fromISO(proposal.activation_time)
62-
.plus({ seconds: votingPeriod })
58+
DateTime.fromISO(proposal.end_time)
59+
6360
.setLocale("en")
6461
.toLocaleString(DateTime.DATE_MED)
6562
}}
6663
</Text>
67-
<Text v-else size="12" weight="600" color="tertiary" align="right"> Unknown </Text>
6864
</Flex>
6965
</Badge>
7066

@@ -91,30 +87,19 @@ const votingPeriod = ref(appStore.constants.gov.voting_period.replace("s", ""))
9187
<Text size="12" weight="500" color="tertiary">{{ DateTime.fromISO(proposal.activation_time).toFormat("FF") }}</Text>
9288
</Flex>
9389
</Flex>
94-
<Flex v-if="isMainnet()" gap="12">
90+
<Flex gap="12">
9591
<div :class="$style.circle" />
9692

9793
<Flex direction="column" gap="8">
98-
<Text size="13" weight="600" color="secondary">End of voting period</Text>
94+
<Text size="13" weight="600" color="secondary">End of voting</Text>
9995
<Text size="12" weight="500" color="tertiary">
100-
{{ DateTime.fromISO(proposal.activation_time).plus({ seconds: votingPeriod }).toFormat("FF") }}
96+
{{ DateTime.fromISO(proposal.end_time).toFormat("FF") }}
10197
</Text>
10298
</Flex>
10399
</Flex>
104100

105101
<div :class="$style.line" />
106102
</Flex>
107-
108-
<Flex gap="12" style="margin-top: 8px">
109-
<div :class="[$style.circle, $style.red]" />
110-
111-
<Flex direction="column" gap="8">
112-
<Text size="13" weight="600" color="secondary">Deadline for deposit</Text>
113-
<Text size="12" weight="500" color="tertiary">
114-
{{ DateTime.fromISO(proposal.deposit_time).toFormat("FF") }}
115-
</Text>
116-
</Flex>
117-
</Flex>
118103
</template>
119104
</Flex>
120105
</template>

components/modules/proposal/VotesAllocation.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const expand = ref(["inactive", "active"].includes(props.proposal.status))
3131
</Flex>
3232

3333
<Flex align="center" gap="4" :class="$style.voting_wrapper">
34-
<div :style="{ left: `${appStore.constants.gov.threshold * 100}%` }" :class="$style.threshold" />
34+
<div :style="{ left: `${Number(proposal.threshold) * 100}%` }" :class="$style.threshold" />
3535

3636
<Tooltip v-if="proposal.yes" wide :trigger-width="`${Math.max(5, (proposal.yes * 100) / proposal.votes_count)}%`">
3737
<div
@@ -106,19 +106,19 @@ const expand = ref(["inactive", "active"].includes(props.proposal.status))
106106
</Flex>
107107
</Flex>
108108

109-
<Flex v-if="proposal.yes / proposal.votes_count > appStore.constants.gov.threshold" align="center" gap="4">
109+
<Flex v-if="proposal.yes / proposal.votes_count > Number(proposal.threshold)" align="center" gap="4">
110110
<Icon name="check-circle" size="12" color="tertiary" />
111111
<Text size="12" weight="500" color="tertiary">
112112
The <Text color="secondary" weight="600">Yes</Text> vote threshold of
113-
<Text color="secondary">{{ appStore.constants.gov.threshold * 100 }}%</Text> is met
113+
<Text color="secondary">{{ Number(proposal.threshold) * 100 }}%</Text> is met
114114
</Text>
115115
</Flex>
116116

117-
<Flex v-if="proposal.no_with_veto / proposal.votes_count > appStore.constants.gov.veto_threshold" align="center" gap="4">
117+
<Flex v-if="proposal.no_with_veto / proposal.votes_count > Number(proposal.veto_quorum)" align="center" gap="4">
118118
<Icon name="check-circle" size="12" color="tertiary" />
119119
<Text size="12" weight="500" color="tertiary">
120120
The <Text color="secondary" weight="600">No With Veto</Text> vote threshold of
121-
<Text color="secondary">{{ appStore.constants.gov.veto_threshold * 100 }}%</Text> is met
121+
<Text color="secondary">{{ Number(proposal.veto_quorum) * 100 }}%</Text> is met
122122
</Text>
123123
</Flex>
124124
</Flex>

0 commit comments

Comments
 (0)