import React from 'react'; import AssetPreview from 'components/AssetPreview'; import request from 'utils/request'; class ChannelClaimsDisplay extends React.Component { constructor (props) { super(props); this.state = { error: null, }; this.showNextResultsPage = this.showNextResultsPage.bind(this); this.showPreviousResultsPage = this.showPreviousResultsPage.bind(this); } componentDidMount () { const name = this.props.name; const longId = this.props.longId; this.updateClaimsData(name, longId, 1); } componentWillReceiveProps (nextProps) { if (nextProps.name !== this.props.name || nextProps.longId !== this.props.longId) { this.updateClaimsData(nextProps.name, nextProps.longId, 1); } } updateClaimsData (name, longId, page) { console.log('this function has been moved into the redux sagas'); } componentWillUnmount () { this.props.onChannelClaimsDataClear(); } showPreviousResultsPage () { const previousPage = parseInt(this.props.currentPage) - 1; this.updateClaimsData(this.props.name, this.props.longId, previousPage); } showNextResultsPage () { const nextPage = parseInt(this.props.currentPage) + 1; this.updateClaimsData(this.props.name, this.props.longId, nextPage); } render () { return (
{this.state.error ? (

{this.state.error}

) : (
{this.props.claims &&
{this.props.claims.map((claim, index) => )}
{(this.props.currentPage > 1) && } {(this.props.currentPage < this.props.totalPages) && }
}
)}
); } }; export default ChannelClaimsDisplay;