import React from 'react'; import { Spin, Card, Row, Col, Dropdown, Button, Icon, Menu } from 'antd'; import { Charts } from 'ant-design-pro'; import { view } from 'react-easy-state'; import store from '../../store'; import Info from 'components/Info'; import { formatUsd } from '../../util/formatters'; import './index.less'; interface State { selectedYear: string; } class Financials extends React.Component<{}, State> { state: State = { selectedYear: '', }; async componentDidMount() { await store.fetchFinancials(); const years = Object.keys(store.financials.payoutsByQuarter); const selectedYear = years[years.length - 1]; this.setState({ selectedYear, }); } render() { const { selectedYear } = this.state; const { grants, payouts, payoutsByQuarter } = store.financials; if (!store.financialsFetched || !selectedYear) { return ; } const years = Object.keys(store.financials.payoutsByQuarter); const quarterData = payoutsByQuarter[this.state.selectedYear]; const payoutsByQuarterMenu = ( this.setState({ selectedYear: e.key })}> {years.map(year => ( {year} ))} ); return (

Milestone payouts.

due - payouts currently accepted but not paid
future - payouts that are not yet paid, but expected to be requested in the future
paid - total milestone payouts marked as paid, regardless of proposal status
} > Payouts } > ( )} data={[ { x: 'due', y: parseFloat(payouts.due) }, { x: 'future', y: parseFloat(payouts.future) }, { x: 'paid', y: parseFloat(payouts.paid) }, ]} valueFormat={val => ( )} height={180} />

Milestone payouts broken down by quarter. Use the dropdown to select a different year.

} > Payouts by Quarter
} > ( )} data={[ { x: 'Q1', y: parseFloat(quarterData.q1) }, { x: 'Q2', y: parseFloat(quarterData.q2) }, { x: 'Q3', y: parseFloat(quarterData.q3) }, { x: 'Q4', y: parseFloat(quarterData.q3) }, ]} valueFormat={val => ( )} height={180} /> ); } } export default view(Financials);