import React from "react"; import lbryuri from "lbryuri"; import { BusyMessage } from "component/common"; import FileTile from "component/fileTile"; import ReactPaginate from "react-paginate"; class ChannelPage extends React.PureComponent { componentDidMount() { const { uri, page, fetchClaims, fetchClaimCount } = this.props; fetchClaims(uri, page || 1); fetchClaimCount(uri); } componentWillReceiveProps(nextProps) { const { page, uri, fetching, fetchClaims, fetchClaimCount } = this.props; if (nextProps.page && page !== nextProps.page) { fetchClaims(nextProps.uri, nextProps.page); } if (nextProps.uri != uri) { fetchClaimCount(uri); } } changePage(pageNumber) { const { params } = this.props; const newParams = Object.assign({}, params, { page: pageNumber }); this.props.navigate("/show", newParams); } render() { const { fetching, claimsInChannel, claim, uri, page, totalPages, } = this.props; let contentList; if (fetching) { contentList = ; } else { contentList = claimsInChannel && claimsInChannel.length ? claimsInChannel.map(claim => ) : {__("No content found.")}; } return (

{uri}

{__( "Channel pages are empty for all publishers currently, but will be coming in a future update." )}

{__("Published Content")}

{contentList}
{(!fetching || (claimsInChannel && claimsInChannel.length)) && totalPages > 1 && this.changePage(e.selected + 1)} initialPage={parseInt(page - 1)} containerClassName="pagination" />}
); } } export default ChannelPage;