mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-09-04 04:45:11 +00:00
only shows yt component if user has yt channels
This commit is contained in:
parent
a8daecacf6
commit
8bc28ec910
2 changed files with 30 additions and 18 deletions
|
@ -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,
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue