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}>
<Card
title={__('Enter Your LBRY Password')}
subtitle={__('You set your wallet password when you previously installed LBRY.')}
actions={
<div>
<FormField

View file

@ -52,19 +52,26 @@ function UserEmailNew(props: Props) {
error={errorMessage}
onChange={e => setEmail(e.target.value)}
/>
{!IS_WEB && (
<FormField
type="checkbox"
name="sync_checkbox"
label={__('Sync your balance between devices')}
label={__('Sync balance and preferences across devices')}
helper={
balance > 0
? __("This is only available if you don't have a balance")
: __('Maybe some more text about something')
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={syncEnabled}
onChange={() => setSync(!syncEnabled)}
disabled={balance > 0}
/>
)}
<div className="card__actions">
<Button button="primary" type="submit" label={__('Continue')} disabled={!newEmail || !valid || isPending} />
</div>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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