remove analytics

This commit is contained in:
saltrafael 2021-06-14 14:19:03 -03:00 committed by jessopb
parent 32d2ac2fc9
commit c92bcc945f
4 changed files with 7 additions and 33 deletions

View file

@ -1,11 +1,10 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { selectMyChannelClaims, makeSelectClaimForUri } from 'lbry-redux'; import { selectMyChannelClaims } from 'lbry-redux';
import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app'; import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
import { doSetActiveChannel, doSetIncognito } from 'redux/actions/app'; import { doSetActiveChannel, doSetIncognito } from 'redux/actions/app';
import SelectChannel from './view'; import SelectChannel from './view';
const select = (state, props) => ({ const select = state => ({
claim: makeSelectClaimForUri(props.uri)(state),
channels: selectMyChannelClaims(state), channels: selectMyChannelClaims(state),
activeChannelClaim: selectActiveChannelClaim(state), activeChannelClaim: selectActiveChannelClaim(state),
incognito: selectIncognito(state), incognito: selectIncognito(state),

View file

@ -10,8 +10,6 @@ import Icon from 'component/common/icon';
import { useHistory } from 'react-router'; import { useHistory } from 'react-router';
type Props = { type Props = {
uri: string,
claim: ?Claim,
selectedChannelUrl: string, // currently selected channel selectedChannelUrl: string, // currently selected channel
channels: ?Array<ChannelClaim>, channels: ?Array<ChannelClaim>,
onChannelSelect: (url: string) => void, onChannelSelect: (url: string) => void,
@ -20,8 +18,6 @@ type Props = {
doSetActiveChannel: (string) => void, doSetActiveChannel: (string) => void,
incognito: boolean, incognito: boolean,
doSetIncognito: (boolean) => void, doSetIncognito: (boolean) => void,
activeChanged: boolean,
setActiveChanged: (boolean) => void,
}; };
type ListItemProps = { type ListItemProps = {
@ -56,19 +52,15 @@ function IncognitoSelector(props: IncognitoSelectorProps) {
} }
function ChannelSelector(props: Props) { function ChannelSelector(props: Props) {
const { claim, channels, activeChannelClaim, doSetActiveChannel, hideAnon = false, incognito, doSetIncognito, activeChanged, setActiveChanged } = props; const { channels, activeChannelClaim, doSetActiveChannel, hideAnon = false, incognito, doSetIncognito } = props;
const { const {
push, push,
location: { pathname }, location: { pathname },
} = useHistory(); } = useHistory();
const selectedClaimId = claim && claim.claim_id;
if (selectedClaimId && !activeChanged) doSetActiveChannel(selectedClaimId);
const activeChannelUrl = activeChannelClaim && activeChannelClaim.permanent_url; const activeChannelUrl = activeChannelClaim && activeChannelClaim.permanent_url;
function handleChannelSelect(channelClaim) { function handleChannelSelect(channelClaim) {
doSetIncognito(false); doSetIncognito(false);
setActiveChanged(true);
doSetActiveChannel(channelClaim.claim_id); doSetActiveChannel(channelClaim.claim_id);
} }

View file

@ -117,10 +117,6 @@ function ClaimMenuList(props: Props) {
}); });
} }
function handleAnalytics() {
push(`/$/${PAGES.CREATOR_DASHBOARD}?channel=${encodeURIComponent(permanentUrl)}`);
}
function handleToggleMute() { function handleToggleMute() {
if (channelIsMuted) { if (channelIsMuted) {
doChannelUnmute(channelUri); doChannelUnmute(channelUri);
@ -191,22 +187,14 @@ function ClaimMenuList(props: Props) {
<Icon size={20} icon={ICONS.MORE_VERTICAL} /> <Icon size={20} icon={ICONS.MORE_VERTICAL} />
</MenuButton> </MenuButton>
<MenuList className="menu__list"> <MenuList className="menu__list">
{!incognito && !isRepost && !claimIsMine && !isChannelPage && (
{!incognito && !isRepost && (!claimIsMine ? (!isChannelPage &&
<MenuItem className="comment__menu-option" onSelect={handleFollow}> <MenuItem className="comment__menu-option" onSelect={handleFollow}>
<div className="menu__link"> <div className="menu__link">
<Icon aria-hidden icon={ICONS.SUBSCRIBE} /> <Icon aria-hidden icon={ICONS.SUBSCRIBE} />
{subscriptionLabel} {subscriptionLabel}
</div> </div>
</MenuItem> </MenuItem>
) : ( )}
<MenuItem className="comment__menu-option" onSelect={handleAnalytics}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.ANALYTICS} />
{__('Channel Analytics')}
</div>
</MenuItem>
))}
{hasExperimentalUi && ( {hasExperimentalUi && (
<> <>

View file

@ -7,7 +7,6 @@ import Button from 'component/button';
import CreatorAnalytics from 'component/creatorAnalytics'; import CreatorAnalytics from 'component/creatorAnalytics';
import ChannelSelector from 'component/channelSelector'; import ChannelSelector from 'component/channelSelector';
import Yrbl from 'component/yrbl'; import Yrbl from 'component/yrbl';
import { useHistory } from 'react-router';
type Props = { type Props = {
channels: Array<ChannelClaim>, channels: Array<ChannelClaim>,
@ -18,10 +17,6 @@ type Props = {
export default function CreatorDashboardPage(props: Props) { export default function CreatorDashboardPage(props: Props) {
const { channels, fetchingChannels, activeChannelClaim } = props; const { channels, fetchingChannels, activeChannelClaim } = props;
const hasChannels = channels && channels.length > 0; const hasChannels = channels && channels.length > 0;
const [activeChanged, setActiveChanged] = React.useState(false);
const { location: { search } } = useHistory();
const urlParams = new URLSearchParams(search);
const channelParam = urlParams.get('channel');
return ( return (
<Page> <Page>
@ -45,8 +40,8 @@ export default function CreatorDashboardPage(props: Props) {
{!fetchingChannels && activeChannelClaim && ( {!fetchingChannels && activeChannelClaim && (
<React.Fragment> <React.Fragment>
<ChannelSelector hideAnon uri={channelParam} activeChanged={activeChanged} setActiveChanged={setActiveChanged} /> <ChannelSelector hideAnon />
<CreatorAnalytics uri={!activeChanged && channelParam ? channelParam : activeChannelClaim.canonical_url} /> <CreatorAnalytics uri={activeChannelClaim.canonical_url} />
</React.Fragment> </React.Fragment>
)} )}
</Page> </Page>