import React from "react"; import lbryuri from "lbryuri"; import { BusyMessage } from "component/common"; import FileTile from "component/fileTile"; import Link from "component/link"; import ReactPaginate from "react-paginate"; class ChannelPage extends React.PureComponent { componentDidMount() { const { uri, params, fetchClaims } = this.props; fetchClaims(uri, params.page || 1); } componentWillReceiveProps(nextProps) { const { params, fetching, fetchClaims } = this.props; const nextParams = nextProps.params; if (fetching !== nextParams.page && params.page !== nextParams.page) fetchClaims(nextProps.uri, nextParams.page); } changePage(pageNumber) { const { params, currentPage } = this.props; const newParams = Object.assign({}, params, { page: pageNumber }); this.props.navigate("/show", newParams); } render() { const { fetching, claimsInChannel, claim, uri, params, totalPages, } = this.props; const { page } = params; let contentList; if (claimsInChannel === undefined) { contentList = ; } else if (claimsInChannel) { contentList = 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;