Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wallet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
wallet
Commits
6ff259cc
Commit
6ff259cc
authored
5 years ago
by
NGUYEN DINH Quoc-Huy
Browse files
Options
Downloads
Patches
Plain Diff
Display HP needed to rank up
parent
466ab7cd
No related branches found
No related tags found
2 merge requests
!11
merge autoclave into master
,
!7
Refresh Witnesses page design
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/components/pages/Witnesses.jsx
+29
-7
29 additions, 7 deletions
src/app/components/pages/Witnesses.jsx
src/app/locales/en.json
+2
-1
2 additions, 1 deletion
src/app/locales/en.json
with
31 additions
and
8 deletions
src/app/components/pages/Witnesses.jsx
+
29
−
7
View file @
6ff259cc
...
@@ -10,7 +10,7 @@ import Userpic from 'app/components/elements/Userpic';
...
@@ -10,7 +10,7 @@ import Userpic from 'app/components/elements/Userpic';
import
ByteBuffer
from
'
bytebuffer
'
;
import
ByteBuffer
from
'
bytebuffer
'
;
import
{
is
,
Set
,
List
}
from
'
immutable
'
;
import
{
is
,
Set
,
List
}
from
'
immutable
'
;
import
*
as
globalActions
from
'
app/redux/GlobalReducer
'
;
import
*
as
globalActions
from
'
app/redux/GlobalReducer
'
;
import
{
vestsToHp
,
numberWithCommas
}
from
'
app/utils/StateFunctions
'
;
import
{
vestsToHp
f
,
numberWithCommas
}
from
'
app/utils/StateFunctions
'
;
import
tt
from
'
counterpart
'
;
import
tt
from
'
counterpart
'
;
const
Long
=
ByteBuffer
.
Long
;
const
Long
=
ByteBuffer
.
Long
;
...
@@ -117,6 +117,7 @@ class Witnesses extends React.Component {
...
@@ -117,6 +117,7 @@ class Witnesses extends React.Component {
let
witness_vote_count
=
30
;
let
witness_vote_count
=
30
;
let
rank
=
1
;
let
rank
=
1
;
let
foundWitnessToHighlight
=
false
;
let
foundWitnessToHighlight
=
false
;
let
previousTotalVoteHpf
=
0
;
const
witnesses
=
sorted_witnesses
.
map
(
item
=>
{
const
witnesses
=
sorted_witnesses
.
map
(
item
=>
{
const
owner
=
item
.
get
(
'
owner
'
);
const
owner
=
item
.
get
(
'
owner
'
);
...
@@ -124,12 +125,29 @@ class Witnesses extends React.Component {
...
@@ -124,12 +125,29 @@ class Witnesses extends React.Component {
foundWitnessToHighlight
=
true
;
foundWitnessToHighlight
=
true
;
}
}
const
totalVotesVests
=
item
.
get
(
'
votes
'
);
const
totalVotesVests
=
item
.
get
(
'
votes
'
);
const
totalVotesHp
=
numberWithCommas
(
const
totalVotesHpf
=
vestsToHpf
(
vestsToHp
(
this
.
props
.
state
,
this
.
props
.
state
,
`
${
totalVotesVests
/
1000000
}
VESTS`
`
${
totalVotesVests
/
1000000
}
VESTS`
)
);
);
const
totalVotesHp
=
numberWithCommas
(
totalVotesHpf
.
toFixed
(
3
));
let
requiredHpToRankUp
=
''
;
if
(
previousTotalVoteHpf
!==
0
)
{
requiredHpToRankUp
=
(
<
small
>
{
tt
(
'
witnesses_jsx.hp_required_to_rank_up
'
,
{
votehp
:
numberWithCommas
(
(
previousTotalVoteHpf
-
totalVotesHpf
).
toFixed
(
3
)
),
})
}
</
small
>
);
}
previousTotalVoteHpf
=
totalVotesHpf
;
const
thread
=
item
.
get
(
'
url
'
).
replace
(
'
steemit.com
'
,
'
hive.blog
'
);
const
thread
=
item
.
get
(
'
url
'
).
replace
(
'
steemit.com
'
,
'
hive.blog
'
);
const
myVote
=
witness_votes
?
witness_votes
.
has
(
owner
)
:
null
;
const
myVote
=
witness_votes
?
witness_votes
.
has
(
owner
)
:
null
;
const
signingKey
=
item
.
get
(
'
signing_key
'
);
const
signingKey
=
item
.
get
(
'
signing_key
'
);
...
@@ -240,7 +258,11 @@ class Witnesses extends React.Component {
...
@@ -240,7 +258,11 @@ class Witnesses extends React.Component {
</
div
>
</
div
>
</
div
>
</
div
>
</
td
>
</
td
>
<
td
className
=
"Witnesses__votes"
>
{
`
${
totalVotesHp
}
HP`
}
</
td
>
<
td
className
=
"Witnesses__votes"
>
{
`
${
totalVotesHp
}
HP`
}
<
br
/>
{
requiredHpToRankUp
}
</
td
>
<
td
>
{
missedBlocks
}
blocks
</
td
>
<
td
>
{
missedBlocks
}
blocks
</
td
>
<
td
>
<
td
>
<
Link
<
Link
...
...
This diff is collapsed.
Click to expand it.
src/app/locales/en.json
+
2
−
1
View file @
6ff259cc
...
@@ -502,7 +502,8 @@
...
@@ -502,7 +502,8 @@
"last_block"
:
"Last block"
,
"last_block"
:
"Last block"
,
"running_version"
:
"Running version"
,
"running_version"
:
"Running version"
,
"received_hp_votes"
:
"Received %(votehp)s worth of votes"
,
"received_hp_votes"
:
"Received %(votehp)s worth of votes"
,
"votes_received"
:
"Votes received"
"votes_received"
:
"Votes received"
,
"hp_required_to_rank_up"
:
"Needs %(votehp)s to level up"
},
},
"votesandcomments_jsx"
:
{
"votesandcomments_jsx"
:
{
"no_responses_yet_click_to_respond"
:
"no_responses_yet_click_to_respond"
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment