Skip to content
Snippets Groups Projects
Commit 57f61ac4 authored by NGUYEN DINH Quoc-Huy's avatar NGUYEN DINH Quoc-Huy
Browse files

Differenciate between disabled and not producing

parent a2294f84
No related branches found
No related tags found
2 merge requests!11merge autoclave into master,!7Refresh Witnesses page design
...@@ -256,8 +256,7 @@ class Witnesses extends React.Component { ...@@ -256,8 +256,7 @@ class Witnesses extends React.Component {
const sbdExchangeRate = item.get('sbd_exchange_rate'); const sbdExchangeRate = item.get('sbd_exchange_rate');
const sbdExchangeUpdateDate = item.get('last_sbd_exchange_update'); const sbdExchangeUpdateDate = item.get('last_sbd_exchange_update');
const noBlock7days = (head_block - lastBlock) * 3 > 604800; const noBlock7days = (head_block - lastBlock) * 3 > 604800;
const isDisabled = const isDisabled = signingKey == DISABLED_SIGNING_KEY;
signingKey == DISABLED_SIGNING_KEY || noBlock7days;
const votingActive = witnessVotesInProgress.has(owner); const votingActive = witnessVotesInProgress.has(owner);
const classUp = const classUp =
'Voting__button Voting__button-up' + 'Voting__button Voting__button-up' +
...@@ -328,7 +327,13 @@ class Witnesses extends React.Component { ...@@ -328,7 +327,13 @@ class Witnesses extends React.Component {
</td> </td>
<td className="Witnesses__info"> <td className="Witnesses__info">
<Link to={'/@' + owner} style={ownerStyle}> <Link to={'/@' + owner} style={ownerStyle}>
<Userpic account={owner} size="small" /> <Userpic
account={owner}
size="small"
className={classnames({
disabled: isDisabled,
})}
/>
</Link> </Link>
<div className="Witnesses__info"> <div className="Witnesses__info">
<div> <div>
...@@ -353,30 +358,55 @@ class Witnesses extends React.Component { ...@@ -353,30 +358,55 @@ class Witnesses extends React.Component {
</div> </div>
<div> <div>
<small> <small>
{witnessDescription && ( {noBlock7days && (
<div className="Witnesses__description"> <div>
{witnessDescription} <strong>
<span
role="img"
aria-label={tt(
'witnesses_jsx.not_produced_over_a_week'
)}
>
⚠️
</span>
{tt(
'witnesses_jsx.not_produced_over_a_week'
)}
</strong>
</div>
)}
<div>
{witnessDescription && (
<div className="Witnesses__description">
{witnessDescription}
</div>
)}
{tt('witnesses_jsx.last_block')}{' '}
<Link
to={`https://hiveblocks.com/b/${lastBlock}`}
target="_blank"
>
#{lastBlock}
</Link>{' '}
{_blockGap(head_block, lastBlock)} on v{
runningVersion
}
</div>
{isDisabled && (
<div>
{`${tt(
'witnesses_jsx.disabled'
)} ${_blockGap(
head_block,
lastBlock
)}`}
</div> </div>
)} )}
Produced block{' '}
<Link
to={`https://hiveblocks.com/b/${lastBlock}`}
target="_blank"
>
#{lastBlock}
</Link>{' '}
{_blockGap(head_block, lastBlock)} on v{
runningVersion
}
<br />
{isDisabled &&
`, ${tt(
'witnesses_jsx.disabled'
)} ${_blockGap(head_block, lastBlock)}`}
{!isDisabled && ( {!isDisabled && (
<div> <div>
{tt('witnesses_jsx.witness_age')}:{' '} {`${tt(
{witnessAge} 'witnesses_jsx.witness_age'
)}: ${witnessAge}`}
</div> </div>
)} )}
</small> </small>
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
@media only screen and (max-width: 779px) { @media only screen and (max-width: 779px) {
display: none; display: none;
} }
}
td.Witnesses__info .Userpic.disabled {
opacity: 0.4;
} }
.button { .button {
background-color: $color-text-hive-red; background-color: $color-text-hive-red;
......
...@@ -481,7 +481,7 @@ ...@@ -481,7 +481,7 @@
"witnesses_jsx": { "witnesses_jsx": {
"witness_thread": "Open witness annoucement", "witness_thread": "Open witness annoucement",
"external_site": "Open external site", "external_site": "Open external site",
"disabled": "disabled", "disabled": "Disabled",
"top_witnesses": "Witness Voting", "top_witnesses": "Witness Voting",
"you_have_votes_remaining": { "you_have_votes_remaining": {
"zero": "You have no votes remaining", "zero": "You have no votes remaining",
...@@ -505,7 +505,10 @@ ...@@ -505,7 +505,10 @@
"missed_blocks": "Missed blocks", "missed_blocks": "Missed blocks",
"votes_received": "Votes received", "votes_received": "Votes received",
"hp_required_to_rank_up": "Needs %(votehp)s to level up", "hp_required_to_rank_up": "Needs %(votehp)s to level up",
"witness_age": "Witness age" "witness_age": "Witness age",
"not_produced_over_a_week":
"Has not produced any blocks for over a week.",
"last_block": "Last block"
}, },
"votesandcomments_jsx": { "votesandcomments_jsx": {
"no_responses_yet_click_to_respond": "no_responses_yet_click_to_respond":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment