lbry-desktop/src/ui/page/fileListPublished/view.jsx

48 lines
1.4 KiB
React
Raw Normal View History

// @flow
import React from 'react';
2018-03-26 23:32:43 +02:00
import Button from 'component/button';
import FileList from 'component/fileList';
2018-03-26 23:32:43 +02:00
import Page from 'component/page';
2018-10-23 04:02:19 +02:00
import { PAGES } from 'lbry-redux';
type Props = {
2019-04-24 16:02:08 +02:00
claims: Array<StreamClaim>,
2018-10-26 06:20:18 +02:00
checkPendingPublishes: () => void,
fetching: boolean,
2018-10-23 04:02:19 +02:00
sortBy: string,
};
class FileListPublished extends React.PureComponent<Props> {
2018-03-26 23:32:43 +02:00
componentDidMount() {
2018-10-26 06:20:18 +02:00
const { checkPendingPublishes } = this.props;
checkPendingPublishes();
2017-05-01 08:26:09 +02:00
}
2017-05-01 08:26:09 +02:00
render() {
2019-03-28 17:53:13 +01:00
const { fetching, claims, sortBy } = this.props;
return (
2018-06-19 20:22:13 +02:00
<Page notContained loading={fetching}>
{claims && claims.length ? (
2019-05-07 04:35:04 +02:00
<FileList checkPending fileInfos={claims} sortByHeight sortBy={sortBy} page={PAGES.PUBLISHED} />
2018-03-26 23:32:43 +02:00
) : (
<div className="main--empty">
<section className="card card--section">
<header className="card__header">
2019-05-07 04:35:04 +02:00
<h2 className="card__title">{__("It looks like you haven't published anything to LBRY yet.")}</h2>
</header>
<div className="card__content">
<div className="card__actions card__actions--center">
2019-05-07 04:35:04 +02:00
<Button button="primary" navigate="/$/publish" label={__('Publish something new')} />
</div>
</div>
</section>
2018-03-26 23:32:43 +02:00
</div>
)}
</Page>
2017-06-06 23:19:12 +02:00
);
2017-05-01 08:26:09 +02:00
}
}
2017-06-06 06:21:55 +02:00
export default FileListPublished;