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,24 +9,32 @@ 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 = {
<Page> ytChannels: Array<any>,
{/* @if TARGET='web' */} };
<UserEmail />
{/* @endif */} const AccountPage = (props: Props) => {
<UnsupportedOnWeb /> const { ytChannels } = props;
<div className={classnames({ 'card--disabled': IS_WEB })}> const hasYoutubeChannels = Boolean(ytChannels.length);
<div className="columns"> return (
<UserEmail /> <Page>
<div> {/* @if TARGET='web' */}
<RewardSummary /> <UserEmail />
<RewardTotal /> {/* @endif */}
<UnsupportedOnWeb />
<div className={classnames({ 'card--disabled': IS_WEB })}>
<div className="columns">
<UserEmail />
<div>
<RewardSummary />
<RewardTotal />
</div>
</div> </div>
{hasYoutubeChannels && <YoutubeChannelList />}
<InvitePage />
</div> </div>
<YoutubeChannelList /> </Page>
<InvitePage /> );
</div> };
</Page>
);
export default AccountPage; export default AccountPage;