diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-03-09 08:52:32 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-03-10 10:14:33 +0100 |
commit | 887d56aa8a4ed7c61bb8259ee2bc82016403b579 (patch) | |
tree | f507fe92c7cdb599c7eee6ee40875923c7c892ac /app/javascript/flavours/glitch/components/admin | |
parent | 24e83246f9efaa57ff025a606795ab8bc21a42df (diff) |
[Glitch] Change design of federation pages in admin UI
Port front-end changes from 29ee3c61a3d3ec98335052b579d956a518d1ac94 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/components/admin')
-rw-r--r-- | app/javascript/flavours/glitch/components/admin/Counter.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/components/admin/Counter.js b/app/javascript/flavours/glitch/components/admin/Counter.js index 2bc9ce482..ecb242950 100644 --- a/app/javascript/flavours/glitch/components/admin/Counter.js +++ b/app/javascript/flavours/glitch/components/admin/Counter.js @@ -68,12 +68,12 @@ export default class Counter extends React.PureComponent { ); } else { const measure = data[0]; - const percentChange = percIncrease(measure.previous_total * 1, measure.total * 1); + const percentChange = measure.previous_total && percIncrease(measure.previous_total * 1, measure.total * 1); content = ( <React.Fragment> - <span className='sparkline__value__total'><FormattedNumber value={measure.total} /></span> - <span className={classNames('sparkline__value__change', { positive: percentChange > 0, negative: percentChange < 0 })}>{percentChange > 0 && '+'}<FormattedNumber value={percentChange} style='percent' /></span> + <span className='sparkline__value__total'>{measure.human_value || <FormattedNumber value={measure.total} />}</span> + {measure.previous_total && (<span className={classNames('sparkline__value__change', { positive: percentChange > 0, negative: percentChange < 0 })}>{percentChange > 0 && '+'}<FormattedNumber value={percentChange} style='percent' /></span>)} </React.Fragment> ); } |