Revert "cleanup"

This reverts commit 54c09edec8.
This commit is contained in:
Sean Yesmunt 2019-10-03 14:24:45 -04:00
parent 87c311a42c
commit 567ef04fcb
15 changed files with 43 additions and 98 deletions

View file

@ -128,8 +128,8 @@
"husky": "^0.14.3", "husky": "^0.14.3",
"json-loader": "^0.5.4", "json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git", "lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#74f55ba9e3b81b5364788a8cbdd89bd2884d40d0", "lbry-redux": "lbryio/lbry-redux#973d28e46290c77f2d9d468304008f80f71fd8cd",
"lbryinc": "lbryio/lbryinc#5aba3127c879f5aaa9b1eccaf57aae97449df183", "lbryinc": "lbryio/lbryinc#7c94a38683344262fe34773dc50bfbe6d2a9e116",
"lint-staged": "^7.0.2", "lint-staged": "^7.0.2",
"localforage": "^1.7.1", "localforage": "^1.7.1",
"lodash-es": "^4.17.14", "lodash-es": "^4.17.14",

View file

@ -186,7 +186,6 @@ function ChannelForm(props: Props) {
suggestMature suggestMature
help={__('The better your tags are, the easier it will be for people to discover your channel.')} help={__('The better your tags are, the easier it will be for people to discover your channel.')}
empty={__('No tags added')} empty={__('No tags added')}
placeholder={__('Add a tag')}
onSelect={newTag => { onSelect={newTag => {
if (!params.tags.map(savedTag => savedTag.name).includes(newTag.name)) { if (!params.tags.map(savedTag => savedTag.name).includes(newTag.name)) {
setParams({ ...params, tags: [...params.tags, newTag] }); setParams({ ...params, tags: [...params.tags, newTag] });

View file

@ -78,8 +78,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
properties, properties,
onClick, onClick,
} = props; } = props;
const shouldFetch = const shouldFetch = claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta));
claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending);
const abandoned = !isResolvingUri && !claim; const abandoned = !isResolvingUri && !claim;
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0; const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
const showPublishLink = abandoned && placeholder === 'publish'; const showPublishLink = abandoned && placeholder === 'publish';

View file

@ -37,7 +37,7 @@ class InviteList extends React.PureComponent<Props> {
return ( return (
<section className="card"> <section className="card">
<div className="table__header"> <div className="table__header">
<h2 className="card__title--between"> <h2 className="card__title">
{__('Invite History')} {__('Invite History')}
{referralReward && showClaimable && ( {referralReward && showClaimable && (
<RewardLink <RewardLink

View file

@ -34,9 +34,7 @@ function PublishFile(props: Props) {
icon={ICONS.PUBLISH} icon={ICONS.PUBLISH}
disabled={disabled || balance === 0} disabled={disabled || balance === 0}
title={isStillEditing ? __('Edit') : __('Publish')} title={isStillEditing ? __('Edit') : __('Publish')}
subtitle={ subtitle={isStillEditing ? __('You are currently editing a claim.') : __('Jeremy please change this.')}
isStillEditing ? __('You are currently editing a claim.') : __('Publish something totally wacky and wild.')
}
actions={ actions={
<React.Fragment> <React.Fragment>
<FileSelector currentPath={filePath} onFileChosen={handleFileChange} /> <FileSelector currentPath={filePath} onFileChosen={handleFileChange} />

View file

@ -135,7 +135,6 @@ function PublishForm(props: Props) {
suggestMature suggestMature
help={__('The better your tags are, the easier it will be for people to discover your content.')} help={__('The better your tags are, the easier it will be for people to discover your content.')}
empty={__('No tags added')} empty={__('No tags added')}
placeholder={__('Add a tag')}
onSelect={newTag => { onSelect={newTag => {
if (!tags.map(savedTag => savedTag.name).includes(newTag.name)) { if (!tags.map(savedTag => savedTag.name).includes(newTag.name)) {
updatePublishForm({ tags: [...tags, newTag] }); updatePublishForm({ tags: [...tags, newTag] });

View file

@ -3,7 +3,7 @@ import React from 'react';
import { Form, FormField } from 'component/common/form'; import { Form, FormField } from 'component/common/form';
import Button from 'component/button'; import Button from 'component/button';
import Card from 'component/common/card'; import Card from 'component/common/card';
import { setSavedPassword, deleteSavedPassword } from 'util/saved-passwords'; import { setSavedPassword } from 'util/saved-passwords';
type Props = { type Props = {
getSync: (?string) => void, getSync: (?string) => void,
@ -18,8 +18,6 @@ function SyncPassword(props: Props) {
function handleSubmit() { function handleSubmit() {
if (rememberPassword) { if (rememberPassword) {
setSavedPassword(password); setSavedPassword(password);
} else {
deleteSavedPassword();
} }
getSync(password); getSync(password);

View file

@ -12,10 +12,9 @@ type Props = {
onSelect?: Tag => void, onSelect?: Tag => void,
suggestMature?: boolean, suggestMature?: boolean,
onRemove: Tag => void, onRemove: Tag => void,
placeholder?: string,
}; };
export default function TagsSearch(props: Props) { export default function TagSelect(props: Props) {
const { const {
tagsPasssedIn, tagsPasssedIn,
unfollowedTags = [], unfollowedTags = [],
@ -25,7 +24,6 @@ export default function TagsSearch(props: Props) {
onSelect, onSelect,
onRemove, onRemove,
suggestMature, suggestMature,
placeholder,
} = props; } = props;
const [newTag, setNewTag] = useState(''); const [newTag, setNewTag] = useState('');
@ -98,7 +96,7 @@ export default function TagsSearch(props: Props) {
autoFocus autoFocus
className="tag__input" className="tag__input"
onChange={onChange} onChange={onChange}
placeholder={placeholder || __('Follow more tags')} placeholder={__('Follow more tags')}
type="text" type="text"
value={newTag} value={newTag}
/> />

View file

@ -20,7 +20,6 @@ type Props = {
tagsChosen?: Array<Tag>, tagsChosen?: Array<Tag>,
onSelect?: Tag => void, onSelect?: Tag => void,
onRemove?: Tag => void, onRemove?: Tag => void,
placeholder?: string,
}; };
export default function TagSelect(props: Props) { export default function TagSelect(props: Props) {
@ -34,7 +33,6 @@ export default function TagSelect(props: Props) {
onSelect, onSelect,
onRemove, onRemove,
suggestMature, suggestMature,
placeholder,
} = props; } = props;
const [hasClosed, setHasClosed] = usePersistedState('tag-select:has-closed', false); const [hasClosed, setHasClosed] = usePersistedState('tag-select:has-closed', false);
const tagsToDisplay = tagsChosen || followedTags; const tagsToDisplay = tagsChosen || followedTags;
@ -90,7 +88,6 @@ export default function TagSelect(props: Props) {
onSelect={onSelect} onSelect={onSelect}
suggestMature={suggestMature && !hasMatureTag} suggestMature={suggestMature && !hasMatureTag}
tagsPasssedIn={tagsToDisplay} tagsPasssedIn={tagsToDisplay}
placeholder={placeholder}
/> />
</React.Fragment> </React.Fragment>
} }

View file

@ -5,7 +5,6 @@ import Button from 'component/button';
import { Lbryio } from 'lbryinc'; import { Lbryio } from 'lbryinc';
import analytics from 'analytics'; import analytics from 'analytics';
import { EMAIL_REGEX } from 'constants/email'; import { EMAIL_REGEX } from 'constants/email';
import I18nMessage from 'component/i18nMessage';
type Props = { type Props = {
errorMessage: ?string, errorMessage: ?string,
@ -19,7 +18,6 @@ type Props = {
function UserEmailNew(props: Props) { function UserEmailNew(props: Props) {
const { errorMessage, isPending, addUserEmail, syncEnabled, setSync, balance } = props; const { errorMessage, isPending, addUserEmail, syncEnabled, setSync, balance } = props;
const [newEmail, setEmail] = useState(''); const [newEmail, setEmail] = useState('');
const [ageConfirmation, setAgeConfirmation] = useState(false);
const valid = newEmail.match(EMAIL_REGEX); const valid = newEmail.match(EMAIL_REGEX);
function handleSubmit() { function handleSubmit() {
@ -54,57 +52,28 @@ function UserEmailNew(props: Props) {
error={errorMessage} error={errorMessage}
onChange={e => setEmail(e.target.value)} onChange={e => setEmail(e.target.value)}
/> />
<div className="section"> {!IS_WEB && (
<FormField <FormField
type="checkbox" type="checkbox"
name="sync_checkbox" name="sync_checkbox"
label={ label={__('Sync balance and preferences across devices')}
<I18nMessage helper={
tokens={{ balance > 0 ? (
terms: ( __('This feature is not yet available for wallets with balances, but the gerbils are working on it.')
<Button button="link" href="https://www.lbry.com/termsofservice" label={__('Terms of Service')} /> ) : (
), <React.Fragment>
}} {__('Blockchain expert?')}{' '}
> <Button button="link" href="https://lbry.com/faq/account-sync" label={__('Learn More')} />
I am over the age of 13 and agree to the %terms%. </React.Fragment>
</I18nMessage> )
} }
checked={ageConfirmation} checked={syncEnabled}
onChange={() => setAgeConfirmation(!ageConfirmation)} onChange={() => setSync(!syncEnabled)}
disabled={balance > 0}
/> />
{!IS_WEB && ( )}
<FormField <div className="card__actions">
type="checkbox" <Button button="primary" type="submit" label={__('Continue')} disabled={!newEmail || !valid || isPending} />
name="sync_checkbox"
label={__('Sync balance and preferences across devices')}
helper={
balance > 0 ? (
__('This feature is not yet available for wallets with balances, but the gerbils are working on it.')
) : (
<I18nMessage
tokens={{
learn_more: (
<Button button="link" href="https://lbry.com/faq/account-sync" label={__('Learn More')} />
),
}}
>
Blockchain expert? %learn_more%
</I18nMessage>
)
}
checked={syncEnabled}
onChange={() => setSync(!syncEnabled)}
disabled={balance > 0}
/>
)}
<div className="card__actions">
<Button
button="primary"
type="submit"
label={__('Continue')}
disabled={!newEmail || !valid || !ageConfirmation || isPending}
/>
</div>
</div> </div>
</Form> </Form>
</div> </div>

View file

@ -60,6 +60,9 @@ function UserSignIn(props: Props) {
const channelCount = channels ? channels.length : 0; const channelCount = channels ? channels.length : 0;
const hasClaimedEmailAward = claimedRewards.some(reward => reward.reward_type === REWARDS.TYPE_CONFIRM_EMAIL); const hasClaimedEmailAward = claimedRewards.some(reward => reward.reward_type === REWARDS.TYPE_CONFIRM_EMAIL);
const hasYoutubeChannels = youtubeChannels && Boolean(youtubeChannels.length); const hasYoutubeChannels = youtubeChannels && Boolean(youtubeChannels.length);
// const hasTransferrableYoutubeChannels = hasYoutubeChannels && youtubeChannels.some(channel => channel.transferable);
// const hasPendingYoutubeTransfer =
// hasYoutubeChannels && youtubeChannels.some(channel => channel.transfer_state === YOUTUBE_STATUSES.PENDING_TRANSFER);
const isYoutubeTransferComplete = const isYoutubeTransferComplete =
hasYoutubeChannels && hasYoutubeChannels &&
youtubeChannels.every(channel => channel.transfer_state === YOUTUBE_STATUSES.COMPLETED_TRANSFER); youtubeChannels.every(channel => channel.transfer_state === YOUTUBE_STATUSES.COMPLETED_TRANSFER);
@ -68,12 +71,13 @@ function UserSignIn(props: Props) {
// We can't just check if we are currently fetching something // 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 // 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 // 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 // reward claiming (plus the balance updating after), channel creation, account syncing, and youtube transfer
const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !getSyncError; const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !getSyncError && balance === 0;
const isCurrentlyFetchingSomething = fetchingChannels || claimingReward || syncingWallet; const isCurrentlyFetchingSomething = fetchingChannels || claimingReward || syncingWallet;
const isWaitingForSomethingToFinish = const isWaitingForSomethingToFinish =
// If the user has claimed the email award, we need to wait until the balance updates sometime in the future // If the user has claimed the email award, we need to wait until the balance updates sometime in the future
(!hasFetchedReward && !hasClaimedEmailAward) || (syncEnabled && !hasSynced); !hasFetchedReward || (hasFetchedReward && balance === 0) || (syncEnabled && !hasSynced);
// The possible screens for the sign in flow // The possible screens for the sign in flow
const showEmail = !emailToVerify && !hasVerifiedEmail; const showEmail = !emailToVerify && !hasVerifiedEmail;
const showEmailVerification = emailToVerify && !hasVerifiedEmail; const showEmailVerification = emailToVerify && !hasVerifiedEmail;

View file

@ -33,7 +33,7 @@ import {
selectUpgradeTimer, selectUpgradeTimer,
selectModal, selectModal,
} from 'redux/selectors/app'; } from 'redux/selectors/app';
import { Lbryio, doAuthenticate, doGetSync, selectSyncHash, doResetSync } from 'lbryinc'; import { Lbryio, doAuthenticate, doGetSync, selectSyncHash } from 'lbryinc';
import { lbrySettings as config, version as appVersion } from 'package.json'; import { lbrySettings as config, version as appVersion } from 'package.json';
import { push } from 'connected-react-router'; import { push } from 'connected-react-router';
import analytics from 'analytics'; import analytics from 'analytics';
@ -465,7 +465,7 @@ export function doSignIn() {
const balance = selectBalance(state); const balance = selectBalance(state);
// For existing users, check if they've synced before, or have 0 balance // For existing users, check if they've synced before, or have 0 balance
if (syncEnabled && (syncHash || balance === 0)) { if (syncEnabled && (!syncHash || balance === 0)) {
dispatch(doGetSync()); dispatch(doGetSync());
} }
// @endif // @endif
@ -483,14 +483,9 @@ export function doSignOut() {
// @if TARGET='web' // @if TARGET='web'
window.persistor.purge(); window.persistor.purge();
// @endif // @endif
// @if TARGET='app'
return dispatch(doResetSync());
// @endif
}) })
.then(() => { .then(() => {
setTimeout(() => { location.reload();
location.reload();
});
}) })
.catch(() => location.reload()); .catch(() => location.reload());
}; };

View file

@ -40,7 +40,6 @@
.button--inverse { .button--inverse {
height: var(--button-height); height: var(--button-height);
border-radius: var(--button-radius); border-radius: var(--button-radius);
font-size: var(--font-body);
padding-top: 0; padding-top: 0;
padding-bottom: 0; padding-bottom: 0;
box-sizing: border-box; box-sizing: border-box;

View file

@ -773,6 +773,8 @@
"LBC Currently Staked": "LBC Currently Staked", "LBC Currently Staked": "LBC Currently Staked",
"Your Supports": "Your Supports", "Your Supports": "Your Supports",
"Add Tags": "Add Tags", "Add Tags": "Add Tags",
"Jeremy please change this": "Jeremy please change this",
"Jeremy please change this.": "Jeremy please change this.",
"Extra Verification Needed": "Extra Verification Needed", "Extra Verification Needed": "Extra Verification Needed",
"We weren't able to auto-approve you for rewards. Please complete one of the steps below to unlock them.": "We weren't able to auto-approve you for rewards. Please complete one of the steps below to unlock them.", "We weren't able to auto-approve you for rewards. Please complete one of the steps below to unlock them.": "We weren't able to auto-approve you for rewards. Please complete one of the steps below to unlock them.",
"Proof via Text": "Proof via Text", "Proof via Text": "Proof via Text",
@ -795,17 +797,5 @@
"You have no rewards available.": "You have no rewards available.", "You have no rewards available.": "You have no rewards available.",
"light": "light", "light": "light",
"dark": "dark", "dark": "dark",
"Dark": "Dark", "Dark": "Dark"
"Blockchain expert?": "Blockchain expert?", }
"Learn More": "Learn More",
"Creating": "Creating",
"Enter Your LBRY Password": "Enter Your LBRY Password",
"You set your wallet password when you previously installed LBRY.": "You set your wallet password when you previously installed LBRY.",
"Remember My Password": "Remember My Password",
"Failed to load translations.": "Failed to load translations.",
"Terms of Service": "Terms of Service",
"I am over the age of 13 and agree to the %terms%.": "I am over the age of 13 and agree to the %terms%.",
"Nothing published to LBRY yet.": "Nothing published to LBRY yet.",
"Add a tag": "Add a tag",
"Claim Your 20 LBC Invite Reward": "Claim Your 20 LBC Invite Reward"
}

View file

@ -6850,17 +6850,17 @@ lazy-val@^1.0.3, lazy-val@^1.0.4:
yargs "^13.2.2" yargs "^13.2.2"
zstd-codec "^0.1.1" zstd-codec "^0.1.1"
lbry-redux@lbryio/lbry-redux#74f55ba9e3b81b5364788a8cbdd89bd2884d40d0: lbry-redux@lbryio/lbry-redux#973d28e46290c77f2d9d468304008f80f71fd8cd:
version "0.0.1" version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/74f55ba9e3b81b5364788a8cbdd89bd2884d40d0" resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/973d28e46290c77f2d9d468304008f80f71fd8cd"
dependencies: dependencies:
proxy-polyfill "0.1.6" proxy-polyfill "0.1.6"
reselect "^3.0.0" reselect "^3.0.0"
uuid "^3.3.2" uuid "^3.3.2"
lbryinc@lbryio/lbryinc#5aba3127c879f5aaa9b1eccaf57aae97449df183: lbryinc@lbryio/lbryinc#7c94a38683344262fe34773dc50bfbe6d2a9e116:
version "0.0.1" version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/5aba3127c879f5aaa9b1eccaf57aae97449df183" resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/7c94a38683344262fe34773dc50bfbe6d2a9e116"
dependencies: dependencies:
reselect "^3.0.0" reselect "^3.0.0"