Commit c7253b35 authored by Dan Notestein's avatar Dan Notestein
Browse files

Merge branch '96-proposals-are-mostly-showing-up-as-burn' into 'develop'

Fix proposal funding type badge

Closes condenser#96

See merge request !75
parents c5d7bff4 0ab8d21a
......@@ -38,6 +38,7 @@ export const ALLOWED_CURRENCIES = ['USD'];
export const FRACTION_DIGITS = 2; // default amount of decimal digits
export const FRACTION_DIGITS_MARKET = 3; // accurate amount of deciaml digits (example: used in market)
export const REFUND_ACCOUNTS = ['steem.dao', 'hive.fund'];
export const BURN_ACCOUNTS = ['null'];
// meta info
export const TWITTER_HANDLE = '@hiveblocks';
export const SHARE_IMAGE =
......
......@@ -7,12 +7,20 @@ import tt from 'counterpart';
import cx from 'classnames';
import Userpic, { SIZE_SMALL } from 'app/components/elements/Userpic';
import { numberWithCommas } from 'app/utils/StateFunctions';
import { APP_URL, REFUND_ACCOUNTS } from 'app/client_config';
import { APP_URL, REFUND_ACCOUNTS, BURN_ACCOUNTS } from 'app/client_config';
import Icon from 'app/components/elements/Icon';
const numAbbr = new NumAbbr();
function getFundingType(account) {
if (REFUND_ACCOUNTS.includes(account)) return 'refund';
if (BURN_ACCOUNTS.includes(account)) return 'burn';
return null;
}
export function Proposal(props) {
const {
id,
......@@ -42,7 +50,8 @@ export function Proposal(props) {
total_vesting_shares,
total_vesting_fund_hive
);
const fundingType = REFUND_ACCOUNTS.includes(receiver) ? 'refund' : 'burn';
const fundingType = getFundingType(receiver);
const classUp = cx('Voting__button', 'Voting__button-up', {
'Voting__button--upvoted': isUpVoted,
......@@ -82,12 +91,18 @@ export function Proposal(props) {
>
{startedOrFinished(start, end)}
</span>
<span
className={cx('status', 'funding-type', fundingType)}
title={tt(`proposals.${fundingType}`)}
>
{tt(`proposals.${fundingType}`)}
</span>
{fundingType && (
<span
className={cx(
'status',
'funding-type',
fundingType
)}
title={tt(`proposals.${fundingType}`)}
>
{tt(`proposals.${fundingType}`)}
</span>
)}
</div>
<div className="proposals__row details">
<Userpic account={creator} size={SIZE_SMALL} />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment