2018-06-13 23:07:06 +02:00
|
|
|
// @flow
|
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-06-13 23:07:06 +02:00
|
|
|
type Props = {
|
|
|
|
fetching: boolean,
|
|
|
|
fileInfos: {},
|
2018-10-23 04:02:19 +02:00
|
|
|
sortBy: string,
|
2018-06-13 23:07:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class FileListDownloaded extends React.PureComponent<Props> {
|
2017-04-25 07:47:21 +02:00
|
|
|
render() {
|
2019-03-28 17:53:13 +01:00
|
|
|
const { fetching, fileInfos, sortBy } = this.props;
|
2018-06-19 20:22:13 +02:00
|
|
|
const hasDownloads = fileInfos && Object.values(fileInfos).length > 0;
|
2017-05-05 10:10:51 +02:00
|
|
|
|
|
|
|
return (
|
2019-04-01 01:04:01 +02:00
|
|
|
// Removed the <Page> wapper to try combining this page with UserHistory
|
|
|
|
// This should eventually move into /components if we want to keep it this way
|
|
|
|
<React.Fragment>
|
2018-06-19 20:22:13 +02:00
|
|
|
{hasDownloads ? (
|
2018-10-23 04:02:19 +02:00
|
|
|
<FileList fileInfos={fileInfos} sortBy={sortBy} page={PAGES.DOWNLOADED} />
|
2018-03-26 23:32:43 +02:00
|
|
|
) : (
|
2019-04-18 18:51:15 +02:00
|
|
|
<div className="main--empty">
|
2018-12-19 06:44:53 +01:00
|
|
|
<section className="card card--section">
|
|
|
|
<header className="card__header">
|
2019-05-07 23:38:29 +02:00
|
|
|
<h2 className="card__title">{__("You haven't downloaded anything from LBRY yet.")}</h2>
|
2018-12-19 06:44:53 +01:00
|
|
|
</header>
|
|
|
|
|
|
|
|
<div className="card__content">
|
|
|
|
<div className="card__actions card__actions--center">
|
2019-03-28 17:53:13 +01:00
|
|
|
<Button button="primary" navigate="/" label={__('Explore new content')} />
|
2018-12-19 06:44:53 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
2018-03-26 23:32:43 +02:00
|
|
|
</div>
|
|
|
|
)}
|
2019-04-01 01:04:01 +02:00
|
|
|
</React.Fragment>
|
2017-06-06 23:19:12 +02:00
|
|
|
);
|
2017-04-25 07:47:21 +02:00
|
|
|
}
|
2017-04-23 18:10:45 +02:00
|
|
|
}
|
|
|
|
|
2017-06-06 06:21:55 +02:00
|
|
|
export default FileListDownloaded;
|