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

Commit 222abed

Browse files
committed
updating zeip proposal history
1 parent f0eac3c commit 222abed

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

ts/pages/governance/countdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const Countdown: React.StatelessComponent<Props> = ({ startDate, endDate
3737
voteTextPrefix = 'Voting ends: ';
3838
}
3939
const timeToDisplay = isUpcoming ? startTime : endTime;
40-
const timeText = ` • ${getRelativeTime(timeToDisplay)}`;
40+
const timeText = isUpcoming ? ` • ${getRelativeTime(timeToDisplay)}` : ``;
4141
const voteText = `${voteTextPrefix} ${timeToDisplay.format('L LT')} ${moment()
4242
.tz(moment.tz.guess())
4343
.format('z')} ${timeText}`;

ts/pages/governance/governance.tsx

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,16 @@ export class Governance extends React.Component<RouteComponentProps<any>> {
7979
const outcome = getVoteOutcome(tally);
8080

8181
const proposalHistoryState = {
82-
created: {
83-
done: true,
84-
timestamp: voteStartDate,
85-
show: true,
86-
},
8782
active: {
8883
done: now.isAfter(voteStartDate),
8984
timestamp: voteStartDate,
9085
show: true,
9186
},
92-
failed: {
93-
done: hasVoteEnded && outcome === 'rejected',
87+
finalized: {
88+
done: hasVoteEnded && (outcome === 'rejected' || outcome === 'accepted'),
9489
timestamp: this._proposalData?.voteEndDate,
95-
show: hasVoteEnded && outcome === 'rejected',
96-
},
97-
accepted: {
98-
done: hasVoteEnded && outcome === 'accepted',
99-
timestamp: this._proposalData?.voteEndDate,
100-
show: (hasVoteStarted && !hasVoteEnded) || (hasVoteEnded && outcome === 'accepted'),
90+
outcome,
91+
show: true,
10192
},
10293
};
10394

@@ -136,6 +127,7 @@ export class Governance extends React.Component<RouteComponentProps<any>> {
136127
<Ticks>
137128
{Object.keys(proposalHistoryState).map((state: string) => {
138129
const historyState = proposalHistoryState[state as ProposalState];
130+
console.log(historyState, state);
139131
if (!historyState.show) {
140132
return null;
141133
}
@@ -150,7 +142,7 @@ export class Governance extends React.Component<RouteComponentProps<any>> {
150142
}
151143
/>
152144
</Tick>
153-
{!['accepted', 'failed'].includes(state) && (
145+
{!['accepted', 'failed', 'finalized'].includes(state) && (
154146
<Connector className={state === 'active' ? 'small' : ''} />
155147
)}
156148
</>
@@ -160,6 +152,7 @@ export class Governance extends React.Component<RouteComponentProps<any>> {
160152
<HistoryCells>
161153
{Object.keys(proposalHistoryState).map((state: string) => {
162154
const historyState = proposalHistoryState[state as ProposalState];
155+
console.log(historyState);
163156
if (!historyState.show) {
164157
return null;
165158
}
@@ -172,15 +165,21 @@ export class Governance extends React.Component<RouteComponentProps<any>> {
172165
fontWeight={400}
173166
>
174167
{state}
168+
{historyState.done &&
169+
(historyState.outcome === 'rejected' ||
170+
historyState.outcome === 'accepted')
171+
? ` - ${historyState.outcome}`
172+
: ''}
175173
</StateTitle>
176174
<Text
177175
fontColor={colors.textDarkSecondary}
178176
fontFamily="Formular"
179177
fontSize="17px"
180178
fontWeight={300}
181179
>
180+
<div></div>
182181
{historyState.done
183-
? historyState.timestamp.format('MMMM Do, YYYY - hh:mm a')
182+
? `${historyState.timestamp.format('MMMM Do, YYYY - hh:mm a')}`
184183
: 'TBD'}
185184
</Text>
186185
</CellContent>

ts/utils/environments.ts

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

0 commit comments

Comments
 (0)