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

46 lines
1.3 KiB
React
Raw Normal View History

// @flow
2019-06-11 20:10:58 +02:00
import React, { useEffect } 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';
type Props = {
2019-06-11 20:38:08 +02:00
uris: Array<string>,
2018-10-26 06:20:18 +02:00
checkPendingPublishes: () => void,
fetching: boolean,
};
2019-06-11 20:10:58 +02:00
function FileListPublished(props: Props) {
2019-06-11 20:38:08 +02:00
const { checkPendingPublishes, fetching, uris } = props;
2019-06-11 20:10:58 +02:00
useEffect(() => {
2018-10-26 06:20:18 +02:00
checkPendingPublishes();
2019-06-11 20:10:58 +02:00
}, [checkPendingPublishes]);
2019-06-11 20:10:58 +02:00
return (
2019-06-11 20:38:08 +02:00
<Page notContained>
{uris && uris.length ? (
2019-06-11 20:10:58 +02:00
<div className="card">
2019-06-11 20:38:08 +02:00
<FileList loading={fetching} persistedStorageKey="file-list-published" uris={uris} />
2019-06-11 20:10:58 +02:00
</div>
) : (
<div className="main--empty">
<section className="card card--section">
<header className="card__header">
<h2 className="card__title">{__("It looks like you haven't published anything to LBRY yet.")}</h2>
</header>
2019-06-11 20:10:58 +02:00
<div className="card__content">
<div className="card__actions card__actions--center">
<Button button="primary" navigate="/$/publish" label={__('Publish something new')} />
</div>
2019-06-11 20:10:58 +02:00
</div>
</section>
</div>
)}
</Page>
);
2017-05-01 08:26:09 +02:00
}
2017-06-06 06:21:55 +02:00
export default FileListPublished;