2016-06-16 11:34:13 +09:00
|
|
|
|
/*
|
|
|
|
|
The original Newsletter components is defined using an
|
|
|
|
|
ES6 class, so we use the "class foo extends bar" syntax
|
|
|
|
|
to extend it. This way, we can simply redefine the
|
|
|
|
|
render method to change it, while preserving
|
|
|
|
|
all of the class's other methods (other render
|
|
|
|
|
functions, event handlers, etc.).
|
|
|
|
|
*/
|
|
|
|
|
|
2016-08-08 11:18:21 +09:00
|
|
|
|
import Telescope from 'meteor/nova:lib';
|
2016-06-16 11:34:13 +09:00
|
|
|
|
import React, { PropTypes, Component } from 'react';
|
2016-06-19 16:25:19 +09:00
|
|
|
|
import { FormattedMessage, intlShape } from 'react-intl';
|
2016-06-16 11:34:13 +09:00
|
|
|
|
|
|
|
|
|
class CustomNewsletter extends Telescope.components.Newsletter {
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
|
2016-06-19 16:25:19 +09:00
|
|
|
|
return this.state.showBanner
|
|
|
|
|
? (
|
2016-06-16 11:34:13 +09:00
|
|
|
|
<div className="newsletter">
|
2016-06-19 16:25:19 +09:00
|
|
|
|
<h4 className="newsletter-tagline">✉️<FormattedMessage id="newsletter.subscribe_prompt"/>✉️</h4>
|
2016-06-16 11:34:13 +09:00
|
|
|
|
{this.context.currentUser ? this.renderButton() : this.renderForm()}
|
2016-06-19 16:25:19 +09:00
|
|
|
|
<a onClick={this.dismissBanner} className="newsletter-close"><Telescope.components.Icon name="close"/></a>
|
2016-06-16 11:34:13 +09:00
|
|
|
|
</div>
|
2016-06-19 16:25:19 +09:00
|
|
|
|
) : null;
|
2016-06-16 11:34:13 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default CustomNewsletter;
|