2018-04-04 18:08:27 +02:00
|
|
|
// @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';
|
2019-06-19 07:05:43 +02:00
|
|
|
import ClaimList from 'component/claimList';
|
2018-03-26 23:32:43 +02:00
|
|
|
import Page from 'component/page';
|
2017-04-23 18:10:45 +02:00
|
|
|
|
2018-04-04 18:08:27 +02:00
|
|
|
type Props = {
|
2019-06-11 20:38:08 +02:00
|
|
|
uris: Array<string>,
|
2018-10-26 06:20:18 +02:00
|
|
|
checkPendingPublishes: () => void,
|
2018-06-13 23:07:06 +02:00
|
|
|
fetching: boolean,
|
2018-04-04 18:08:27 +02:00
|
|
|
};
|
|
|
|
|
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]);
|
2017-04-23 18:10:45 +02:00
|
|
|
|
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-19 07:05:43 +02:00
|
|
|
<ClaimList loading={fetching} persistedStorageKey="claim-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>
|
2018-12-19 06:44:53 +01:00
|
|
|
|
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')} />
|
2018-12-19 06:44:53 +01:00
|
|
|
</div>
|
2019-06-11 20:10:58 +02:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</Page>
|
|
|
|
);
|
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;
|