Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit bed5fb4

Browse files
committed
zeip proposal ui updates + bugfix
1 parent 222abed commit bed5fb4

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

ts/pages/governance/governance.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ interface State {
3636
tally?: TallyInterface;
3737
}
3838

39+
interface HistoryState {
40+
done: boolean;
41+
timestamp: moment.Moment;
42+
outcome?: string;
43+
show: boolean;
44+
}
45+
3946
const benefitLabels: LabelInterface = {
4047
1: 'Little Benefit',
4148
2: 'Medium Benefit',
@@ -48,7 +55,7 @@ const riskLabels: LabelInterface = {
4855
3: 'High Risk',
4956
};
5057

51-
type ProposalState = 'created' | 'active' | 'failed' | 'accepted';
58+
type ProposalState = 'active' | 'finalized';
5259

5360
export class Governance extends React.Component<RouteComponentProps<any>> {
5461
public state: State = {
@@ -88,7 +95,7 @@ export class Governance extends React.Component<RouteComponentProps<any>> {
8895
done: hasVoteEnded && (outcome === 'rejected' || outcome === 'accepted'),
8996
timestamp: this._proposalData?.voteEndDate,
9097
outcome,
91-
show: true,
98+
show: hasVoteEnded && (outcome === 'rejected' || outcome === 'accepted'),
9299
},
93100
};
94101

@@ -126,17 +133,19 @@ export class Governance extends React.Component<RouteComponentProps<any>> {
126133
<ProposalHistory>
127134
<Ticks>
128135
{Object.keys(proposalHistoryState).map((state: string) => {
129-
const historyState = proposalHistoryState[state as ProposalState];
130-
console.log(historyState, state);
136+
const historyState: HistoryState = proposalHistoryState[state as ProposalState];
131137
if (!historyState.show) {
132138
return null;
133139
}
134140
return (
135141
<>
136-
<Tick isActive={historyState.done} isFailed={state === 'failed'}>
142+
<Tick
143+
isActive={historyState.done}
144+
isFailed={historyState.outcome === 'rejected'}
145+
>
137146
<img
138147
src={
139-
state === 'failed'
148+
historyState.outcome === 'rejected'
140149
? '/images/governance/cross.svg'
141150
: '/images/governance/tick_mark.svg'
142151
}
@@ -151,8 +160,7 @@ export class Governance extends React.Component<RouteComponentProps<any>> {
151160
</Ticks>
152161
<HistoryCells>
153162
{Object.keys(proposalHistoryState).map((state: string) => {
154-
const historyState = proposalHistoryState[state as ProposalState];
155-
console.log(historyState);
163+
const historyState: HistoryState = proposalHistoryState[state as ProposalState];
156164
if (!historyState.show) {
157165
return null;
158166
}

ts/pages/governance/vote_index_card.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export const VoteIndexCard: React.StatelessComponent<VoteIndexCardProps> = (prop
127127
forVotes,
128128
quorumThreshold,
129129
} = props;
130+
130131
return (
131132
<ReactRouterLink style={{ order }} to={`${WebsitePaths.Vote}/proposal/${id}`}>
132133
<Section
@@ -160,7 +161,7 @@ export const VoteIndexCard: React.StatelessComponent<VoteIndexCardProps> = (prop
160161
<VoteStatusText
161162
status={getStatus(
162163
isCanceled,
163-
againstVotes < forVotes && forVotes > quorumThreshold,
164+
!isHappening && againstVotes < forVotes && forVotes > quorumThreshold,
164165
isUpcoming,
165166
)}
166167
/>

ts/utils/environments.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ export const environments = {
1515
return _.includes(window.location.href, domains.DOMAIN_DOGFOOD);
1616
},
1717
isProduction(): boolean {
18-
return true;
19-
// return _.includes(window.location.href, domains.DOMAIN_PRODUCTION);
18+
return _.includes(window.location.href, domains.DOMAIN_PRODUCTION);
2019
},
2120
getEnvironment(): Environments {
2221
if (environments.isDogfood()) {

0 commit comments

Comments
 (0)