so much discovery I can't take it #2617

Merged
neb-b merged 20 commits from fixes into master 2019-07-23 01:45:30 +02:00
10 changed files with 42 additions and 43 deletions
Showing only changes of commit 4c52b96796 - Show all commits

View file

@ -51,7 +51,7 @@ function App(props: Props) {
}, [userId]);
return (
<div className="main-wrapper" ref={appRef} onContextMenu={e => openContextMenu(e)}>
<div className={MAIN_WRAPPER_CLASS} ref={appRef} onContextMenu={e => openContextMenu(e)}>
<Header />
<div className="main-wrapper__inner">

View file

@ -63,7 +63,7 @@ class UriIndicator extends React.PureComponent<Props> {
return (
<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>
);
} else {

View file

@ -5,7 +5,7 @@ import Button from 'component/button';
import { FormField } from 'component/common/form';
import UserEmailNew from 'component/userEmailNew';
import UserEmailVerify from 'component/userEmailVerify';
import cookie from 'cookie';
import UserEmailResetButton from 'component/userEmailResetButton';
type Props = {
cancelButton: Node,
@ -21,14 +21,6 @@ type Props = {
function UserEmail(props: 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;
if (user) {
@ -71,7 +63,7 @@ function UserEmail(props: Props) {
</React.Fragment>
}
value={email}
inputButton={<Button button="inverse" label={__('Change')} {...buttonsProps} />}
inputButton={<UserEmailResetButton button="inverse" />}
/>
)}
<p className="help">

View 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);

View 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;

View file

@ -1,7 +1,7 @@
// @flow
import * as React from 'react';
import Button from 'component/button';
import cookie from 'cookie';
import UserEmailResetButton from 'component/userEmailResetButton';
type Props = {
email: string,
@ -49,18 +49,6 @@ class UserEmailVerify extends React.PureComponent<Props> {
render() {
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 (
<React.Fragment>
<header className="card__header">
@ -80,7 +68,7 @@ class UserEmailVerify extends React.PureComponent<Props> {
onClick={this.handleResendVerificationEmail}
/>
<Button button="link" label={__('Reset')} {...buttonProps} />
<UserEmailResetButton />
</div>
<p className="help">

View file

@ -186,12 +186,3 @@
margin-right: auto;
padding-right: var(--spacing-medium);
}
.claim-preview-tags {
margin-left: 0;
// change this
.tag {
max-width: 10rem;
}
}

View file

@ -1,10 +1,3 @@
.navigation-wrapper {
// width: var(--side-nav-width);
// left: calc(100% - var(--side-nav-width));
// height: 100%;
// position: absolute;
}
.navigation {
width: var(--side-nav-width);
font-size: 1.4rem;

View file

@ -72,7 +72,6 @@
box-shadow: 0 1px 5px rgba($lbry-black, 0.15);
min-width: 100%;
overflow: hidden;
font-size: 14px;
[data-mode='dark'] & {
background-color: $lbry-gray-5;

View file

@ -27,6 +27,7 @@ export function toQueryString(params) {
return parts.join('&');
}
// https://stackoverflow.com/questions/5999118/how-can-i-add-or-update-a-query-string-parameter
export function updateQueryParam(uri, key, value) {
const re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i');
const separator = uri.indexOf('?') !== -1 ? '&' : '?';