Skip to content

Instantly share code, notes, and snippets.

@pmaojo
Created October 11, 2016 22:59
Show Gist options
  • Save pmaojo/3a4098595d5cbe422f96dd7176f4a9f5 to your computer and use it in GitHub Desktop.
Save pmaojo/3a4098595d5cbe422f96dd7176f4a9f5 to your computer and use it in GitHub Desktop.
import React, { PropTypes } from 'react';
import BaseComponent from 'libs/components/BaseComponent';
import CommentBox from '../CommentBox/CommentBox';
import css from './CommentScreen.scss';
export default class CommentScreen extends BaseComponent {
static propTypes = {
actions: PropTypes.object.isRequired,
data: PropTypes.object.isRequired,
locationState: PropTypes.object,
};
renderNotification() {
const { locationState } = this.props;
if (!locationState || !locationState.redirectFrom) return null;
return (
<div className={`bg-success ${css.notification}`}>
U been redirected from <strong>{locationState.redirectFrom}</strong>
</div> );
}
render() {
const { data, actions } = this.props;
return (
<div>
{this.renderNotification()}
<div>
<CommentBox
pollInterval={60000}
data={data}
actions={actions}
ajaxCounter={data.get('ajaxCounter')} />
</div>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment