2020-04-13 21:16:07 +02:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
2020-08-26 22:28:33 +02:00
|
|
|
import classnames from 'classnames';
|
2020-09-04 22:11:28 +02:00
|
|
|
import { useHistory } from 'react-router';
|
2020-04-13 21:16:07 +02:00
|
|
|
import UserEmailNew from 'component/userEmailNew';
|
|
|
|
import UserEmailVerify from 'component/userEmailVerify';
|
|
|
|
import UserFirstChannel from 'component/userFirstChannel';
|
|
|
|
import UserChannelFollowIntro from 'component/userChannelFollowIntro';
|
2020-09-04 22:11:28 +02:00
|
|
|
import YoutubeSync from 'page/youtubeSync';
|
2020-04-13 21:16:07 +02:00
|
|
|
import { DEFAULT_BID_FOR_FIRST_CHANNEL } from 'component/userFirstChannel/view';
|
2020-06-15 22:33:03 +02:00
|
|
|
import { YOUTUBE_STATUSES } from 'lbryinc';
|
2020-08-24 06:00:10 +02:00
|
|
|
import { SETTINGS } from 'lbry-redux';
|
2020-06-15 22:33:03 +02:00
|
|
|
import REWARDS from 'rewards';
|
2020-04-13 21:16:07 +02:00
|
|
|
import UserVerify from 'component/userVerify';
|
|
|
|
import Spinner from 'component/spinner';
|
|
|
|
import YoutubeTransferStatus from 'component/youtubeTransferStatus';
|
|
|
|
import useFetched from 'effects/use-fetched';
|
|
|
|
import Confetti from 'react-confetti';
|
2021-01-13 17:53:35 +01:00
|
|
|
import usePrevious from 'effects/use-previous';
|
2020-04-13 21:16:07 +02:00
|
|
|
|
2020-09-04 22:11:28 +02:00
|
|
|
const REDIRECT_PARAM = 'redirect';
|
|
|
|
const REDIRECT_IMMEDIATELY_PARAM = 'immediate';
|
|
|
|
const STEP_PARAM = 'step';
|
|
|
|
|
2020-04-13 21:16:07 +02:00
|
|
|
type Props = {
|
|
|
|
user: ?User,
|
|
|
|
emailToVerify: ?string,
|
|
|
|
channels: ?Array<string>,
|
|
|
|
balance: ?number,
|
|
|
|
fetchingChannels: boolean,
|
|
|
|
claimingReward: boolean,
|
2020-08-27 19:56:18 +02:00
|
|
|
claimConfirmEmailReward: () => void,
|
|
|
|
claimNewUserReward: () => void,
|
2020-04-13 21:16:07 +02:00
|
|
|
fetchUser: () => void,
|
|
|
|
claimedRewards: Array<Reward>,
|
|
|
|
youtubeChannels: Array<any>,
|
|
|
|
syncEnabled: boolean,
|
|
|
|
hasSynced: boolean,
|
|
|
|
syncingWallet: boolean,
|
|
|
|
creatingChannel: boolean,
|
2020-09-15 15:54:05 +02:00
|
|
|
setClientSetting: (string, boolean, ?boolean) => void,
|
2020-08-24 06:00:10 +02:00
|
|
|
followingAcknowledged: boolean,
|
|
|
|
rewardsAcknowledged: boolean,
|
2020-09-04 22:11:28 +02:00
|
|
|
interestedInYoutubeSync: boolean,
|
|
|
|
doToggleInterestedInYoutubeSync: () => void,
|
2021-02-17 19:25:52 +01:00
|
|
|
prefsReady: boolean,
|
2020-04-13 21:16:07 +02:00
|
|
|
};
|
|
|
|
|
2020-08-27 19:56:18 +02:00
|
|
|
function UserSignUp(props: Props) {
|
2020-04-13 21:16:07 +02:00
|
|
|
const {
|
|
|
|
emailToVerify,
|
|
|
|
user,
|
|
|
|
claimingReward,
|
|
|
|
claimedRewards,
|
|
|
|
channels,
|
2020-08-27 19:56:18 +02:00
|
|
|
claimConfirmEmailReward,
|
|
|
|
claimNewUserReward,
|
2020-04-13 21:16:07 +02:00
|
|
|
balance,
|
|
|
|
fetchUser,
|
|
|
|
youtubeChannels,
|
|
|
|
syncEnabled,
|
|
|
|
syncingWallet,
|
|
|
|
hasSynced,
|
|
|
|
fetchingChannels,
|
|
|
|
creatingChannel,
|
2020-08-24 06:00:10 +02:00
|
|
|
followingAcknowledged,
|
|
|
|
rewardsAcknowledged,
|
|
|
|
setClientSetting,
|
2020-09-04 22:11:28 +02:00
|
|
|
interestedInYoutubeSync,
|
|
|
|
doToggleInterestedInYoutubeSync,
|
2021-02-17 19:25:52 +01:00
|
|
|
prefsReady,
|
2020-04-13 21:16:07 +02:00
|
|
|
} = props;
|
2020-09-04 22:11:28 +02:00
|
|
|
const {
|
|
|
|
location: { search, pathname },
|
|
|
|
replace,
|
|
|
|
} = useHistory();
|
2020-04-13 21:16:07 +02:00
|
|
|
const urlParams = new URLSearchParams(search);
|
2020-09-04 22:11:28 +02:00
|
|
|
const redirect = urlParams.get(REDIRECT_PARAM);
|
|
|
|
const step = urlParams.get(STEP_PARAM);
|
|
|
|
const shouldRedirectImmediately = urlParams.get(REDIRECT_IMMEDIATELY_PARAM);
|
2020-04-13 21:16:07 +02:00
|
|
|
const [initialSignInStep, setInitialSignInStep] = React.useState();
|
|
|
|
const hasVerifiedEmail = user && user.has_verified_email;
|
|
|
|
const rewardsApproved = user && user.is_reward_approved;
|
|
|
|
const isIdentityVerified = user && user.is_identity_verified;
|
2020-04-20 22:53:40 +02:00
|
|
|
const passwordSet = user && user.password_set;
|
2020-04-13 21:16:07 +02:00
|
|
|
const hasFetchedReward = useFetched(claimingReward);
|
2021-01-13 17:53:35 +01:00
|
|
|
const previousHasVerifiedEmail = usePrevious(hasVerifiedEmail);
|
2020-04-13 21:16:07 +02:00
|
|
|
const channelCount = channels ? channels.length : 0;
|
2021-02-17 19:25:52 +01:00
|
|
|
const hasClaimedEmailAward = claimedRewards.some((reward) => reward.reward_type === REWARDS.TYPE_CONFIRM_EMAIL);
|
2020-04-13 21:16:07 +02:00
|
|
|
const hasYoutubeChannels = youtubeChannels && Boolean(youtubeChannels.length);
|
|
|
|
const isYoutubeTransferComplete =
|
|
|
|
hasYoutubeChannels &&
|
2020-09-09 23:13:25 +02:00
|
|
|
youtubeChannels.every(
|
2021-02-17 19:25:52 +01:00
|
|
|
(channel) =>
|
2020-09-09 23:13:25 +02:00
|
|
|
channel.transfer_state === YOUTUBE_STATUSES.COMPLETED_TRANSFER ||
|
|
|
|
channel.sync_status === YOUTUBE_STATUSES.YOUTUBE_SYNC_ABANDONDED
|
|
|
|
);
|
2020-04-13 21:16:07 +02:00
|
|
|
// Complexity warning
|
|
|
|
// We can't just check if we are currently fetching something
|
|
|
|
// We may want to keep a component rendered while something is being fetched, instead of replacing it with the large spinner
|
|
|
|
// The verbose variable names are an attempt to alleviate _some_ of the confusion from handling all edge cases that come from
|
|
|
|
// reward claiming, channel creation, account syncing, and youtube transfer
|
|
|
|
// The possible screens for the sign in flow
|
|
|
|
const showEmail = !hasVerifiedEmail;
|
2020-04-20 22:53:40 +02:00
|
|
|
const showEmailVerification = (emailToVerify && !hasVerifiedEmail) || (!hasVerifiedEmail && passwordSet);
|
2020-08-24 06:00:10 +02:00
|
|
|
const showUserVerification = hasVerifiedEmail && !rewardsApproved && !isIdentityVerified && !rewardsAcknowledged;
|
2020-04-13 21:16:07 +02:00
|
|
|
const showChannelCreation =
|
|
|
|
hasVerifiedEmail &&
|
2020-09-04 22:11:28 +02:00
|
|
|
((balance !== undefined &&
|
|
|
|
balance !== null &&
|
|
|
|
balance > DEFAULT_BID_FOR_FIRST_CHANNEL &&
|
|
|
|
channelCount === 0 &&
|
|
|
|
!hasYoutubeChannels) ||
|
|
|
|
interestedInYoutubeSync);
|
2020-04-13 21:16:07 +02:00
|
|
|
const showYoutubeTransfer = hasVerifiedEmail && hasYoutubeChannels && !isYoutubeTransferComplete;
|
2020-08-24 06:00:10 +02:00
|
|
|
const showFollowIntro = step === 'channels' || (hasVerifiedEmail && !followingAcknowledged);
|
odysee
fix replay select styling
make meme a link
Fix audio references
get newest livestream claim in livestreamLink
pin crackermilk
fix livestream banner placement
fix live page
fix rebase
fix rebase
fix error nag
fix darkmode blockquote style
break word on livestream comment text
fix dark mode snack
fix live badge
fix lint
small fixes - word wrap, live badge
wip
Fix invisible snack in Odysee Light Theme
Revert "wip"
This reverts commit d17e477fe0e6633709ea30bdc403448825db4c71.
Revert "small fixes - word wrap, live badge"
This reverts commit 0e431d4038d774079c78f0de32238aac7260e4ca.
fix blank
pinned destiny
fix badges and homepage again
only get livestreams live for less than a day
pinned hammy and olivia
multi pin
pin destiny
updated pinned videos
update tagline
Update view.jsx
pins
updated destiny's video
updated pinned videos
removed destiny, added lie likes music
pinned destiny and mason's woodshop
removed hammy and olivia
unpinned mason's woodshop
removed pins
added hammy and olivia
pinned sam seder
unpinned destiny and hammy and olivia
Fix merge on ChannelThumbnails
- sam seder, + hammy & olivia and passion for food
update tagline (#6086)
removed everyone, added kona and suba
Theme color fixes (odysee) (#6089)
* Cherry-pick master's 'base-theme.scss'
* Non-functional cleanup (remove dups, re-order, etc.)
* Dark: update positive Toast to --color-primary as well.
This follows the intention of the refactoring, which I guess was (1) reduce the number of color names (2) reduce the number of customizations needed.
The only issue I have with this is that the current Odysee primary color is pink, which can be intepreted as an error.
The original (pre-refactoring color was green).
For now, I follow the refactoring path. We can tweak this later.
* Fix text color inside '--color-card-background-highlighted'
Light: use base-theme (it was the same value anyway).
Dark: use bright text.
* Dark: add some contrast between the components
The color for the background, header, card, placeholder, etc. is almost identical -- it looks like there are all in the same component. The almost-invisible border doesn't help. One would have to crank up the monitor's contrast setting to see separation of components.
Brighten up the components a bit, somewhat following the same scale as lbry.tv's dark theme.
Overall, I still think it's too dark. The Card's background color can still be brightened up further for better contrast, but I try not to make too drastic of a change for now.
The original lbry.tv's gray theme is the most pleasant theme I've seen so far, but this is all subjective.
changed pins
removed kona and suba
added destiny
changed pins
removed destiny
pinned sgtducky
changed pins
removed sgtducky
added hammy and olivia
added chrissie mayr
added the bite shot
changed pins
removed the bite shot
added heads of tech
changed pins
removed hammy and olivia
removed chrissie mayr
changed pins
removed heads of tech
added crackermilk
changed pins
removed crackermilk
added some ordinary gamer
added passion for food
changed pins
removed some ordinary gamers
removed passion for food
added emmy hucker
changed pins
added game knights
Update view.jsx
Force rebuild
changed pins
removed emmy hucker
changed pins
removed game knights
added crackermilk
changed pins
removed crackermilk
added some ordinary gamer
changed pins
removed some ordinary gamers
added passion for food
added green renaissance
changed pins
removed passion for food
removed green renaissance
added expand love
changed pins
removed expand love
added dr nora
change tagline (#6122)
there's so much room for activities
comment out music
changed pins
removed dr nora
added kona and suba
changed pins
removed kona and suba
added destiny
changed pins
removed destiny
added crackermilk
changed pins
removed crackermilk
added someordinarygamers
change tagline
Drake, where's the door hole?
changed pins
unpinned someordinarygamers
pinned kona and suba
Add message for mature content
changed pin
changed pins
removed creative model
changed pins
added bcpov
added krish mohan
added cigarvixen
changed pins
removed krish mohan
added adrian logan
bump
fix footer
change tagline
just like the simulations
changed pins
removed:
bcpov
cigarvixen
adrian logan
added:
someordinarygamers
quick fix for reposts
oops
fix channel tabs
changed pin
removed someordinarygamers
added kona and suba
changed pins
removed kona and suba
added dirtyworkz
added crackermilk
fix channel tabs again again
changed pins
someordinarygamers
arvie's cookbook
changed pins
removed some ordinary gamers
removed arvie's cookbook
added fna van life
changed pins
removed fna vanlife
added game knights
change tagline
"this cave is not a natural formation"
changed pins
removed game knights
added some ordinary gamers
fix popup
put footer back
bump lightouse throttle
bump lighthouse throttle
changed pins
removed some orginary gamers
added adrian logan
pinned bret weinstein
fix referral
fix-superchats
changed pins
removed bret weinstein
added passion for food
added dark horse clips
fix incorrect variable being used to determine view state
changed pins
removed passion for food
changed pins
removed bret weinstein
added sgt ducky
add recsys related functionality
Create plugin to hold code for recsys
send recsys on dispose
cleanup recsys code
add userId to props validation
appease the linter
add todo note
extra characters
pinned jungle survival
fix autoplay for transcoded files
change tagline
changed pins
pinned destiny
pinned chris williamson
FIX video.js event firing issues fore RecsysPlugin
- The `rateChange` event now logs the updated speed,
not just the time at which it occurred.
- The `scrub` now (more) accurately logs the position
it came from before the destination.
- The recsys events get consolidated for logical consistency.
Wunderbar: change throttle to debounce + add min chars
6314: prevent lighthouse spam from wunderbar
- Wunderbar: change throttle to debounce + add min chars.
- useLighthouse: added option to not throttle.
Wunderbar: immediate feedback to convey status
Make immediate GUI feedback to convey the current status, which can be the following:
- typing
- waiting lighthouse results
- waiting claim resolve
- no results or failed.
pinned someordinarygamers
Wunderbar: bump debounce to 1s
per feedback
pinned jungle survival
pinned james julier
Fix compile error
Lint
summit pin
summit pin
update pins
added humblemechanic
removed everyone else
update pins
pinned samtime
FIX stop event translation and remove preprocessing
I think different browsers behave in different ways for the media
API. As a result, I think I was losing information for browsers
that weren't the same as mine (Chromium). For now, preprocessing
is removed. In the future, I'll add it again (better storage
and transmission properties).
updated pin
change pins
(cherry picked from commit 041f420416aaa890adecd78381d611375134b904)
pinned someordinarygamers
auth only for stripe
restore playlists tab
fix missing i18n on channel page
pinned zimmerhandcrafted
change tagline
big gulps, huh?
change pin
Revert lazy-loading videojs
The loading circle wasn't showing up, causing confusion.
Splitting CSS doesn't seem trivial as there seems to be a huge dependency on the load order. Pretty much similar to what this person is facing https://lihautan.com/css-code-splitting/#the-problem
This reverts videojs-specific changes from 4d638bcf.
odyrecon
use ENABLE_UI_NOTIFICATIONS
use ENABLE_MATURE
oops
use ENABLE_MATURE for fileTitleSection
pinned orf
pinned ourselves
selecthumb copy
use ENABLE_UI_NOT. on sideNav
showNoSourceClaims
changed pin
fix livestream claims display
...
fix?
fix
Fix invalid semicolon
alison morrow
Odysee: fix missing '--color-help-warning-bg' for Dark
someordinarygamers
pinned some new channels
watch guy
hotfix error returning to settings
emplemon
fix showMature
test bump parsing
better colon handling
cherrypick pins
unpin emplemon for now
delete unused components (#6531)
more recon (#6534)
emplemon
Latest changes to odysee (#6536)
* disable review button if no card saved also some cleanup
* fix flow errors
move stuff to web
Revert "move stuff to web"
This reverts commit 17b13d8b19c08dcfd9ab55e09ac53da97dba3682.
hotfix for odysee
change tagline
don't dead open inside
2021-06-11 19:47:56 +02:00
|
|
|
const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !showFollowIntro && !rewardsAcknowledged;
|
2020-04-13 21:16:07 +02:00
|
|
|
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
|
|
|
|
(!hasFetchedReward && !hasClaimedEmailAward) || (syncEnabled && !hasSynced);
|
|
|
|
const showLoadingSpinner =
|
|
|
|
canHijackSignInFlowWithSpinner && (isCurrentlyFetchingSomething || isWaitingForSomethingToFinish);
|
|
|
|
|
2020-08-24 06:00:10 +02:00
|
|
|
function setSettingAndSync(setting, value) {
|
2020-09-15 15:54:05 +02:00
|
|
|
setClientSetting(setting, value, true);
|
2020-08-24 06:00:10 +02:00
|
|
|
}
|
|
|
|
|
2020-04-13 21:16:07 +02:00
|
|
|
React.useEffect(() => {
|
|
|
|
fetchUser();
|
|
|
|
}, [fetchUser]);
|
|
|
|
|
2020-08-27 19:56:18 +02:00
|
|
|
React.useEffect(() => {
|
2021-02-17 19:25:52 +01:00
|
|
|
if (previousHasVerifiedEmail === false && hasVerifiedEmail && prefsReady) {
|
2020-08-27 19:56:18 +02:00
|
|
|
setSettingAndSync(SETTINGS.FIRST_RUN_STARTED, true);
|
|
|
|
}
|
2021-02-17 19:25:52 +01:00
|
|
|
}, [hasVerifiedEmail, previousHasVerifiedEmail, prefsReady]);
|
2020-08-27 19:56:18 +02:00
|
|
|
|
2020-04-13 21:16:07 +02:00
|
|
|
React.useEffect(() => {
|
|
|
|
// Don't claim the reward if sync is enabled until after a sync has been completed successfully
|
|
|
|
// If we do it before, we could end up trying to sync a wallet with a non-zero balance which will fail to sync
|
|
|
|
const delayForSync = syncEnabled && !hasSynced;
|
|
|
|
|
|
|
|
if (hasVerifiedEmail && !hasClaimedEmailAward && !hasFetchedReward && !delayForSync) {
|
2020-08-27 19:56:18 +02:00
|
|
|
claimConfirmEmailReward();
|
2020-04-13 21:16:07 +02:00
|
|
|
}
|
2020-08-27 19:56:18 +02:00
|
|
|
}, [
|
|
|
|
hasVerifiedEmail,
|
|
|
|
claimConfirmEmailReward,
|
|
|
|
hasClaimedEmailAward,
|
|
|
|
hasFetchedReward,
|
|
|
|
syncEnabled,
|
|
|
|
hasSynced,
|
|
|
|
balance,
|
|
|
|
]);
|
2020-04-13 21:16:07 +02:00
|
|
|
|
|
|
|
// Loop through this list from the end, until it finds a matching component
|
|
|
|
// If it never finds one, assume the user has completed every step and redirect them
|
|
|
|
const SIGN_IN_FLOW = [
|
2020-09-04 22:11:28 +02:00
|
|
|
showEmail && (
|
|
|
|
<UserEmailNew
|
|
|
|
interestedInYoutubSync={interestedInYoutubeSync}
|
|
|
|
doToggleInterestedInYoutubeSync={doToggleInterestedInYoutubeSync}
|
|
|
|
/>
|
|
|
|
),
|
2020-04-13 21:16:07 +02:00
|
|
|
showEmailVerification && <UserEmailVerify />,
|
2020-08-24 06:00:10 +02:00
|
|
|
showUserVerification && (
|
|
|
|
<UserVerify
|
|
|
|
onSkip={() => {
|
|
|
|
setSettingAndSync(SETTINGS.REWARDS_ACKNOWLEDGED, true);
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
),
|
2020-09-04 22:11:28 +02:00
|
|
|
showChannelCreation &&
|
|
|
|
(interestedInYoutubeSync ? (
|
2020-09-15 16:23:00 +02:00
|
|
|
<YoutubeSync inSignUpFlow doToggleInterestedInYoutubeSync={doToggleInterestedInYoutubeSync} />
|
2020-09-04 22:11:28 +02:00
|
|
|
) : (
|
|
|
|
<UserFirstChannel doToggleInterestedInYoutubeSync={doToggleInterestedInYoutubeSync} />
|
|
|
|
)),
|
2020-04-13 21:16:07 +02:00
|
|
|
showFollowIntro && (
|
|
|
|
<UserChannelFollowIntro
|
|
|
|
onContinue={() => {
|
2020-09-04 22:11:28 +02:00
|
|
|
if (urlParams.get('reset_scroll')) {
|
|
|
|
urlParams.delete('reset_scroll');
|
|
|
|
urlParams.append('reset_scroll', '2');
|
2020-04-13 21:16:07 +02:00
|
|
|
}
|
|
|
|
|
2020-09-04 22:11:28 +02:00
|
|
|
urlParams.delete(STEP_PARAM);
|
|
|
|
|
2020-08-24 06:00:10 +02:00
|
|
|
setSettingAndSync(SETTINGS.FOLLOWING_ACKNOWLEDGED, true);
|
2020-09-04 22:11:28 +02:00
|
|
|
replace(`${pathname}?${urlParams.toString()}`);
|
2020-04-13 21:16:07 +02:00
|
|
|
}}
|
|
|
|
onBack={() => {
|
2020-09-04 22:11:28 +02:00
|
|
|
if (urlParams.get('reset_scroll')) {
|
|
|
|
urlParams.delete('reset_scroll');
|
|
|
|
urlParams.append('reset_scroll', '3');
|
2020-04-13 21:16:07 +02:00
|
|
|
}
|
|
|
|
|
2020-08-24 06:00:10 +02:00
|
|
|
setSettingAndSync(SETTINGS.FOLLOWING_ACKNOWLEDGED, false);
|
2020-09-04 22:11:28 +02:00
|
|
|
replace(`${pathname}?${urlParams.toString()}`);
|
2020-04-13 21:16:07 +02:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
),
|
|
|
|
showYoutubeTransfer && (
|
|
|
|
<div>
|
|
|
|
<YoutubeTransferStatus /> <Confetti recycle={false} style={{ position: 'fixed' }} />
|
|
|
|
</div>
|
|
|
|
),
|
|
|
|
showLoadingSpinner && (
|
|
|
|
<div className="main--empty">
|
|
|
|
<Spinner />
|
|
|
|
</div>
|
|
|
|
),
|
|
|
|
];
|
|
|
|
|
2020-08-26 22:28:33 +02:00
|
|
|
// $FlowFixMe
|
2020-04-13 21:16:07 +02:00
|
|
|
function getSignInStep() {
|
|
|
|
for (var i = SIGN_IN_FLOW.length - 1; i > -1; i--) {
|
|
|
|
const Component = SIGN_IN_FLOW[i];
|
|
|
|
if (Component) {
|
|
|
|
// If we want to redirect immediately,
|
|
|
|
// remember the first step so we can redirect once a new step has been reached
|
|
|
|
// Ignore the loading step
|
|
|
|
if (redirect && shouldRedirectImmediately) {
|
|
|
|
if (!initialSignInStep) {
|
|
|
|
setInitialSignInStep(i);
|
|
|
|
} else if (i !== initialSignInStep && i !== SIGN_IN_FLOW.length - 1) {
|
2020-09-04 22:11:28 +02:00
|
|
|
replace(redirect);
|
2020-04-13 21:16:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-26 22:28:33 +02:00
|
|
|
const scrollableSteps = [2, 4, 5];
|
|
|
|
const isScrollable = scrollableSteps.includes(i);
|
|
|
|
return [Component, isScrollable];
|
2020-04-13 21:16:07 +02:00
|
|
|
}
|
|
|
|
}
|
2020-08-26 22:49:05 +02:00
|
|
|
|
|
|
|
return [undefined, false];
|
2020-04-13 21:16:07 +02:00
|
|
|
}
|
|
|
|
|
2020-08-26 22:28:33 +02:00
|
|
|
const [componentToRender, isScrollable] = getSignInStep();
|
2020-04-13 21:16:07 +02:00
|
|
|
|
2020-08-27 19:56:18 +02:00
|
|
|
React.useEffect(() => {
|
|
|
|
if (!componentToRender) {
|
|
|
|
claimNewUserReward();
|
|
|
|
}
|
|
|
|
}, [componentToRender, claimNewUserReward]);
|
|
|
|
|
2020-04-13 21:16:07 +02:00
|
|
|
if (!componentToRender) {
|
2020-09-04 22:11:28 +02:00
|
|
|
replace(redirect || '/');
|
2020-04-13 21:16:07 +02:00
|
|
|
}
|
|
|
|
|
2020-08-26 22:28:33 +02:00
|
|
|
return (
|
|
|
|
<section className={classnames('main--contained', { 'main--hoisted': isScrollable })}>{componentToRender}</section>
|
|
|
|
);
|
2020-04-13 21:16:07 +02:00
|
|
|
}
|
|
|
|
|
2020-09-04 22:11:28 +02:00
|
|
|
export default UserSignUp;
|