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

53 lines
1.5 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';
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';
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-28 09:33:07 +02:00
<ClaimList
header={<h1>{__('Your Publishes')}</h1>}
loading={fetching}
persistedStorageKey="claim-list-published"
uris={uris}
defaultSort
headerAltControls={<Button button="link" label={__('New Publish')} navigate="/$/publish" />}
/>
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;