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) {
|
||||
const {
|
||||
currentScroll,
|
||||
location: { pathname },
|
||||
location: { pathname, search },
|
||||
isAuthenticated,
|
||||
history,
|
||||
uri,
|
||||
|
@ -95,6 +95,8 @@ function AppRouter(props: Props) {
|
|||
} = props;
|
||||
const { entries } = history;
|
||||
const entryIndex = history.index;
|
||||
const urlParams = new URLSearchParams(search);
|
||||
const resetScroll = urlParams.get('reset_scroll');
|
||||
|
||||
useEffect(() => {
|
||||
if (uri) {
|
||||
|
@ -123,7 +125,7 @@ function AppRouter(props: Props) {
|
|||
|
||||
useEffect(() => {
|
||||
window.scrollTo(0, currentScroll);
|
||||
}, [currentScroll, pathname]);
|
||||
}, [currentScroll, pathname, resetScroll]);
|
||||
|
||||
// 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
|
||||
|
@ -150,6 +152,7 @@ function AppRouter(props: Props) {
|
|||
<Route path={`/`} exact component={HomePage} />
|
||||
<Route path={`/$/${PAGES.DISCOVER}`} exact component={DiscoverPage} />
|
||||
<Route path={`/$/${PAGES.AUTH}`} exact component={SignInPage} />
|
||||
<Route path={`/$/${PAGES.AUTH}/*`} exact component={SignInPage} />
|
||||
<Route path={`/$/${PAGES.WELCOME}`} exact component={Welcome} />
|
||||
<Route path={`/$/${PAGES.TAGS_FOLLOWING}`} exact component={TagsFollowingPage} />
|
||||
<Route
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// @flow
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React from 'react';
|
||||
import { withRouter } from 'react-router';
|
||||
import UserEmailNew from 'component/userEmailNew';
|
||||
|
@ -89,7 +90,7 @@ function UserSignIn(props: Props) {
|
|||
channelCount === 0 &&
|
||||
!hasYoutubeChannels;
|
||||
const showYoutubeTransfer = hasVerifiedEmail && hasYoutubeChannels && !isYoutubeTransferComplete;
|
||||
const showFollowIntro = hasVerifiedEmail && !hasSeenFollowList && channelCount > 0;
|
||||
const showFollowIntro = hasVerifiedEmail && !hasSeenFollowList;
|
||||
const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !getSyncError && !showFollowIntro;
|
||||
const isCurrentlyFetchingSomething = fetchingChannels || claimingReward || syncingWallet || creatingChannel;
|
||||
const isWaitingForSomethingToFinish =
|
||||
|
@ -119,7 +120,22 @@ function UserSignIn(props: Props) {
|
|||
showEmailVerification && <UserEmailVerify />,
|
||||
showUserVerification && <UserVerify skipLink={redirect} />,
|
||||
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 && (
|
||||
<div>
|
||||
<YoutubeTransferStatus /> <Confetti recycle={false} style={{ position: 'fixed' }} />
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
color: var(--color-white);
|
||||
font-weight: var(--font-weight-bold);
|
||||
text-align: center;
|
||||
z-index: 2;
|
||||
|
||||
.button--link {
|
||||
font-weight: var(--font-weight-bold);
|
||||
|
@ -20,6 +21,7 @@
|
|||
.nag--helpful {
|
||||
background-color: var(--color-secondary);
|
||||
color: var(--color-white);
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.nag__button {
|
||||
|
|
Loading…
Reference in a new issue