format code

This commit is contained in:
Sean Yesmunt 2019-11-14 09:34:55 -05:00
parent 7ae4c3301d
commit 1b62fe8a5a
2 changed files with 56 additions and 48 deletions

View file

@ -18,7 +18,7 @@ import { IS_MAC } from 'component/app/view';
type Props = {
balance: string,
roundedBalance: number,
history: { push: string => void, goBack: () => void, goForward: () => void },
history: { push: string => void, goBack: () => void, goForward: () => void, location: { pathname: string } },
currentTheme: string,
automaticDarkModeEnabled: boolean,
setClientSetting: (string, boolean | string) => void,
@ -49,9 +49,7 @@ const Header = (props: Props) => {
// Sign out if they click the "x" when they are on the password prompt
const authHeaderAction = syncError ? { onClick: signOut } : { navigate: '/' };
const homeButtonNavigationProps = isVerifyPage ?
{ } :
authHeader ? authHeaderAction : { navigate: '/' };
const homeButtonNavigationProps = isVerifyPage ? {} : authHeader ? authHeaderAction : { navigate: '/' };
const closeButtonNavigationProps = authHeader ? authHeaderAction : { onClick: () => history.goBack() };
function handleThemeToggle() {
@ -188,7 +186,8 @@ const Header = (props: Props) => {
<Button navigate={`/$/${PAGES.AUTH}`} button="primary" label={__('Sign In')} />
)}
</div>
) : (!isVerifyPage &&
) : (
!isVerifyPage && (
<div className="header__menu">
{/* Add an empty span here so we can use the same style as above */}
{/* This pushes the close button to the right side */}
@ -197,6 +196,7 @@ const Header = (props: Props) => {
<Button icon={ICONS.REMOVE} {...closeButtonNavigationProps} />
</Tooltip>
</div>
)
)}
</div>
</header>

View file

@ -2,18 +2,21 @@
import React, { useState } from 'react';
import { withRouter } from 'react-router';
import Page from 'component/page';
import ReCAPTCHA from "react-google-recaptcha";
import ReCAPTCHA from 'react-google-recaptcha';
import Button from 'component/button';
import { Lbryio } from 'lbryinc';
import * as PAGES from 'constants/pages';
type Props = {
history: { push: string => void },
doToast: ({}) => void
history: { push: string => void, location: { search: string } },
doToast: ({}) => void,
};
function SignInVerifyPage(props: Props) {
const { history: { push }, doToast } = props;
const {
history: { push, location },
doToast,
} = props;
const urlParams = new URLSearchParams(location.search);
const authToken = urlParams.get('auth_token');
const userSubmittedEmail = urlParams.get('email');
@ -53,9 +56,13 @@ function SignInVerifyPage(props: Props) {
return (
<Page authPage className="main--auth-page">
<section className="main--contained">
<h1 className="section__title--large">{isAuthenticationSuccess ? __('Sign In Success!') : __('Sign In to lbry.tv') }</h1>
<p className="section__subtitle">{ isAuthenticationSuccess ? __('You can now close this tab.') : __('Click below to sign in to lbry.tv') }</p>
{ !isAuthenticationSuccess &&
<h1 className="section__title--large">
{isAuthenticationSuccess ? __('Sign In Success!') : __('Sign In to lbry.tv')}
</h1>
<p className="section__subtitle">
{isAuthenticationSuccess ? __('You can now close this tab.') : __('Click below to sign in to lbry.tv')}
</p>
{!isAuthenticationSuccess && (
<div className="section__actions">
<ReCAPTCHA
sitekey="6LePsJgUAAAAAFTuWOKRLnyoNKhm0HA4C3elrFMG"
@ -63,10 +70,11 @@ function SignInVerifyPage(props: Props) {
onExpired={onAuthError}
onErrored={onAuthError}
/>
</div>}
</div>
)}
</section>
</Page>
);
};
}
export default withRouter(SignInVerifyPage);