lbry-desktop/ui/js/page/channel/view.jsx

50 lines
1.1 KiB
React
Raw Normal View History

2017-05-04 05:44:08 +02:00
import React from 'react';
import lbryuri from 'lbryuri'
2017-05-04 05:44:08 +02:00
2017-05-13 00:50:51 +02:00
class ChannelPage extends React.Component{
componentDidMount() {
this.fetchClaims(this.props)
}
2017-05-04 05:44:08 +02:00
2017-05-13 00:50:51 +02:00
componentWillReceiveProps(nextProps) {
this.fetchClaims(nextProps)
}
fetchClaims(props) {
if (props.claimsInChannel === undefined) {
2017-05-13 00:50:51 +02:00
props.fetchClaims(props.uri)
}
}
render() {
const {
claimsInChannel,
2017-05-13 00:50:51 +02:00
claim,
uri
} = this.props
console.log(claimsInChannel);
2017-05-13 00:50:51 +02:00
return <main className="main--single-column">
<section className="card">
<div className="card__inner">
<div className="card__title-identity"><h1>{uri}</h1></div>
</div>
<div className="card__content">
<p>
This channel page is a stub.
</p>
</div>
</section>
<section className="card">
<div className="card__content">
{claimsInChannel ?
claimsInChannel.map((claim) => <FileTile uri={lbryuri.build({name: claim.name, claimId: claim.claim_id})} /> )
: ''}
2017-05-13 00:50:51 +02:00
</div>
</section>
</main>
}
2017-05-04 05:44:08 +02:00
}
export default ChannelPage;