moar cleanup

This commit is contained in:
Sean Yesmunt 2019-10-03 13:36:35 -04:00
parent e50bf992e2
commit 34b318754f
9 changed files with 53 additions and 23 deletions

View file

@ -0,0 +1,13 @@
// @flow
import * as ICONS from 'constants/icons';
import React from 'react';
import Button from 'component/button';
type Props = {
href: string,
};
export default function HelpLink(props: Props) {
const { href } = props;
return <Button className="icon--help" icon={ICONS.HELP} description={__('Help')} href={href} />;
}

View file

@ -57,7 +57,7 @@ function UserEmailNew(props: Props) {
<div className="section">
<FormField
type="checkbox"
name="sync_checkbox"
name="age_checkbox"
label={
<I18nMessage
tokens={{

View file

@ -12,12 +12,10 @@ type Props = {
claimsBalance: number,
supportsBalance: number,
tipsBalance: number,
rewards: Array<Reward>,
};
const WalletBalance = (props: Props) => {
const { balance, claimsBalance, supportsBalance, tipsBalance, rewards } = props;
const rewardTotal = rewards.reduce((acc, val) => acc + val.reward_amount, 0);
const { balance, claimsBalance, supportsBalance, tipsBalance } = props;
return (
<React.Fragment>
@ -29,24 +27,12 @@ const WalletBalance = (props: Props) => {
</span>
<div className="section__actions">
<Button button="inverse" label={__('Send Credits')} navigate={`$/${PAGES.WALLET_SEND}`} />
<Button button="inverse" icon={ICONS.SEND} label={__('Send Credits')} navigate={`$/${PAGES.WALLET_SEND}`} />
<Button button="inverse" label={__('Your Address')} navigate={`$/${PAGES.WALLET_RECEIVE}`} />
</div>
</div>
<div>
<div className="section">
<div className="section__flex">
<Icon sectionIcon icon={ICONS.FEATURED} />
<h2 className="section__title--small">
<strong>
<CreditAmount badge={false} amount={rewardTotal} precision={8} />
</strong>{' '}
{__('Earned From Rewards')}
</h2>
</div>
</div>
<div className="section">
<div className="section__flex">
<Icon sectionIcon icon={ICONS.TIP} />
@ -54,7 +40,7 @@ const WalletBalance = (props: Props) => {
<strong>
<CreditAmount badge={false} amount={tipsBalance} precision={8} />
</strong>{' '}
{__('Earned From Tips')}
{__('Earned and bound in tips')}
</h2>
</div>
</div>
@ -68,12 +54,12 @@ const WalletBalance = (props: Props) => {
</h2>
<div className="section__subtitle">
<dl>
<dt>{__('Your Publishes')}</dt>
<dt>{__('... in your publishes')}</dt>
<dd>
<CreditAmount badge={false} amount={claimsBalance} precision={8} />
</dd>
<dt>{__('Your Supports')}</dt>
<dt>{__('... in your supports')}</dt>
<dd>
<CreditAmount badge={false} amount={supportsBalance} precision={8} />
</dd>

View file

@ -20,6 +20,7 @@ import * as MODALS from 'constants/modal_types';
import { Form, FormField } from 'component/common/form';
import ClaimPreview from 'component/claimPreview';
import Icon from 'component/common/icon';
import HelpLink from 'component/common/help-link';
const PAGE_VIEW_QUERY = `view`;
const ABOUT_PAGE = `about`;
@ -190,6 +191,7 @@ function ChannelPage(props: Props) {
<ClaimUri uri={uri} />
<span>
{subCount} {subCount !== 1 ? __('Subscribers') : __('Subscriber')}
<HelpLink href="https://lbry.com/faq/views" />
</span>
</div>
</div>

View file

@ -18,6 +18,7 @@ import CommentsList from 'component/commentsList';
import CommentCreate from 'component/commentCreate';
import ClaimUri from 'component/claimUri';
import ClaimPreview from 'component/claimPreview';
import HelpLink from 'component/common/help-link';
export const FILE_WRAPPER_CLASS = 'grid-area--content';
@ -161,6 +162,7 @@ class FilePage extends React.Component<Props> {
<DateTime uri={uri} show={DateTime.SHOW_DATE} />
<span>
{viewCount} {viewCount !== 1 ? __('Views') : __('View')}
<HelpLink href="https://lbry.com/faq/views" />
</span>
</div>

View file

@ -511,6 +511,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
<React.Fragment>
{/* @if TARGET='app' */}
<FormField
disabled
type="checkbox"
name="encrypt_wallet"
onChange={() => this.onChangeEncryptWallet()}
@ -518,9 +519,19 @@ class SettingsPage extends React.PureComponent<Props, State> {
label={__('Encrypt my wallet with a custom password')}
helper={
<React.Fragment>
{__('Secure your local wallet data with a custom password.')}{' '}
<I18nMessage
tokens={{
learn_more: (
<Button button="link" label={__('Learn more')} href="https://lbry.com/faq/account-sync" />
),
}}
>
Wallet encryption is currently unavailable until it's supported for synced accounts. It will
be added back soon. %learn_more%
</I18nMessage>
{/* {__('Secure your local wallet data with a custom password.')}{' '}
<strong>{__('Lost passwords cannot be recovered.')} </strong>
<Button button="link" label={__('Learn more')} href="https://lbry.com/faq/wallet-encryption" />.
<Button button="link" label={__('Learn more')} href="https://lbry.com/faq/wallet-encryption" />. */}
</React.Fragment>
}
/>

View file

@ -467,6 +467,10 @@ export function doSignIn() {
// For existing users, check if they've synced before, or have 0 balance
if (syncEnabled && (syncHash || balance === 0)) {
dispatch(doGetSync());
setInterval(() => {
dispatch(doGetSync());
}, 1000 * 60 * 5);
}
// @endif

View file

@ -20,3 +20,11 @@
background-color: var(--color-card-actions--dark);
}
}
.icon--help {
margin-left: var(--spacing-small);
bottom: -0.3rem;
opacity: 0.7;
height: 1rem;
width: 1rem;
}

View file

@ -818,5 +818,9 @@
"You arent blocking any channels": "You arent blocking any channels",
"When you block a channel, all content from that channel will be hidden.": "When you block a channel, all content from that channel will be hidden.",
"dfsdfsdf": "dfsdfsdf",
"Light": "Light"
"Light": "Light",
"Wallet encryption is currently unavailable until it's supported for synced accounts. It will be added back soon. %learn_more%": "Wallet encryption is currently unavailable until it's supported for synced accounts. It will be added back soon. %learn_more%",
"... in your publishes": "... in your publishes",
"... in your supports": "... in your supports",
"Earned and bound in tips": "Earned and bound in tips"
}