@@ -5,7 +5,6 @@ import { sanitizeUrl } from '@braintree/sanitize-url';
55import { useProposalsStore } from ' @/stores/proposals' ;
66import { _rt , _n , shortenAddress , getUrl } from ' @/helpers/utils' ;
77import { useActions } from ' @/composables/useActions' ;
8- import txs from ' @/helpers/execution.json' ;
98
109const route = useRoute ();
1110const proposalsStore = useProposalsStore ();
@@ -33,118 +32,120 @@ onMounted(() => {
3332
3433<template >
3534 <div >
36- <Container v-if =" !proposal" class =" pt-5" >
37- <UiLoading />
38- </Container >
39- <div v-else >
40- <Container class =" pt-5" >
41- <h1 class =" mb-3" >
42- {{ proposal.title || `Proposal #${proposal.proposal_id}` }}
43- </h1 >
44- <div class =" flex mb-4 items-center" >
45- <div class =" flex-auto space-x-2" >
46- <router-link
47- :to =" {
48- name: 'user',
49- params: { id: proposal.author.id }
50- }"
35+ <Container class =" pt-5" >
36+ <UiLoading v-if =" !proposal" />
37+ <div v-else >
38+ <div >
39+ <h1 class =" mb-3" >
40+ {{ proposal.title || `Proposal #${proposal.proposal_id}` }}
41+ </h1 >
42+ <div class =" flex mb-4 items-center" >
43+ <div class =" flex-auto space-x-2" >
44+ <router-link
45+ :to =" {
46+ name: 'user',
47+ params: { id: proposal.author.id }
48+ }"
49+ >
50+ <Stamp :id =" proposal.author.id" :size =" 24" class =" mr-1" />
51+ {{ shortenAddress(proposal.author.id) }}
52+ </router-link >
53+ <span
54+ >·
55+ <a
56+ class =" text-skin-text"
57+ @click =" modalOpenTimeline = true"
58+ v-text =" _rt(proposal.created)"
59+ />
60+ </span >
61+ </div >
62+ <a
63+ :href =" sanitizeUrl(getUrl(proposal.metadata_uri))"
64+ target =" _blank"
5165 >
52- <Stamp :id =" proposal.author.id" :size =" 24" class =" mr-1" />
53- {{ shortenAddress(proposal.author.id) }}
54- </router-link >
55- <span
56- >·
57- <a
58- class =" text-skin-text"
59- @click =" modalOpenTimeline = true"
60- v-text =" _rt(proposal.created)"
61- />
62- </span >
66+ <UiButton class =" !w-[46px] !h-[46px] !px-[12px]" >
67+ <IH-dots-horizontal />
68+ </UiButton >
69+ </a >
70+ </div >
71+ <div v-if =" proposal.body" class =" mb-4" >
72+ <p v-text =" proposal.body" />
6373 </div >
64- <a :href =" sanitizeUrl(getUrl(proposal.metadata_uri))" target =" _blank" >
65- <UiButton class =" !w-[46px] !h-[46px] !px-[12px]" >
66- <IH-dots-horizontal />
67- </UiButton >
68- </a >
69- </div >
70- <div v-if =" proposal.body" class =" mb-4" >
71- <p v-text =" proposal.body" />
7274 </div >
73- </Container >
74- <Container class =" space-y-4 mb-4" slim >
75- <BlockExecution :txs =" txs" />
76- <a
77- v-if =" discussion"
78- :href =" discussion"
79- target =" _blank"
80- class =" x-block block mb-5"
81- >
82- <h4 class =" px-4 py-3" >
83- <IH-chat-alt class =" inline-block mr-2" /> Discussion
84- <IH-external-link class =" float-right mt-1" />
75+
76+ <div v-if =" discussion" >
77+ <h4 class =" mb-3 eyebrow flex items-center" >
78+ <IH-chat-alt class =" inline-block mr-2" />
79+ <span >Discussion</span >
8580 </h4 >
86- <Preview
87- :url =" discussion"
88- class =" !border-0 !border-t !rounded-none"
89- />
90- </a >
91- </Container >
92- <Container >
93- <Vote :proposal =" proposal" >
94- <template #voted =" { vote: userVote } " >
95- <h4 class =" mb-2" >Results</h4 >
96- <Results :proposal =" proposal" width =" full" />
97- <div class =" mt-2" >
98- <div v-if =" userVote.choice === 1" >
99- You already voted <strong >for</strong > this proposal
100- </div >
101- <div v-else-if =" userVote.choice === 2" >
102- You already voted <strong >against</strong > this proposal
103- </div >
104- <div v-else-if =" userVote.choice === 3" >
105- You already <strong >abstained</strong > from voting on this
106- proposal
81+ <a :href =" discussion" target =" _blank" class =" block mb-5" >
82+ <Preview :url =" discussion" />
83+ </a >
84+ </div >
85+
86+ <div >
87+ <Vote :proposal =" proposal" >
88+ <template #voted =" { vote: userVote } " >
89+ <h4 class =" mb-3 eyebrow flex items-center" >
90+ <IH-chart-bar class =" inline-block mr-2" />
91+ <span >Results</span >
92+ </h4 >
93+ <Results :proposal =" proposal" width =" full" />
94+ <div class =" mt-2" >
95+ <div v-if =" userVote.choice === 1" >
96+ You already voted <strong >for</strong > this proposal
97+ </div >
98+ <div v-else-if =" userVote.choice === 2" >
99+ You already voted <strong >against</strong > this proposal
100+ </div >
101+ <div v-else-if =" userVote.choice === 3" >
102+ You already <strong >abstained</strong > from voting on this
103+ proposal
104+ </div >
107105 </div >
106+ </template >
107+ <template #ended >
108+ <h4 class =" mb-3 eyebrow flex items-center" >
109+ <IH-chart-bar class =" inline-block mr-2" />
110+ <span >Results</span >
111+ </h4 >
112+ <Results :proposal =" proposal" width =" full" />
113+ </template >
114+ <div class =" grid grid-cols-3 gap-2" >
115+ <UiButton
116+ class =" w-full !text-white !bg-green !border-green"
117+ @click =" vote(proposal, 1)"
118+ >
119+ <IH-check class =" inline-block" />
120+ </UiButton >
121+ <UiButton
122+ class =" w-full !text-white !bg-red !border-red"
123+ @click =" vote(proposal, 2)"
124+ >
125+ <IH-x class =" inline-block" />
126+ </UiButton >
127+ <UiButton
128+ class =" w-full !text-white !bg-gray-500 !border-gray-500"
129+ @click =" vote(proposal, 3)"
130+ >
131+ <IH-arrow-right class =" inline-block" />
132+ </UiButton >
108133 </div >
109- </template >
110- <template #ended >
111- <h4 class =" mb-2" >Results</h4 >
112- <Results :proposal =" proposal" width =" full" />
113- </template >
114- <div class =" grid grid-cols-3 gap-2" >
115- <UiButton
116- class =" w-full !text-white !bg-green !border-green"
117- @click =" vote(proposal, 1)"
118- >
119- <IH-check class =" inline-block" />
120- </UiButton >
121- <UiButton
122- class =" w-full !text-white !bg-red !border-red"
123- @click =" vote(proposal, 2)"
124- >
125- <IH-x class =" inline-block" />
126- </UiButton >
127- <UiButton
128- class =" w-full !text-white !bg-gray-500 !border-gray-500"
129- @click =" vote(proposal, 3)"
130- >
131- <IH-arrow-right class =" inline-block" />
132- </UiButton >
134+ </Vote >
135+ <div class =" mt-3" >
136+ <a class =" text-skin-text" @click =" modalOpenVotes = true" >
137+ {{ _n(proposal.vote_count) }} votes
138+ </a >
139+ ·
140+ <a
141+ class =" text-skin-text"
142+ @click =" modalOpenTimeline = true"
143+ v-text =" _rt(proposal.max_end)"
144+ />
133145 </div >
134- </Vote >
135- <div class =" mt-3" >
136- <a class =" text-skin-text" @click =" modalOpenVotes = true" >
137- {{ _n(proposal.vote_count) }} votes
138- </a >
139- ·
140- <a
141- class =" text-skin-text"
142- @click =" modalOpenTimeline = true"
143- v-text =" _rt(proposal.max_end)"
144- />
145146 </div >
146- </Container >
147- </div >
147+ </div >
148+ </Container >
148149 <teleport to =" #modal" >
149150 <ModalVotes
150151 :open =" modalOpenVotes"
0 commit comments