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",
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#74f55ba9e3b81b5364788a8cbdd89bd2884d40d0",
"lbryinc": "lbryio/lbryinc#5aba3127c879f5aaa9b1eccaf57aae97449df183",
"lbry-redux": "lbryio/lbry-redux#973d28e46290c77f2d9d468304008f80f71fd8cd",
"lbryinc": "lbryio/lbryinc#7c94a38683344262fe34773dc50bfbe6d2a9e116",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",
"lodash-es": "^4.17.14",

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -60,6 +60,9 @@ function UserSignIn(props: Props) {
const channelCount = channels ? channels.length : 0;
const hasClaimedEmailAward = claimedRewards.some(reward => reward.reward_type === REWARDS.TYPE_CONFIRM_EMAIL);
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 =
hasYoutubeChannels &&
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 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
const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !getSyncError;
// reward claiming (plus the balance updating after), channel creation, account syncing, and youtube transfer
const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !getSyncError && balance === 0;
const isCurrentlyFetchingSomething = fetchingChannels || claimingReward || syncingWallet;
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);
!hasFetchedReward || (hasFetchedReward && balance === 0) || (syncEnabled && !hasSynced);
// The possible screens for the sign in flow
const showEmail = !emailToVerify && !hasVerifiedEmail;
const showEmailVerification = emailToVerify && !hasVerifiedEmail;

View file

@ -33,7 +33,7 @@ import {
selectUpgradeTimer,
selectModal,
} 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 { push } from 'connected-react-router';
import analytics from 'analytics';
@ -465,7 +465,7 @@ export function doSignIn() {
const balance = selectBalance(state);
// 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());
}
// @endif
@ -483,14 +483,9 @@ export function doSignOut() {
// @if TARGET='web'
window.persistor.purge();
// @endif
// @if TARGET='app'
return dispatch(doResetSync());
// @endif
})
.then(() => {
setTimeout(() => {
location.reload();
});
location.reload();
})
.catch(() => location.reload());
};

View file

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

View file

@ -773,6 +773,8 @@
"LBC Currently Staked": "LBC Currently Staked",
"Your Supports": "Your Supports",
"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",
"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",
@ -795,17 +797,5 @@
"You have no rewards available.": "You have no rewards available.",
"light": "light",
"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"
"Dark": "Dark"
}

View file

@ -6850,17 +6850,17 @@ lazy-val@^1.0.3, lazy-val@^1.0.4:
yargs "^13.2.2"
zstd-codec "^0.1.1"
lbry-redux@lbryio/lbry-redux#74f55ba9e3b81b5364788a8cbdd89bd2884d40d0:
lbry-redux@lbryio/lbry-redux#973d28e46290c77f2d9d468304008f80f71fd8cd:
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:
proxy-polyfill "0.1.6"
reselect "^3.0.0"
uuid "^3.3.2"
lbryinc@lbryio/lbryinc#5aba3127c879f5aaa9b1eccaf57aae97449df183:
lbryinc@lbryio/lbryinc#7c94a38683344262fe34773dc50bfbe6d2a9e116:
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:
reselect "^3.0.0"