moar cleanup
This commit is contained in:
parent
e50bf992e2
commit
34b318754f
9 changed files with 53 additions and 23 deletions
13
src/ui/component/common/help-link.jsx
Normal file
13
src/ui/component/common/help-link.jsx
Normal 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} />;
|
||||||
|
}
|
|
@ -57,7 +57,7 @@ function UserEmailNew(props: Props) {
|
||||||
<div className="section">
|
<div className="section">
|
||||||
<FormField
|
<FormField
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
name="sync_checkbox"
|
name="age_checkbox"
|
||||||
label={
|
label={
|
||||||
<I18nMessage
|
<I18nMessage
|
||||||
tokens={{
|
tokens={{
|
||||||
|
|
|
@ -12,12 +12,10 @@ type Props = {
|
||||||
claimsBalance: number,
|
claimsBalance: number,
|
||||||
supportsBalance: number,
|
supportsBalance: number,
|
||||||
tipsBalance: number,
|
tipsBalance: number,
|
||||||
rewards: Array<Reward>,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const WalletBalance = (props: Props) => {
|
const WalletBalance = (props: Props) => {
|
||||||
const { balance, claimsBalance, supportsBalance, tipsBalance, rewards } = props;
|
const { balance, claimsBalance, supportsBalance, tipsBalance } = props;
|
||||||
const rewardTotal = rewards.reduce((acc, val) => acc + val.reward_amount, 0);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
|
@ -29,24 +27,12 @@ const WalletBalance = (props: Props) => {
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div className="section__actions">
|
<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}`} />
|
<Button button="inverse" label={__('Your Address')} navigate={`$/${PAGES.WALLET_RECEIVE}`} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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">
|
||||||
<div className="section__flex">
|
<div className="section__flex">
|
||||||
<Icon sectionIcon icon={ICONS.TIP} />
|
<Icon sectionIcon icon={ICONS.TIP} />
|
||||||
|
@ -54,7 +40,7 @@ const WalletBalance = (props: Props) => {
|
||||||
<strong>
|
<strong>
|
||||||
<CreditAmount badge={false} amount={tipsBalance} precision={8} />
|
<CreditAmount badge={false} amount={tipsBalance} precision={8} />
|
||||||
</strong>{' '}
|
</strong>{' '}
|
||||||
{__('Earned From Tips')}
|
{__('Earned and bound in tips')}
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -68,12 +54,12 @@ const WalletBalance = (props: Props) => {
|
||||||
</h2>
|
</h2>
|
||||||
<div className="section__subtitle">
|
<div className="section__subtitle">
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{__('Your Publishes')}</dt>
|
<dt>{__('... in your publishes')}</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<CreditAmount badge={false} amount={claimsBalance} precision={8} />
|
<CreditAmount badge={false} amount={claimsBalance} precision={8} />
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt>{__('Your Supports')}</dt>
|
<dt>{__('... in your supports')}</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<CreditAmount badge={false} amount={supportsBalance} precision={8} />
|
<CreditAmount badge={false} amount={supportsBalance} precision={8} />
|
||||||
</dd>
|
</dd>
|
||||||
|
|
|
@ -20,6 +20,7 @@ import * as MODALS from 'constants/modal_types';
|
||||||
import { Form, FormField } from 'component/common/form';
|
import { Form, FormField } from 'component/common/form';
|
||||||
import ClaimPreview from 'component/claimPreview';
|
import ClaimPreview from 'component/claimPreview';
|
||||||
import Icon from 'component/common/icon';
|
import Icon from 'component/common/icon';
|
||||||
|
import HelpLink from 'component/common/help-link';
|
||||||
|
|
||||||
const PAGE_VIEW_QUERY = `view`;
|
const PAGE_VIEW_QUERY = `view`;
|
||||||
const ABOUT_PAGE = `about`;
|
const ABOUT_PAGE = `about`;
|
||||||
|
@ -190,6 +191,7 @@ function ChannelPage(props: Props) {
|
||||||
<ClaimUri uri={uri} />
|
<ClaimUri uri={uri} />
|
||||||
<span>
|
<span>
|
||||||
{subCount} {subCount !== 1 ? __('Subscribers') : __('Subscriber')}
|
{subCount} {subCount !== 1 ? __('Subscribers') : __('Subscriber')}
|
||||||
|
<HelpLink href="https://lbry.com/faq/views" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -18,6 +18,7 @@ import CommentsList from 'component/commentsList';
|
||||||
import CommentCreate from 'component/commentCreate';
|
import CommentCreate from 'component/commentCreate';
|
||||||
import ClaimUri from 'component/claimUri';
|
import ClaimUri from 'component/claimUri';
|
||||||
import ClaimPreview from 'component/claimPreview';
|
import ClaimPreview from 'component/claimPreview';
|
||||||
|
import HelpLink from 'component/common/help-link';
|
||||||
|
|
||||||
export const FILE_WRAPPER_CLASS = 'grid-area--content';
|
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} />
|
<DateTime uri={uri} show={DateTime.SHOW_DATE} />
|
||||||
<span>
|
<span>
|
||||||
{viewCount} {viewCount !== 1 ? __('Views') : __('View')}
|
{viewCount} {viewCount !== 1 ? __('Views') : __('View')}
|
||||||
|
<HelpLink href="https://lbry.com/faq/views" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -511,6 +511,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{/* @if TARGET='app' */}
|
{/* @if TARGET='app' */}
|
||||||
<FormField
|
<FormField
|
||||||
|
disabled
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
name="encrypt_wallet"
|
name="encrypt_wallet"
|
||||||
onChange={() => this.onChangeEncryptWallet()}
|
onChange={() => this.onChangeEncryptWallet()}
|
||||||
|
@ -518,9 +519,19 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
||||||
label={__('Encrypt my wallet with a custom password')}
|
label={__('Encrypt my wallet with a custom password')}
|
||||||
helper={
|
helper={
|
||||||
<React.Fragment>
|
<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>
|
<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>
|
</React.Fragment>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -467,6 +467,10 @@ export function doSignIn() {
|
||||||
// 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());
|
||||||
|
|
||||||
|
setInterval(() => {
|
||||||
|
dispatch(doGetSync());
|
||||||
|
}, 1000 * 60 * 5);
|
||||||
}
|
}
|
||||||
// @endif
|
// @endif
|
||||||
|
|
||||||
|
|
|
@ -20,3 +20,11 @@
|
||||||
background-color: var(--color-card-actions--dark);
|
background-color: var(--color-card-actions--dark);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon--help {
|
||||||
|
margin-left: var(--spacing-small);
|
||||||
|
bottom: -0.3rem;
|
||||||
|
opacity: 0.7;
|
||||||
|
height: 1rem;
|
||||||
|
width: 1rem;
|
||||||
|
}
|
||||||
|
|
|
@ -818,5 +818,9 @@
|
||||||
"You aren’t blocking any channels": "You aren’t blocking any channels",
|
"You aren’t blocking any channels": "You aren’t 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.",
|
"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",
|
"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"
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue