tagsIntro behind config
This commit is contained in:
parent
006db3877c
commit
8fbd0d0310
1 changed files with 23 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
import * as PAGES from 'constants/pages';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { useHistory } from 'react-router';
|
import { useHistory } from 'react-router';
|
||||||
|
@ -6,6 +7,7 @@ import UserEmailNew from 'component/userEmailNew';
|
||||||
import UserEmailVerify from 'component/userEmailVerify';
|
import UserEmailVerify from 'component/userEmailVerify';
|
||||||
import UserFirstChannel from 'component/userFirstChannel';
|
import UserFirstChannel from 'component/userFirstChannel';
|
||||||
import UserChannelFollowIntro from 'component/userChannelFollowIntro';
|
import UserChannelFollowIntro from 'component/userChannelFollowIntro';
|
||||||
|
import UserTagFollowIntro from 'component/userTagFollowIntro';
|
||||||
import YoutubeSync from 'page/youtubeSync';
|
import YoutubeSync from 'page/youtubeSync';
|
||||||
import { DEFAULT_BID_FOR_FIRST_CHANNEL } from 'component/userFirstChannel/view';
|
import { DEFAULT_BID_FOR_FIRST_CHANNEL } from 'component/userFirstChannel/view';
|
||||||
import { YOUTUBE_STATUSES } from 'lbryinc';
|
import { YOUTUBE_STATUSES } from 'lbryinc';
|
||||||
|
@ -17,6 +19,7 @@ import YoutubeTransferStatus from 'component/youtubeTransferStatus';
|
||||||
import useFetched from 'effects/use-fetched';
|
import useFetched from 'effects/use-fetched';
|
||||||
import Confetti from 'react-confetti';
|
import Confetti from 'react-confetti';
|
||||||
import usePrevious from 'effects/use-previous';
|
import usePrevious from 'effects/use-previous';
|
||||||
|
import { SHOW_TAGS_INTRO } from 'config';
|
||||||
|
|
||||||
const REDIRECT_PARAM = 'redirect';
|
const REDIRECT_PARAM = 'redirect';
|
||||||
const REDIRECT_IMMEDIATELY_PARAM = 'immediate';
|
const REDIRECT_IMMEDIATELY_PARAM = 'immediate';
|
||||||
|
@ -40,6 +43,7 @@ type Props = {
|
||||||
creatingChannel: boolean,
|
creatingChannel: boolean,
|
||||||
setClientSetting: (string, boolean, ?boolean) => void,
|
setClientSetting: (string, boolean, ?boolean) => void,
|
||||||
followingAcknowledged: boolean,
|
followingAcknowledged: boolean,
|
||||||
|
tagsAcknowledged: boolean,
|
||||||
rewardsAcknowledged: boolean,
|
rewardsAcknowledged: boolean,
|
||||||
interestedInYoutubeSync: boolean,
|
interestedInYoutubeSync: boolean,
|
||||||
doToggleInterestedInYoutubeSync: () => void,
|
doToggleInterestedInYoutubeSync: () => void,
|
||||||
|
@ -64,6 +68,7 @@ function UserSignUp(props: Props) {
|
||||||
fetchingChannels,
|
fetchingChannels,
|
||||||
creatingChannel,
|
creatingChannel,
|
||||||
followingAcknowledged,
|
followingAcknowledged,
|
||||||
|
tagsAcknowledged,
|
||||||
rewardsAcknowledged,
|
rewardsAcknowledged,
|
||||||
setClientSetting,
|
setClientSetting,
|
||||||
interestedInYoutubeSync,
|
interestedInYoutubeSync,
|
||||||
|
@ -114,7 +119,8 @@ function UserSignUp(props: Props) {
|
||||||
interestedInYoutubeSync);
|
interestedInYoutubeSync);
|
||||||
const showYoutubeTransfer = hasVerifiedEmail && hasYoutubeChannels && !isYoutubeTransferComplete;
|
const showYoutubeTransfer = hasVerifiedEmail && hasYoutubeChannels && !isYoutubeTransferComplete;
|
||||||
const showFollowIntro = step === 'channels' || (hasVerifiedEmail && !followingAcknowledged);
|
const showFollowIntro = step === 'channels' || (hasVerifiedEmail && !followingAcknowledged);
|
||||||
const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !showFollowIntro && !rewardsAcknowledged;
|
const showTagsIntro = SHOW_TAGS_INTRO && (step === 'tags' || (hasVerifiedEmail && !tagsAcknowledged));
|
||||||
|
const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !showFollowIntro && !showTagsIntro && !rewardsAcknowledged;
|
||||||
const isCurrentlyFetchingSomething = fetchingChannels || claimingReward || syncingWallet || creatingChannel;
|
const isCurrentlyFetchingSomething = fetchingChannels || claimingReward || syncingWallet || creatingChannel;
|
||||||
const isWaitingForSomethingToFinish =
|
const isWaitingForSomethingToFinish =
|
||||||
// If the user has claimed the email award, we need to wait until the balance updates sometime in the future
|
// If the user has claimed the email award, we need to wait until the balance updates sometime in the future
|
||||||
|
@ -201,6 +207,22 @@ function UserSignUp(props: Props) {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
|
showTagsIntro && (
|
||||||
|
<UserTagFollowIntro
|
||||||
|
onContinue={() => {
|
||||||
|
let url = `/$/${PAGES.AUTH}?reset_scroll=1&${STEP_PARAM}=channels`;
|
||||||
|
if (redirect) {
|
||||||
|
url += `&${REDIRECT_PARAM}=${redirect}`;
|
||||||
|
}
|
||||||
|
if (shouldRedirectImmediately) {
|
||||||
|
url += `&${REDIRECT_IMMEDIATELY_PARAM}=true`;
|
||||||
|
}
|
||||||
|
|
||||||
|
replace(url);
|
||||||
|
setSettingAndSync(SETTINGS.TAGS_ACKNOWLEDGED, true);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
showYoutubeTransfer && (
|
showYoutubeTransfer && (
|
||||||
<div>
|
<div>
|
||||||
<YoutubeTransferStatus /> <Confetti recycle={false} style={{ position: 'fixed' }} />
|
<YoutubeTransferStatus /> <Confetti recycle={false} style={{ position: 'fixed' }} />
|
||||||
|
|
Loading…
Reference in a new issue