Skip to content

Commit

Permalink
New proposal button is now disabled when a plugin is not activated yet (
Browse files Browse the repository at this point in the history
#2045)

* New proposal button is now disabled when a plugin is not activated yet ; Activation time added in tooltip

* message right on the page instead of a tootltip
  • Loading branch information
roienatan committed Aug 6, 2020
1 parent 19bdc5b commit e53dbf3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/assets/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
"Sort by": "Sort by:",
"Name": "Name",
"ETH Balance": "ETH Balance",
"Members": "Members"
"Members": "Members",
"Plugin activation time": "The plugin will be activated at"
}
20 changes: 13 additions & 7 deletions src/components/Plugin/Plugin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
.editPlugin,
.createProposal {
align-self: center;
display: flex;
align-items: center;

a {
padding: 8px 15px;
Expand All @@ -77,13 +79,17 @@
&:hover {
opacity: 0.8;
}

.disabled,
.disabled:hover {
background-color: $disabled-button-background-color;
border: $disabled-button-border;
cursor: not-allowed;
}
}
.disabled,
.disabled:hover {
background-color: $disabled-button-color;
border: $disabled-button-border;
cursor: not-allowed;
}
.activationTime {
font-size: $caption;
color: $gray-3;
margin-right: 10px;
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/Plugin/PluginContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import PluginProposalsPage from "./PluginProposalsPage";
import PluginOpenBountyPage from "./PluginOpenBountyPage";
import * as css from "./Plugin.scss";
import i18next from "i18next";
import moment = require("moment");
import { formatFriendlyDateForLocalTimezone } from "lib/util";

interface IDispatchProps {
showNotification: typeof showNotification;
Expand Down Expand Up @@ -223,6 +225,7 @@ class PluginContainer extends React.Component<IProps, IState> {
</div>
:
<div className={css.createProposal}>
{!isActive && <div className={css.activationTime}>{i18next.t("Plugin activation time")} {formatFriendlyDateForLocalTimezone(moment.unix((pluginState as any).pluginParams.voteParams.activationTime))}</div>}
<TrainingTooltip placement="topRight" overlay={i18next.t("New Proposal Button Tooltip")}>
<a className={
classNames({
Expand Down

0 comments on commit e53dbf3

Please sign in to comment.