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 { connect } from 'react-redux';
import AccountPage from './view'; import AccountPage from './view';
import { selectYoutubeChannels } from 'lbryinc';
const select = state => ({}); const select = state => ({
ytChannels: selectYoutubeChannels(state),
});
export default connect( export default connect(
select, select,

View file

@ -1,3 +1,4 @@
// @flow
import React from 'react'; import React from 'react';
import classnames from 'classnames'; import classnames from 'classnames';
import RewardSummary from 'component/rewardSummary'; import RewardSummary from 'component/rewardSummary';
@ -8,7 +9,14 @@ import UserEmail from 'component/userEmail';
import InvitePage from 'page/invite'; import InvitePage from 'page/invite';
import YoutubeChannelList from 'component/youtubeChannelList'; import YoutubeChannelList from 'component/youtubeChannelList';
const AccountPage = () => ( type Props = {
ytChannels: Array<any>,
};
const AccountPage = (props: Props) => {
const { ytChannels } = props;
const hasYoutubeChannels = Boolean(ytChannels.length);
return (
<Page> <Page>
{/* @if TARGET='web' */} {/* @if TARGET='web' */}
<UserEmail /> <UserEmail />
@ -22,10 +30,11 @@ const AccountPage = () => (
<RewardTotal /> <RewardTotal />
</div> </div>
</div> </div>
<YoutubeChannelList /> {hasYoutubeChannels && <YoutubeChannelList />}
<InvitePage /> <InvitePage />
</div> </div>
</Page> </Page>
); );
};
export default AccountPage; export default AccountPage;