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

29 lines
1.0 KiB
JavaScript
Raw Normal View History

2020-01-21 21:07:58 +00:00
import React from 'react';
import { monthlyExpensesComplete } from '../../../initial_state';
export default class ProgressPanel extends React.PureComponent {
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>
)
}
}