more cleanup

This commit is contained in:
Sean Yesmunt 2019-09-30 15:52:53 -04:00
parent 22548f4304
commit 044076ca1d
9 changed files with 59 additions and 50 deletions

View file

@ -27,6 +27,7 @@ function SyncPassword(props: Props) {
<Form onSubmit={handleSubmit}> <Form onSubmit={handleSubmit}>
<Card <Card
title={__('Enter Your LBRY Password')} title={__('Enter Your LBRY Password')}
subtitle={__('You set your wallet password when you previously installed LBRY.')}
actions={ actions={
<div> <div>
<FormField <FormField

View file

@ -52,19 +52,26 @@ function UserEmailNew(props: Props) {
error={errorMessage} error={errorMessage}
onChange={e => setEmail(e.target.value)} onChange={e => setEmail(e.target.value)}
/> />
<FormField {!IS_WEB && (
type="checkbox" <FormField
name="sync_checkbox" type="checkbox"
label={__('Sync your balance between devices')} name="sync_checkbox"
helper={ label={__('Sync balance and preferences across devices')}
balance > 0 helper={
? __("This is only available if you don't have a balance") balance > 0 ? (
: __('Maybe some more text about something') __('This feature is not yet available for wallets with balances, but the gerbils are working on it.')
} ) : (
checked={syncEnabled} <React.Fragment>
onChange={() => setSync(!syncEnabled)} {__('Blockchain expert?')}{' '}
disabled={balance > 0} <Button button="link" href="https://lbry.com/faq/account-sync" label={__('Learn More')} />
/> </React.Fragment>
)
}
checked={syncEnabled}
onChange={() => setSync(!syncEnabled)}
disabled={balance > 0}
/>
)}
<div className="card__actions"> <div className="card__actions">
<Button button="primary" type="submit" label={__('Continue')} disabled={!newEmail || !valid || isPending} /> <Button button="primary" type="submit" label={__('Continue')} disabled={!newEmail || !valid || isPending} />
</div> </div>

View file

@ -21,29 +21,14 @@ export default function YoutubeTransferStatus(props: Props) {
const { youtubeChannels, ytImportPending, claimChannels, videosImported, checkYoutubeTransfer, updateUser } = props; const { youtubeChannels, ytImportPending, claimChannels, videosImported, checkYoutubeTransfer, updateUser } = props;
const hasChannels = youtubeChannels && youtubeChannels.length; const hasChannels = youtubeChannels && youtubeChannels.length;
let transferEnabled = false; const transferEnabled = youtubeChannels.some(status => status.transferable);
let transferStarted = false; const hasPendingTransfers = youtubeChannels.some(status => status.transfer_state === PENDING_TRANSFER);
let transferComplete = false; const hasCompleteTransfers = youtubeChannels.some(status => status.transfer_state === COMPLETED_TRANSFER);
if (hasChannels) { console.log('?', hasChannels && (hasPendingTransfers || (!hasPendingTransfers && !hasCompleteTransfers)));
for (var i = 0; i < youtubeChannels.length; i++) {
const { transfer_state: transferState, transferable } = youtubeChannels[i];
if (transferable) {
transferEnabled = true;
}
if (transferState === COMPLETED_TRANSFER) {
transferComplete = true;
}
if (transferState === PENDING_TRANSFER) {
transferStarted = true;
}
}
}
let total; let total;
let complete; let complete;
if (!transferComplete && videosImported) { if (hasPendingTransfers && videosImported) {
complete = videosImported[0]; complete = videosImported[0];
total = videosImported[1]; total = videosImported[1];
} }
@ -66,7 +51,7 @@ export default function YoutubeTransferStatus(props: Props) {
React.useEffect(() => { React.useEffect(() => {
// If a channel is transferrable, theres nothing to check // If a channel is transferrable, theres nothing to check
if (transferStarted && !transferComplete) { if (hasPendingTransfers) {
checkYoutubeTransfer(); checkYoutubeTransfer();
let interval = setInterval(() => { let interval = setInterval(() => {
@ -78,17 +63,17 @@ export default function YoutubeTransferStatus(props: Props) {
clearInterval(interval); clearInterval(interval);
}; };
} }
}, [transferComplete, transferStarted, checkYoutubeTransfer, updateUser]); }, [hasPendingTransfers, checkYoutubeTransfer, updateUser]);
return ( return (
hasChannels && hasChannels &&
!transferComplete && ( (hasPendingTransfers || transferEnabled) && (
<div> <div>
<Card <Card
title={youtubeChannels.length > 1 ? __('Your YouTube Channels') : __('Your YouTube Channel')} title={youtubeChannels.length > 1 ? __('Your YouTube Channels') : __('Your YouTube Channel')}
subtitle={ subtitle={
<span> <span>
{transferStarted {hasPendingTransfers
? __('Your videos are currently being transferred. There is nothing else for you to do.') ? __('Your videos are currently being transferred. There is nothing else for you to do.')
: __('Your videos are ready to be transferred.')} : __('Your videos are ready to be transferred.')}
</span> </span>
@ -113,10 +98,14 @@ export default function YoutubeTransferStatus(props: Props) {
</section> </section>
} }
actions={ actions={
transferEnabled && transferEnabled && (
!ytImportPending && (
<div className="card__actions"> <div className="card__actions">
<Button button="primary" onClick={claimChannels} label={__('Claim Channels')} /> <Button
button="primary"
disabled={ytImportPending}
onClick={claimChannels}
label={youtubeChannels.length > 1 ? __('Claim Channels') : __('Claim Channel')}
/>
<Button button="link" label={__('Learn more')} href="https://lbry.com/faq/youtube#transfer" /> <Button button="link" label={__('Learn more')} href="https://lbry.com/faq/youtube#transfer" />
</div> </div>
) )

View file

@ -27,7 +27,7 @@ export default function ChannelsPage(props: Props) {
{channels && channels.length ? ( {channels && channels.length ? (
<div className="card"> <div className="card">
<ClaimList <ClaimList
header={__('Your Channels On LBRY')} header={__('Your Channels')}
loading={fetchingChannels} loading={fetchingChannels}
uris={channels.map(channel => channel.permanent_url)} uris={channels.map(channel => channel.permanent_url)}
/> />

View file

@ -56,6 +56,11 @@
stroke: $lbry-white; stroke: $lbry-white;
} }
} }
[data-mode='dark'] & {
border-color: $lbry-teal-4;
color: $lbry-teal-3;
}
} }
.button--alt { .button--alt {

View file

@ -60,6 +60,10 @@ textarea {
border-radius: var(--input-border-radius); border-radius: var(--input-border-radius);
background-color: $lbry-white; background-color: $lbry-white;
border-width: 1px; border-width: 1px;
[data-mode='dark'] & {
background-color: var(--dm-color-02);
}
} }
fieldset-section { fieldset-section {
@ -69,6 +73,10 @@ fieldset-section {
width: auto; width: auto;
text-transform: none; text-transform: none;
color: lighten($lbry-black, 20%); color: lighten($lbry-black, 20%);
[data-mode='dark'] & {
color: $lbry-gray-3;
}
} }
} }

View file

@ -23,7 +23,6 @@
overflow: auto; overflow: auto;
padding: var(--spacing-large); padding: var(--spacing-large);
word-break: break-word; word-break: break-word;
box-shadow: none;
@media (min-width: 501px) { @media (min-width: 501px) {
min-width: 500px; min-width: 500px;

View file

@ -40,7 +40,7 @@
} }
.navigation-links__inline { .navigation-links__inline {
margin-left: 1.7rem; margin-left: calc(var(--spacing-medium) + var(--spacing-small));
} }
.navigation-link__wrapper { .navigation-link__wrapper {

View file

@ -40,16 +40,16 @@ $main: $lbry-teal-5;
// Nested style needed for more specificity // Nested style needed for more specificity
.tag__input { .tag__input {
@extend .tag--remove; @extend .tag--remove;
border: 1px dashed;
border-color: $lbry-teal-5;
background-color: mix($lbry-teal-1, $lbry-white, 10%);
height: auto; height: auto;
padding: calc(var(--spacing-miniscule) - 1px) var(--spacing-small); padding: calc(var(--spacing-miniscule) - 1px) var(--spacing-small);
margin-top: -2px; background-color: mix($lbry-teal-1, $lbry-white, 10%);
border: 1px dashed lighten($lbry-teal-5, 10%); border: 1px dashed;
border-color: lighten($lbry-teal-5, 10%);
margin-top: -2px; // To handle the border height
::placeholder { [data-mode='dark'] & {
color: black; background-color: var(--dm-color-02);
border-color: $lbry-white;
} }
} }
} }