gab-social/app/javascript/gabsocial/components/progress_panel/progress_panel.js

28 lines
1.0 KiB
JavaScript
Raw Normal View History

import { monthlyExpensesComplete } from '../../initial_state';
2020-01-21 21:07:58 +00:00
2020-01-29 21:54:39 +00:00
export default class ProgressPanel extends PureComponent {
2020-01-21 21:07:58 +00:00
render() {
if (!monthlyExpensesComplete) return null;
2020-01-21 21:13:52 +00:00
const completed = Math.min(monthlyExpensesComplete, 100);
2020-01-21 21:07:58 +00:00
const style = {
2020-01-21 21:13:52 +00:00
width: `${completed}%`,
2020-01-21 21:07:58 +00:00
};
return (
<div className='wtf-panel progress-panel'>
<div className='wtf-panel-header progress-panel-header'>
<div className='wtf-panel-header__label'>Gab's Operational Expenses</div>
</div>
<div className='wtf-panel__content progress-panel__content'>
<span className='progress-panel__text'>We are 100% funded by you.</span>
<div className='progress-panel__bar-container'>
<a className='progress-panel__bar' style={style} href='https://shop.dissenter.com/category/donations'>
2020-01-21 21:13:52 +00:00
<span className='progress-panel__bar__text'>{completed}% covered this month</span>
2020-01-21 21:07:58 +00:00
</a>
</div>
</div>
</div>
)
}
}