cleanup
This commit is contained in:
parent
f4d155b8eb
commit
4c52b96796
10 changed files with 42 additions and 43 deletions
|
@ -51,7 +51,7 @@ function App(props: Props) {
|
||||||
}, [userId]);
|
}, [userId]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="main-wrapper" ref={appRef} onContextMenu={e => openContextMenu(e)}>
|
<div className={MAIN_WRAPPER_CLASS} ref={appRef} onContextMenu={e => openContextMenu(e)}>
|
||||||
<Header />
|
<Header />
|
||||||
|
|
||||||
<div className="main-wrapper__inner">
|
<div className="main-wrapper__inner">
|
||||||
|
|
|
@ -63,7 +63,7 @@ class UriIndicator extends React.PureComponent<Props> {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button className="button--uri-indicator" navigate={channelLink}>
|
<Button className="button--uri-indicator" navigate={channelLink}>
|
||||||
<Tooltip label={'test' || <ClaimPreview uri={channelLink} type="small" />}>{inner}</Tooltip>
|
<Tooltip label={<ClaimPreview uri={channelLink} type="small" />}>{inner}</Tooltip>
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import Button from 'component/button';
|
||||||
import { FormField } from 'component/common/form';
|
import { FormField } from 'component/common/form';
|
||||||
import UserEmailNew from 'component/userEmailNew';
|
import UserEmailNew from 'component/userEmailNew';
|
||||||
import UserEmailVerify from 'component/userEmailVerify';
|
import UserEmailVerify from 'component/userEmailVerify';
|
||||||
import cookie from 'cookie';
|
import UserEmailResetButton from 'component/userEmailResetButton';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
cancelButton: Node,
|
cancelButton: Node,
|
||||||
|
@ -21,14 +21,6 @@ type Props = {
|
||||||
|
|
||||||
function UserEmail(props: Props) {
|
function UserEmail(props: Props) {
|
||||||
const { email, user, accessToken, fetchAccessToken } = props;
|
const { email, user, accessToken, fetchAccessToken } = props;
|
||||||
const buttonsProps = IS_WEB
|
|
||||||
? {
|
|
||||||
onClick: () => {
|
|
||||||
document.cookie = cookie.serialize('auth_token', '');
|
|
||||||
window.location.reload();
|
|
||||||
},
|
|
||||||
}
|
|
||||||
: { href: 'https://lbry.com/faq/how-to-change-email' };
|
|
||||||
|
|
||||||
let isVerified = false;
|
let isVerified = false;
|
||||||
if (user) {
|
if (user) {
|
||||||
|
@ -71,7 +63,7 @@ function UserEmail(props: Props) {
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
}
|
}
|
||||||
value={email}
|
value={email}
|
||||||
inputButton={<Button button="inverse" label={__('Change')} {...buttonsProps} />}
|
inputButton={<UserEmailResetButton button="inverse" />}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<p className="help">
|
<p className="help">
|
||||||
|
|
11
src/ui/component/userEmailResetButton/index.js
Normal file
11
src/ui/component/userEmailResetButton/index.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import UserEmailResetButton from './view';
|
||||||
|
|
||||||
|
const select = state => ({});
|
||||||
|
|
||||||
|
const perform = dispatch => ({});
|
||||||
|
|
||||||
|
export default connect(
|
||||||
|
select,
|
||||||
|
perform
|
||||||
|
)(UserEmailResetButton);
|
24
src/ui/component/userEmailResetButton/view.jsx
Normal file
24
src/ui/component/userEmailResetButton/view.jsx
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
// @flow
|
||||||
|
import React from 'react';
|
||||||
|
import Button from 'component/button';
|
||||||
|
import cookie from 'cookie';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
button: string,
|
||||||
|
};
|
||||||
|
|
||||||
|
function UserEmailResetButton(props: Props) {
|
||||||
|
const { button = 'link' } = props;
|
||||||
|
const buttonsProps = IS_WEB
|
||||||
|
? {
|
||||||
|
onClick: () => {
|
||||||
|
document.cookie = cookie.serialize('auth_token', '');
|
||||||
|
window.location.reload();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
: { href: 'https://lbry.com/faq/how-to-change-email' };
|
||||||
|
|
||||||
|
return <Button button={button} label={__('Change')} {...buttonsProps} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default UserEmailResetButton;
|
|
@ -1,7 +1,7 @@
|
||||||
// @flow
|
// @flow
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import cookie from 'cookie';
|
import UserEmailResetButton from 'component/userEmailResetButton';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
email: string,
|
email: string,
|
||||||
|
@ -49,18 +49,6 @@ class UserEmailVerify extends React.PureComponent<Props> {
|
||||||
render() {
|
render() {
|
||||||
const { email } = this.props;
|
const { email } = this.props;
|
||||||
|
|
||||||
// Below is duplicated in UserEmail
|
|
||||||
// This should just be a UserEmailResetButton component
|
|
||||||
const buttonProps = IS_WEB
|
|
||||||
? {
|
|
||||||
onClick: () => {
|
|
||||||
clearInterval(this.emailVerifyCheckInterval);
|
|
||||||
document.cookie = cookie.serialize('auth_token', '');
|
|
||||||
window.location.reload();
|
|
||||||
},
|
|
||||||
}
|
|
||||||
: { href: 'https://lbry.com/faq/how-to-change-email' };
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<header className="card__header">
|
<header className="card__header">
|
||||||
|
@ -80,7 +68,7 @@ class UserEmailVerify extends React.PureComponent<Props> {
|
||||||
onClick={this.handleResendVerificationEmail}
|
onClick={this.handleResendVerificationEmail}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button button="link" label={__('Reset')} {...buttonProps} />
|
<UserEmailResetButton />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p className="help">
|
<p className="help">
|
||||||
|
|
|
@ -186,12 +186,3 @@
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
padding-right: var(--spacing-medium);
|
padding-right: var(--spacing-medium);
|
||||||
}
|
}
|
||||||
|
|
||||||
.claim-preview-tags {
|
|
||||||
margin-left: 0;
|
|
||||||
|
|
||||||
// change this
|
|
||||||
.tag {
|
|
||||||
max-width: 10rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
.navigation-wrapper {
|
|
||||||
// width: var(--side-nav-width);
|
|
||||||
// left: calc(100% - var(--side-nav-width));
|
|
||||||
// height: 100%;
|
|
||||||
// position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navigation {
|
.navigation {
|
||||||
width: var(--side-nav-width);
|
width: var(--side-nav-width);
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
|
|
|
@ -72,7 +72,6 @@
|
||||||
box-shadow: 0 1px 5px rgba($lbry-black, 0.15);
|
box-shadow: 0 1px 5px rgba($lbry-black, 0.15);
|
||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
font-size: 14px;
|
|
||||||
|
|
||||||
[data-mode='dark'] & {
|
[data-mode='dark'] & {
|
||||||
background-color: $lbry-gray-5;
|
background-color: $lbry-gray-5;
|
||||||
|
|
|
@ -27,6 +27,7 @@ export function toQueryString(params) {
|
||||||
return parts.join('&');
|
return parts.join('&');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://stackoverflow.com/questions/5999118/how-can-i-add-or-update-a-query-string-parameter
|
||||||
export function updateQueryParam(uri, key, value) {
|
export function updateQueryParam(uri, key, value) {
|
||||||
const re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i');
|
const re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i');
|
||||||
const separator = uri.indexOf('?') !== -1 ? '&' : '?';
|
const separator = uri.indexOf('?') !== -1 ? '&' : '?';
|
||||||
|
|
Loading…
Add table
Reference in a new issue