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

50 lines
1.4 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-04-24 16:02:08 +02:00
claims: Array<StreamClaim>,
2018-10-26 06:20:18 +02:00
checkPendingPublishes: () => void,
fetching: boolean,
};
2019-06-11 20:10:58 +02:00
function FileListPublished(props: Props) {
const { checkPendingPublishes, fetching, claims } = props;
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 (
<Page notContained loading={fetching}>
{claims && claims.length ? (
<div className="card">
<FileList
persistedStorageKey="file-list-published"
// TODO: adjust selector to only return uris
uris={claims.map(info => `lbry://${info.name}#${info.claim_id}`)}
/>
</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;