Created
October 11, 2016 22:59
-
-
Save pmaojo/3a4098595d5cbe422f96dd7176f4a9f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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