lbry-desktop/ui/page/creatorDashboard/view.jsx

40 lines
1.2 KiB
React
Raw Normal View History

2020-03-18 18:11:37 +01:00
// @flow
import React from 'react';
import Page from 'component/page';
import Spinner from 'component/spinner';
2020-03-18 22:14:11 +01:00
import Button from 'component/button';
import CreatorAnalytics from 'component/creatorAnalytics';
2020-03-18 18:11:37 +01:00
type Props = {
channels: Array<ChannelClaim>,
2020-03-18 22:14:11 +01:00
fetchingChannels: boolean,
openChannelCreateModal: () => void,
2020-03-18 18:11:37 +01:00
};
export default function CreatorDashboardPage(props: Props) {
2020-03-18 22:14:11 +01:00
const { channels, fetchingChannels, openChannelCreateModal } = props;
2020-03-18 18:11:37 +01:00
return (
<Page>
2020-03-18 22:14:11 +01:00
{fetchingChannels && (
2020-03-18 18:11:37 +01:00
<div className="main--empty">
<Spinner delayed />
</div>
)}
2020-03-18 22:14:11 +01:00
{!fetchingChannels && (!channels || !channels.length) && (
<section className="main--empty">
<div className=" section--small">
<h2 className="section__title--large">{__("You haven't created a channel yet, let's fix that!")}</h2>
<div className="section__actions">
<Button button="primary" onClick={openChannelCreateModal} label={__('Create A Channel')} />
</div>
</div>
</section>
2020-03-18 18:11:37 +01:00
)}
2020-03-18 22:14:11 +01:00
{!fetchingChannels && channels && channels.length && <CreatorAnalytics />}
2020-03-18 18:11:37 +01:00
</Page>
);
}