Skip to content

Commit

Permalink
Add current voting power to UserInfo (busyorg#927)
Browse files Browse the repository at this point in the history
* added current voting power to UserInfo

* use FomattedMessage and FormattedNumber to display current voting power
  • Loading branch information
mktcode authored and bonustrack committed Oct 29, 2017
1 parent 2ed1928 commit 740f022
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/Sidebar/UserInfo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { injectIntl, FormattedMessage } from 'react-intl';
import { injectIntl, FormattedMessage, FormattedNumber } from 'react-intl';
import _ from 'lodash';
import urlParse from 'url-parse';

Expand Down Expand Up @@ -57,6 +57,14 @@ const UserInfo = ({ intl, authenticated, authenticatedUser, user, ...props }) =>
}}
/>
</div>
<div>
<i className="iconfont icon-flashlight text-icon" />
<FormattedMessage id="voting_power" defaultMessage="Voting Power" />: <FormattedNumber
style="percent" // eslint-disable-line react/style-prop-object
value={user.voting_power / 10000}
maximumFractionDigits={0}
/>
</div>
</div>
</div>}
{(user && !isSameUser) && <Action
Expand Down

0 comments on commit 740f022

Please sign in to comment.