Skip to content

Commit

Permalink
Merge pull request #9 from daostack/display-proposal-event-history
Browse files Browse the repository at this point in the history
Show proposal timestamps in summary
  • Loading branch information
roienatan authored Nov 9, 2020
2 parents 3e29657 + 71eaf67 commit f4e53f5
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/assets/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,7 @@
"No Proposals Found": "No proposals found whose title contains the given text. Note the filter is case-sensitive.",
"Type and press Enter ": "Type and press Enter or Tab to filter proposals by title",
"Unregistered Plugin Proposal": "This proposal is in unregistered plugin",
"Unregistered": "Unregistered"
"Unregistered": "Unregistered",
"Created": "Created",
"Executed": "Executed"
}
26 changes: 26 additions & 0 deletions src/components/Proposal/ProposalDetails.scss
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,32 @@ button.disabled {
flex-grow: 1;
min-width: 320px;
max-width: 40%;

.eventHistory {
display: table;
width: 100%;
margin-left: 20px;

.event {
font-size: 16px;
display: table-row;
white-space: nowrap;

.label,
.datetime {
display: table-cell;
padding-bottom: 6px;
}

.label {
color: $grey-blue;
}

.datetime {
color: $gray-1;
}
}
}
}

.createdBy {
Expand Down
13 changes: 12 additions & 1 deletion src/components/Proposal/ProposalDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AccountPopup from "components/Account/AccountPopup";
import AccountProfileName from "components/Account/AccountProfileName";
import ProposalCountdown from "components/Shared/ProposalCountdown";
import FollowButton from "components/Shared/FollowButton";
import { humanProposalTitle, ensureHttps } from "lib/util";
import { humanProposalTitle, ensureHttps, formatFriendlyDateForLocalTimezone, safeMoment } from "lib/util";
import Analytics from "lib/analytics";
import { Page } from "pages";
import * as React from "react";
Expand Down Expand Up @@ -305,6 +305,17 @@ class ProposalDetailsPage extends React.Component<IProps, IState> {
</div>

</div>
<div className={css.eventHistory}>
<div className={css.event}>
<div className={css.label}>{i18next.t("Created")}:</div>
<div className={css.datetime}>{formatFriendlyDateForLocalTimezone(safeMoment(proposalState.createdAt))}</div>
</div>
{proposalState.executedAt ?
<div className={css.event}>
<div className={css.label}>{i18next.t("Executed")}:</div>
<div className={css.datetime}>{formatFriendlyDateForLocalTimezone(safeMoment(proposalState.executedAt))}</div>
</div> : ""}
</div>
</div>
</div>

Expand Down

0 comments on commit f4e53f5

Please sign in to comment.