2018-04-04 18:08:27 +02:00
|
|
|
// @flow
|
2018-10-26 06:20:18 +02:00
|
|
|
import type { Claim } from 'types/claim';
|
2017-12-21 22:08:54 +01:00
|
|
|
import React from 'react';
|
2018-03-26 23:32:43 +02:00
|
|
|
import Button from 'component/button';
|
2017-12-21 22:08:54 +01:00
|
|
|
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';
|
2017-04-23 18:10:45 +02:00
|
|
|
|
2018-04-04 18:08:27 +02:00
|
|
|
type Props = {
|
2018-10-26 06:20:18 +02:00
|
|
|
claims: Array<Claim>,
|
|
|
|
checkPendingPublishes: () => void,
|
2018-04-04 18:08:27 +02:00
|
|
|
navigate: (string, ?{}) => void,
|
2018-06-13 23:07:06 +02:00
|
|
|
fetching: boolean,
|
2018-10-23 04:02:19 +02:00
|
|
|
sortBy: string,
|
2018-04-04 18:08:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
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-04-23 18:10:45 +02:00
|
|
|
|
2017-05-01 08:26:09 +02:00
|
|
|
render() {
|
2018-10-23 04:02:19 +02:00
|
|
|
const { fetching, claims, navigate, sortBy } = this.props;
|
2017-05-05 10:10:51 +02:00
|
|
|
return (
|
2018-06-19 20:22:13 +02:00
|
|
|
<Page notContained loading={fetching}>
|
|
|
|
{claims && claims.length ? (
|
2018-10-23 04:02:19 +02:00
|
|
|
<FileList
|
|
|
|
checkPending
|
|
|
|
fileInfos={claims}
|
|
|
|
sortByHeight
|
|
|
|
sortBy={sortBy}
|
|
|
|
page={PAGES.PUBLISHED}
|
|
|
|
/>
|
2018-03-26 23:32:43 +02:00
|
|
|
) : (
|
|
|
|
<div className="page__empty">
|
2018-10-19 22:38:07 +02:00
|
|
|
<h3 className="card__title">
|
|
|
|
{__("It looks like you haven't published anything to LBRY yet.")}
|
|
|
|
</h3>
|
2018-03-26 23:32:43 +02:00
|
|
|
<div className="card__actions card__actions--center">
|
|
|
|
<Button
|
|
|
|
button="primary"
|
|
|
|
onClick={() => navigate('/publish')}
|
|
|
|
label={__('Publish something new')}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</Page>
|
2017-06-06 23:19:12 +02:00
|
|
|
);
|
2017-05-01 08:26:09 +02:00
|
|
|
}
|
|
|
|
}
|
2017-04-23 18:10:45 +02:00
|
|
|
|
2017-06-06 06:21:55 +02:00
|
|
|
export default FileListPublished;
|