always show channel following section on first-run
This commit is contained in:
parent
21de13a3c2
commit
aad0f6fef6
3 changed files with 25 additions and 4 deletions
|
@ -86,7 +86,7 @@ type Props = {
|
||||||
function AppRouter(props: Props) {
|
function AppRouter(props: Props) {
|
||||||
const {
|
const {
|
||||||
currentScroll,
|
currentScroll,
|
||||||
location: { pathname },
|
location: { pathname, search },
|
||||||
isAuthenticated,
|
isAuthenticated,
|
||||||
history,
|
history,
|
||||||
uri,
|
uri,
|
||||||
|
@ -95,6 +95,8 @@ function AppRouter(props: Props) {
|
||||||
} = props;
|
} = props;
|
||||||
const { entries } = history;
|
const { entries } = history;
|
||||||
const entryIndex = history.index;
|
const entryIndex = history.index;
|
||||||
|
const urlParams = new URLSearchParams(search);
|
||||||
|
const resetScroll = urlParams.get('reset_scroll');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (uri) {
|
if (uri) {
|
||||||
|
@ -123,7 +125,7 @@ function AppRouter(props: Props) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.scrollTo(0, currentScroll);
|
window.scrollTo(0, currentScroll);
|
||||||
}, [currentScroll, pathname]);
|
}, [currentScroll, pathname, resetScroll]);
|
||||||
|
|
||||||
// react-router doesn't decode pathanmes before doing the route matching check
|
// react-router doesn't decode pathanmes before doing the route matching check
|
||||||
// We have to redirect here because if we redirect on the server, it might get encoded again
|
// We have to redirect here because if we redirect on the server, it might get encoded again
|
||||||
|
@ -150,6 +152,7 @@ function AppRouter(props: Props) {
|
||||||
<Route path={`/`} exact component={HomePage} />
|
<Route path={`/`} exact component={HomePage} />
|
||||||
<Route path={`/$/${PAGES.DISCOVER}`} exact component={DiscoverPage} />
|
<Route path={`/$/${PAGES.DISCOVER}`} exact component={DiscoverPage} />
|
||||||
<Route path={`/$/${PAGES.AUTH}`} exact component={SignInPage} />
|
<Route path={`/$/${PAGES.AUTH}`} exact component={SignInPage} />
|
||||||
|
<Route path={`/$/${PAGES.AUTH}/*`} exact component={SignInPage} />
|
||||||
<Route path={`/$/${PAGES.WELCOME}`} exact component={Welcome} />
|
<Route path={`/$/${PAGES.WELCOME}`} exact component={Welcome} />
|
||||||
<Route path={`/$/${PAGES.TAGS_FOLLOWING}`} exact component={TagsFollowingPage} />
|
<Route path={`/$/${PAGES.TAGS_FOLLOWING}`} exact component={TagsFollowingPage} />
|
||||||
<Route
|
<Route
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
import * as PAGES from 'constants/pages';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { withRouter } from 'react-router';
|
import { withRouter } from 'react-router';
|
||||||
import UserEmailNew from 'component/userEmailNew';
|
import UserEmailNew from 'component/userEmailNew';
|
||||||
|
@ -89,7 +90,7 @@ function UserSignIn(props: Props) {
|
||||||
channelCount === 0 &&
|
channelCount === 0 &&
|
||||||
!hasYoutubeChannels;
|
!hasYoutubeChannels;
|
||||||
const showYoutubeTransfer = hasVerifiedEmail && hasYoutubeChannels && !isYoutubeTransferComplete;
|
const showYoutubeTransfer = hasVerifiedEmail && hasYoutubeChannels && !isYoutubeTransferComplete;
|
||||||
const showFollowIntro = hasVerifiedEmail && !hasSeenFollowList && channelCount > 0;
|
const showFollowIntro = hasVerifiedEmail && !hasSeenFollowList;
|
||||||
const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !getSyncError && !showFollowIntro;
|
const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !getSyncError && !showFollowIntro;
|
||||||
const isCurrentlyFetchingSomething = fetchingChannels || claimingReward || syncingWallet || creatingChannel;
|
const isCurrentlyFetchingSomething = fetchingChannels || claimingReward || syncingWallet || creatingChannel;
|
||||||
const isWaitingForSomethingToFinish =
|
const isWaitingForSomethingToFinish =
|
||||||
|
@ -119,7 +120,22 @@ function UserSignIn(props: Props) {
|
||||||
showEmailVerification && <UserEmailVerify />,
|
showEmailVerification && <UserEmailVerify />,
|
||||||
showUserVerification && <UserVerify skipLink={redirect} />,
|
showUserVerification && <UserVerify skipLink={redirect} />,
|
||||||
showChannelCreation && <UserFirstChannel />,
|
showChannelCreation && <UserFirstChannel />,
|
||||||
showFollowIntro && <UserChannelFollowIntro onContinue={() => setHasSeenFollowList(true)} />,
|
showFollowIntro && (
|
||||||
|
<UserChannelFollowIntro
|
||||||
|
onContinue={() => {
|
||||||
|
let url = `/$/${PAGES.AUTH}?reset_scroll=1`;
|
||||||
|
if (redirect) {
|
||||||
|
url += `&redirect=${redirect}`;
|
||||||
|
}
|
||||||
|
if (shouldRedirectImmediately) {
|
||||||
|
url += `&immediate=true`;
|
||||||
|
}
|
||||||
|
|
||||||
|
history.replace(url);
|
||||||
|
setHasSeenFollowList(true);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
showYoutubeTransfer && (
|
showYoutubeTransfer && (
|
||||||
<div>
|
<div>
|
||||||
<YoutubeTransferStatus /> <Confetti recycle={false} style={{ position: 'fixed' }} />
|
<YoutubeTransferStatus /> <Confetti recycle={false} style={{ position: 'fixed' }} />
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
color: var(--color-white);
|
color: var(--color-white);
|
||||||
font-weight: var(--font-weight-bold);
|
font-weight: var(--font-weight-bold);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
z-index: 2;
|
||||||
|
|
||||||
.button--link {
|
.button--link {
|
||||||
font-weight: var(--font-weight-bold);
|
font-weight: var(--font-weight-bold);
|
||||||
|
@ -20,6 +21,7 @@
|
||||||
.nag--helpful {
|
.nag--helpful {
|
||||||
background-color: var(--color-secondary);
|
background-color: var(--color-secondary);
|
||||||
color: var(--color-white);
|
color: var(--color-white);
|
||||||
|
z-index: 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nag__button {
|
.nag__button {
|
||||||
|
|
Loading…
Add table
Reference in a new issue