2017-06-26 22:27:55 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import translate from 'translations';
|
2017-07-04 00:20:47 +00:00
|
|
|
import { donationAddressMap } from 'config/data';
|
2017-06-26 22:27:55 +00:00
|
|
|
|
|
|
|
export default class Donate extends React.Component {
|
2017-07-04 00:20:47 +00:00
|
|
|
props: {
|
|
|
|
onDonate: (address: string, amount: string, unit: string) => void
|
|
|
|
};
|
|
|
|
state: {
|
|
|
|
clicked: boolean
|
|
|
|
} = {
|
|
|
|
clicked: false
|
|
|
|
};
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className="well">
|
|
|
|
<p>
|
|
|
|
{translate('sidebar_donation')}
|
|
|
|
</p>
|
|
|
|
<a className="btn btn-primary btn-block" onClick={this.onClick}>
|
|
|
|
{translate('sidebar_donate')}
|
|
|
|
</a>
|
|
|
|
{this.state.clicked &&
|
|
|
|
<div className="text-success text-center marg-v-sm">
|
|
|
|
{translate('sidebar_thanks')}
|
|
|
|
</div>}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2017-06-26 22:27:55 +00:00
|
|
|
|
2017-07-04 00:20:47 +00:00
|
|
|
onClick = () => {
|
|
|
|
// FIXME move to config
|
|
|
|
this.props.onDonate(donationAddressMap.ETH, '1', 'ETH');
|
2017-06-26 22:27:55 +00:00
|
|
|
|
2017-07-04 00:20:47 +00:00
|
|
|
this.setState({ clicked: true });
|
|
|
|
};
|
2017-06-26 22:27:55 +00:00
|
|
|
}
|