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

40 lines
1.1 KiB
React
Raw Normal View History

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';
2017-06-08 06:42:19 +02:00
class FileListPublished extends React.PureComponent {
2018-03-26 23:32:43 +02:00
componentDidMount() {
const { pendingPublishes, checkIfPublishesConfirmed } = this.props;
if (pendingPublishes.length) {
checkIfPublishesConfirmed(pendingPublishes);
}
2017-05-01 08:26:09 +02:00
}
2017-05-01 08:26:09 +02:00
render() {
2018-03-26 23:32:43 +02:00
const { claims, pendingPublishes, navigate } = this.props;
const fileInfos = [...pendingPublishes, ...claims];
return (
2018-03-26 23:32:43 +02:00
<Page notContained>
{fileInfos.length ? (
<FileList fileInfos={fileInfos} sortByHeight />
) : (
<div className="page__empty">
{__("It looks like you haven't published anything to LBRY yet.")}
<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-06-06 06:21:55 +02:00
export default FileListPublished;