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
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { useHistory } from 'react-router';
|
||||
|
@ -6,6 +7,7 @@ import UserEmailNew from 'component/userEmailNew';
|
|||
import UserEmailVerify from 'component/userEmailVerify';
|
||||
import UserFirstChannel from 'component/userFirstChannel';
|
||||
import UserChannelFollowIntro from 'component/userChannelFollowIntro';
|
||||
import UserTagFollowIntro from 'component/userTagFollowIntro';
|
||||
import YoutubeSync from 'page/youtubeSync';
|
||||
import { DEFAULT_BID_FOR_FIRST_CHANNEL } from 'component/userFirstChannel/view';
|
||||
import { YOUTUBE_STATUSES } from 'lbryinc';
|
||||
|
@ -17,6 +19,7 @@ import YoutubeTransferStatus from 'component/youtubeTransferStatus';
|
|||
import useFetched from 'effects/use-fetched';
|
||||
import Confetti from 'react-confetti';
|
||||
import usePrevious from 'effects/use-previous';
|
||||
import { SHOW_TAGS_INTRO } from 'config';
|
||||
|
||||
const REDIRECT_PARAM = 'redirect';
|
||||
const REDIRECT_IMMEDIATELY_PARAM = 'immediate';
|
||||
|
@ -40,6 +43,7 @@ type Props = {
|
|||
creatingChannel: boolean,
|
||||
setClientSetting: (string, boolean, ?boolean) => void,
|
||||
followingAcknowledged: boolean,
|
||||
tagsAcknowledged: boolean,
|
||||
rewardsAcknowledged: boolean,
|
||||
interestedInYoutubeSync: boolean,
|
||||
doToggleInterestedInYoutubeSync: () => void,
|
||||
|
@ -64,6 +68,7 @@ function UserSignUp(props: Props) {
|
|||
fetchingChannels,
|
||||
creatingChannel,
|
||||
followingAcknowledged,
|
||||
tagsAcknowledged,
|
||||
rewardsAcknowledged,
|
||||
setClientSetting,
|
||||
interestedInYoutubeSync,
|
||||
|
@ -114,7 +119,8 @@ function UserSignUp(props: Props) {
|
|||
interestedInYoutubeSync);
|
||||
const showYoutubeTransfer = hasVerifiedEmail && hasYoutubeChannels && !isYoutubeTransferComplete;
|
||||
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 isWaitingForSomethingToFinish =
|
||||
// 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 && (
|
||||
<div>
|
||||
<YoutubeTransferStatus /> <Confetti recycle={false} style={{ position: 'fixed' }} />
|
||||
|
|
Loading…
Reference in a new issue