CryptoDonate: add explanation box to donation page
This commit is contained in:
parent
7525713460
commit
8a2d436d31
2 changed files with 36 additions and 3 deletions
|
@ -1,15 +1,21 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { defineMessages, injectIntl } from 'react-intl';
|
import { connect } from 'react-redux';
|
||||||
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
import Column from '../ui/components/column';
|
import Column from '../ui/components/column';
|
||||||
|
import Accordion from 'soapbox/features/ui/components/accordion';
|
||||||
import SiteWallet from './components/site_wallet';
|
import SiteWallet from './components/site_wallet';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
heading: { id: 'column.crypto_donate', defaultMessage: 'Donate Cryptocurrency' },
|
heading: { id: 'column.crypto_donate', defaultMessage: 'Donate Cryptocurrency' },
|
||||||
});
|
});
|
||||||
|
|
||||||
export default
|
const mapStateToProps = state => ({
|
||||||
|
siteTitle: state.getIn(['instance', 'title']),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default @connect(mapStateToProps)
|
||||||
@injectIntl
|
@injectIntl
|
||||||
class CryptoDonate extends ImmutablePureComponent {
|
class CryptoDonate extends ImmutablePureComponent {
|
||||||
|
|
||||||
|
@ -17,12 +23,35 @@ class CryptoDonate extends ImmutablePureComponent {
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
state = {
|
||||||
|
explanationBoxExpanded: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleExplanationBox = (setting) => {
|
||||||
|
this.setState({ explanationBoxExpanded: setting });
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { intl } = this.props;
|
const { intl, siteTitle } = this.props;
|
||||||
|
const { explanationBoxExpanded } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column icon='bitcoin' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
<Column icon='bitcoin' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||||
<div className='crypto-donate'>
|
<div className='crypto-donate'>
|
||||||
|
<div className='explanation-box'>
|
||||||
|
<Accordion
|
||||||
|
headline={<FormattedMessage id='crypto_donate.explanation_box.title' defaultMessage='Sending cryptocurrency donations' />}
|
||||||
|
expanded={explanationBoxExpanded}
|
||||||
|
onToggle={this.toggleExplanationBox}
|
||||||
|
>
|
||||||
|
<FormattedMessage
|
||||||
|
id='crypto_donate.explanation_box.message'
|
||||||
|
defaultMessage='{siteTitle} accepts cryptocurrency donations. You may send a donation to any of the addresses below. Thank you for your support!'
|
||||||
|
values={{ siteTitle }}
|
||||||
|
/>
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
|
</div>
|
||||||
<SiteWallet />
|
<SiteWallet />
|
||||||
</div>
|
</div>
|
||||||
</Column>
|
</Column>
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
.crypto-donate {
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.crypto-address {
|
.crypto-address {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
Loading…
Reference in a new issue