@@ -3,6 +3,7 @@ import { ProposalStatus } from 'cosmjs-types/cosmos/gov/v1beta1/gov';
33import { BASE_DENOM } from 'src/constants/config' ;
44import { formatNumber } from '../../utils/search/utils' ;
55import Tooltip from '../tooltip/tooltip' ;
6+ import styles from './styles.module.scss' ;
67
78const submitted = require ( '../../image/ionicons_svg_ios-battery-full.svg' ) ;
89const voting = require ( '../../image/ionicons_svg_ios-people.svg' ) ;
@@ -37,122 +38,68 @@ const toFixedNumber = (number, toFixed) => {
3738export const Votes = ( { finalVotes } ) => {
3839 try {
3940 return (
40- < Pane
41- backgroundColor = "#ffffff14"
42- borderRadius = { 5 }
43- overflow = "hidden"
44- height = { 10 }
45- width = "100%"
46- display = "flex"
47- >
48- < Pane display = "flex" height = "100%" width = { `${ finalVotes . yes } %` } >
41+ < div className = { styles . votesContainer } >
42+ < div
43+ className = { `${ styles . voteSection } ${ styles . voteYes } ` }
44+ style = { { width : `${ toFixedNumber ( finalVotes . yes , 2 ) } %` } }
45+ >
4946 < Tooltip
5047 placement = "top"
51- tooltip = { < Pane > Yes: { toFixedNumber ( finalVotes . yes , 2 ) } %</ Pane > }
52- >
53- < Pane
54- backgroundColor = "#3ab793"
55- display = "flex"
56- height = "100%"
57- width = "100%"
58- />
59- </ Tooltip >
60- </ Pane >
61- < Pane display = "flex" height = "100%" width = { `${ finalVotes . abstain } %` } >
48+ tooltip = { < div > Yes: { toFixedNumber ( finalVotes . yes , 2 ) } %</ div > }
49+ contentStyle = { { flexGrow : 1 } }
50+ />
51+ </ div >
52+ < div
53+ className = { `${ styles . voteSection } ${ styles . voteAbstain } ` }
54+ style = { { width : `${ toFixedNumber ( finalVotes . abstain , 2 ) } %` } }
55+ >
6256 < Tooltip
6357 tooltip = { `Abstain: ${ toFixedNumber ( finalVotes . abstain , 2 ) } %` }
6458 placement = "top"
65- >
66- < Pane
67- backgroundColor = "#ccdcff"
68- display = "flex"
69- height = "100%"
70- width = "100%"
71- // width={`${finalVotes.abstain}%`}
72- />
73- </ Tooltip >
74- </ Pane >
75- < Pane display = "flex" height = "100%" width = { `${ finalVotes . no } %` } >
59+ contentStyle = { { flexGrow : 1 } }
60+ />
61+ </ div >
62+ < div
63+ className = { `${ styles . voteSection } ${ styles . voteNo } ` }
64+ style = { { width : `${ toFixedNumber ( finalVotes . no , 2 ) } %` } }
65+ >
7666 < Tooltip
7767 tooltip = { `No: ${ toFixedNumber ( finalVotes . no , 2 ) } %` }
7868 placement = "top"
79- >
80- < Pane
81- backgroundColor = "#ffcf65"
82- display = "flex"
83- height = "100%"
84- width = "100%"
85- // width={`${finalVotes.no}%`}
86- />
87- </ Tooltip >
88- </ Pane >
89- < Pane display = "flex" height = "100%" width = { `${ finalVotes . noWithVeto } %` } >
69+ contentStyle = { { flexGrow : 1 } }
70+ />
71+ </ div >
72+ < div
73+ className = { `${ styles . voteSection } ${ styles . voteNoWithVeto } ` }
74+ style = { { width : `${ toFixedNumber ( finalVotes . noWithVeto , 2 ) } %` } }
75+ >
9076 < Tooltip
91- tooltip = { `NoWithVeto: ${ toFixedNumber ( finalVotes . noWithVeto , 2 ) } %` }
77+ tooltip = { `No With Veto: ${ toFixedNumber (
78+ finalVotes . noWithVeto ,
79+ 2
80+ ) } %`}
9281 placement = "top"
93- >
94- < Pane
95- backgroundColor = "#fe8a8a"
96- display = "flex"
97- height = "100%"
98- width = "100%"
99- // width={`${finalVotes.noWithVeto}%`}
100- />
101- </ Tooltip >
102- </ Pane >
103- </ Pane >
82+ contentStyle = { { flexGrow : 1 } }
83+ />
84+ </ div >
85+ </ div >
10486 ) ;
10587 } catch ( error ) {
10688 return (
107- < Pane
108- backgroundColor = "#ffffff14"
109- borderRadius = { 5 }
110- overflow = "hidden"
111- height = { 10 }
112- width = "100%"
113- display = "flex"
114- >
115- < Pane display = "flex" height = "100%" width = { 0 } >
116- < Tooltip placement = "top" tooltip = "Yes: 0%" >
117- < Pane
118- backgroundColor = "#3ab793"
119- display = "flex"
120- height = "100%"
121- width = { 0 }
122- />
123- </ Tooltip >
124- </ Pane >
125- < Pane display = "flex" height = "100%" width = { 0 } >
126- < Tooltip tooltip = "Abstain: 0%" placement = "top" >
127- < Pane
128- backgroundColor = "#ccdcff"
129- display = "flex"
130- height = "100%"
131- width = { 0 }
132- />
133- </ Tooltip >
134- </ Pane >
135- < Pane display = "flex" height = "100%" width = { 0 } >
136- < Tooltip tooltip = "No: 0%" placement = "top" >
137- < Pane
138- backgroundColor = "#ffcf65"
139- display = "flex"
140- height = "100%"
141- width = { 0 }
142- />
143- </ Tooltip >
144- </ Pane >
145- < Pane display = "flex" height = "100%" width = { 0 } >
146- < Tooltip tooltip = "NoWithVeto: 0%" placement = "top" >
147- < Pane
148- backgroundColor = "#fe8a8a"
149- display = "flex"
150- height = "100%"
151- width = { 0 }
152- />
153- </ Tooltip >
154- </ Pane >
155- </ Pane >
89+ < div className = { styles . votesContainer } >
90+ < div className = { styles . voteSection } style = { { width : '0%' } } >
91+ < Tooltip placement = "top" tooltip = "Yes: 0%" />
92+ </ div >
93+ < div className = { styles . voteSection } style = { { width : '0%' } } >
94+ < Tooltip tooltip = "Abstain: 0%" placement = "top" />
95+ </ div >
96+ < div className = { styles . voteSection } style = { { width : '0%' } } >
97+ < Tooltip tooltip = "No: 0%" placement = "top" />
98+ </ div >
99+ < div className = { styles . voteSection } style = { { width : '0%' } } >
100+ < Tooltip tooltip = "No With Veto: 0%" placement = "top" />
101+ </ div >
102+ </ div >
156103 ) ;
157104 }
158105} ;
0 commit comments