only shows yt component if user has yt channels

This commit is contained in:
jessop 2019-09-18 14:02:48 -04:00 committed by Sean Yesmunt
parent a8daecacf6
commit 8bc28ec910
2 changed files with 30 additions and 18 deletions

View file

@ -1,7 +1,10 @@
import { connect } from 'react-redux';
import AccountPage from './view';
import { selectYoutubeChannels } from 'lbryinc';
const select = state => ({});
const select = state => ({
ytChannels: selectYoutubeChannels(state),
});
export default connect(
select,

View file

@ -1,3 +1,4 @@
// @flow
import React from 'react';
import classnames from 'classnames';
import RewardSummary from 'component/rewardSummary';
@ -8,24 +9,32 @@ import UserEmail from 'component/userEmail';
import InvitePage from 'page/invite';
import YoutubeChannelList from 'component/youtubeChannelList';
const AccountPage = () => (
<Page>
{/* @if TARGET='web' */}
<UserEmail />
{/* @endif */}
<UnsupportedOnWeb />
<div className={classnames({ 'card--disabled': IS_WEB })}>
<div className="columns">
<UserEmail />
<div>
<RewardSummary />
<RewardTotal />
type Props = {
ytChannels: Array<any>,
};
const AccountPage = (props: Props) => {
const { ytChannels } = props;
const hasYoutubeChannels = Boolean(ytChannels.length);
return (
<Page>
{/* @if TARGET='web' */}
<UserEmail />
{/* @endif */}
<UnsupportedOnWeb />
<div className={classnames({ 'card--disabled': IS_WEB })}>
<div className="columns">
<UserEmail />
<div>
<RewardSummary />
<RewardTotal />
</div>
</div>
{hasYoutubeChannels && <YoutubeChannelList />}
<InvitePage />
</div>
<YoutubeChannelList />
<InvitePage />
</div>
</Page>
);
</Page>
);
};
export default AccountPage;