prettier
This commit is contained in:
parent
62935a15cd
commit
102665ac62
129 changed files with 391 additions and 1164 deletions
|
@ -20,9 +20,7 @@ export default window => {
|
|||
}
|
||||
}
|
||||
|
||||
tray = new Tray(
|
||||
process.env.NODE_ENV === 'development' ? iconPath : path.join(process.resourcesPath, iconPath)
|
||||
);
|
||||
tray = new Tray(process.env.NODE_ENV === 'development' ? iconPath : path.join(process.resourcesPath, iconPath));
|
||||
|
||||
tray.on('double-click', () => {
|
||||
window.show();
|
||||
|
|
|
@ -48,10 +48,7 @@ export default appState => {
|
|||
|
||||
let deepLinkingURI;
|
||||
|
||||
if (
|
||||
(process.platform === 'win32' || process.platform === 'linux') &&
|
||||
String(process.argv[1]).startsWith('lbry')
|
||||
) {
|
||||
if ((process.platform === 'win32' || process.platform === 'linux') && String(process.argv[1]).startsWith('lbry')) {
|
||||
[, deepLinkingURI] = process.argv || '';
|
||||
// Keep only command line / deep linked arguments
|
||||
// Windows normalizes URIs when they're passed in from other apps. On Windows, this tries to
|
||||
|
|
|
@ -15,9 +15,7 @@ const logRealtime = str => {
|
|||
};
|
||||
|
||||
console.log(
|
||||
chalk.magenta(
|
||||
`Compiling ${chalk.underline('main')} and ${chalk.underline('render')}, this will take a while.`
|
||||
)
|
||||
chalk.magenta(`Compiling ${chalk.underline('main')} and ${chalk.underline('render')}, this will take a while.`)
|
||||
);
|
||||
|
||||
let [mainConfig, renderConfig] = require('../../../webpack.electron.config.js');
|
||||
|
@ -52,12 +50,8 @@ app.listen(8080, () => {
|
|||
console.log(chalk.yellow.bold('Renderer listening on port 8080 (still compiling)'));
|
||||
});
|
||||
|
||||
mainInstance.waitUntilValid(() =>
|
||||
console.log(chalk.green(`${chalk.underline('main')} compilation complete.`))
|
||||
);
|
||||
renderInstance.waitUntilValid(() =>
|
||||
console.log(chalk.green(`${chalk.underline('render')} compilation complete.`))
|
||||
);
|
||||
mainInstance.waitUntilValid(() => console.log(chalk.green(`${chalk.underline('main')} compilation complete.`)));
|
||||
renderInstance.waitUntilValid(() => console.log(chalk.green(`${chalk.underline('render')} compilation complete.`)));
|
||||
|
||||
mainInstance.waitUntilValid(() => {
|
||||
console.log(chalk.yellow('Spawning electron...'));
|
||||
|
|
|
@ -87,10 +87,7 @@ if (!gotSingleInstanceLock) {
|
|||
app.on('second-instance', (event, argv) => {
|
||||
// Send the url to the app to navigate first, then focus
|
||||
if (rendererWindow) {
|
||||
if (
|
||||
(process.platform === 'win32' || process.platform === 'linux') &&
|
||||
String(argv[1]).startsWith('lbry')
|
||||
) {
|
||||
if ((process.platform === 'win32' || process.platform === 'linux') && String(argv[1]).startsWith('lbry')) {
|
||||
let URI = argv[1];
|
||||
|
||||
// Keep only command line / deep linked arguments
|
||||
|
@ -172,8 +169,7 @@ app.on('will-quit', event => {
|
|||
{
|
||||
type: 'info',
|
||||
title: 'LBRY Will Upgrade',
|
||||
message:
|
||||
'LBRY has a pending upgrade. Please select "Yes" to install it on the prompt shown after this one.',
|
||||
message: 'LBRY has a pending upgrade. Please select "Yes" to install it on the prompt shown after this one.',
|
||||
},
|
||||
() => {
|
||||
app.quit();
|
||||
|
@ -208,9 +204,7 @@ ipcMain.on('upgrade', (event, installerPath) => {
|
|||
});
|
||||
// what to do if no shutdown in a long time?
|
||||
console.log('Update downloaded to', installerPath);
|
||||
console.log(
|
||||
'The app will close, and you will be prompted to install the latest version of LBRY.'
|
||||
);
|
||||
console.log('The app will close, and you will be prompted to install the latest version of LBRY.');
|
||||
console.log('After the install is complete, please reopen the app.');
|
||||
app.quit();
|
||||
});
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
export default async function installDevtools() {
|
||||
const {
|
||||
default: installExtension,
|
||||
REACT_DEVELOPER_TOOLS,
|
||||
REDUX_DEVTOOLS,
|
||||
} = require('electron-devtools-installer');
|
||||
const { default: installExtension, REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } = require('electron-devtools-installer');
|
||||
|
||||
await installExtension(REACT_DEVELOPER_TOOLS)
|
||||
.then(name => console.log(`Added Extension: ${name}`))
|
||||
|
@ -12,5 +8,4 @@ export default async function installDevtools() {
|
|||
await installExtension(REDUX_DEVTOOLS)
|
||||
.then(name => console.log(`Added Extension: ${name}`))
|
||||
.catch(err => console.log('An error occurred: ', err));
|
||||
|
||||
}
|
||||
|
|
|
@ -8,9 +8,7 @@ async function unpackByOutpoint(lbry, outpoint) {
|
|||
if (claimFiles && claimFiles.length) {
|
||||
const claimFileInfo = claimFiles[0];
|
||||
const packFilePath = path.resolve(claimFileInfo.download_path);
|
||||
const unpackPath = path.normalize(
|
||||
path.join(claimFileInfo.download_directory, claimFileInfo.claim_name)
|
||||
);
|
||||
const unpackPath = path.normalize(path.join(claimFileInfo.download_directory, claimFileInfo.claim_name));
|
||||
|
||||
if (!fs.existsSync(unpackPath)) {
|
||||
await unpackDirectory(unpackPath, {
|
||||
|
|
|
@ -59,15 +59,15 @@ class Button extends React.PureComponent<Props> {
|
|||
'button',
|
||||
button
|
||||
? {
|
||||
'button--primary': button === 'primary',
|
||||
'button--secondary': button === 'secondary',
|
||||
'button--alt': button === 'alt',
|
||||
'button--danger': button === 'danger',
|
||||
'button--inverse': button === 'inverse',
|
||||
'button--disabled': disabled,
|
||||
'button--link': button === 'link',
|
||||
'button--constrict': constrict,
|
||||
}
|
||||
'button--primary': button === 'primary',
|
||||
'button--secondary': button === 'secondary',
|
||||
'button--alt': button === 'alt',
|
||||
'button--danger': button === 'danger',
|
||||
'button--inverse': button === 'inverse',
|
||||
'button--disabled': disabled,
|
||||
'button--link': button === 'link',
|
||||
'button--constrict': constrict,
|
||||
}
|
||||
: 'button--no-style',
|
||||
className
|
||||
);
|
||||
|
@ -83,12 +83,7 @@ class Button extends React.PureComponent<Props> {
|
|||
|
||||
if (href) {
|
||||
return (
|
||||
<OutboundLink
|
||||
eventLabel="outboundClick"
|
||||
to={href}
|
||||
target="_blank"
|
||||
className={combinedClassName}
|
||||
>
|
||||
<OutboundLink eventLabel="outboundClick" to={href} target="_blank" className={combinedClassName}>
|
||||
{content}
|
||||
</OutboundLink>
|
||||
);
|
||||
|
|
|
@ -12,11 +12,7 @@ class CardMedia extends React.PureComponent<Props> {
|
|||
|
||||
return (
|
||||
<div
|
||||
style={
|
||||
thumbnail
|
||||
? { backgroundImage: `url('${thumbnail}')` }
|
||||
: { backgroundImage: `url(${Placeholder})` }
|
||||
}
|
||||
style={thumbnail ? { backgroundImage: `url('${thumbnail}')` } : { backgroundImage: `url(${Placeholder})` }}
|
||||
className="media__thumb"
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -131,11 +131,7 @@ class CategoryList extends PureComponent<Props, State> {
|
|||
}
|
||||
}
|
||||
|
||||
scrollCardsAnimated = (
|
||||
scrollWrapper: HTMLUListElement,
|
||||
scrollTarget: number,
|
||||
direction: string
|
||||
) => {
|
||||
scrollCardsAnimated = (scrollWrapper: HTMLUListElement, scrollTarget: number, direction: string) => {
|
||||
let start;
|
||||
const step = timestamp => {
|
||||
if (!start) start = timestamp;
|
||||
|
@ -174,10 +170,7 @@ class CategoryList extends PureComponent<Props, State> {
|
|||
const scrollWrapper = this.scrollWrapper.current;
|
||||
if (scrollWrapper) {
|
||||
const rect = card.getBoundingClientRect();
|
||||
const isVisible =
|
||||
scrollWrapper.scrollLeft < card.offsetLeft &&
|
||||
rect.left >= 0 &&
|
||||
rect.right <= window.innerWidth;
|
||||
const isVisible = scrollWrapper.scrollLeft < card.offsetLeft && rect.left >= 0 && rect.right <= window.innerWidth;
|
||||
return isVisible;
|
||||
}
|
||||
|
||||
|
@ -276,11 +269,7 @@ class CategoryList extends PureComponent<Props, State> {
|
|||
{categoryLink ? (
|
||||
<React.Fragment>
|
||||
<Button label={category} navigate={channelLink} />
|
||||
<SubscribeButton
|
||||
button="alt"
|
||||
showSnackBarOnSubscribe
|
||||
uri={`lbry://${categoryLink}`}
|
||||
/>
|
||||
<SubscribeButton button="alt" showSnackBarOnSubscribe uri={`lbry://${categoryLink}`} />
|
||||
</React.Fragment>
|
||||
) : (
|
||||
<span>{category}</span>
|
||||
|
@ -297,16 +286,8 @@ class CategoryList extends PureComponent<Props, State> {
|
|||
</h2>
|
||||
{showScrollButtons && (
|
||||
<nav className="media-group__header-navigation">
|
||||
<Button
|
||||
disabled={!canScrollPrevious}
|
||||
onClick={this.handleScrollPrevious}
|
||||
icon={ICONS.ARROW_LEFT}
|
||||
/>
|
||||
<Button
|
||||
disabled={!canScrollNext}
|
||||
onClick={this.handleScrollNext}
|
||||
icon={ICONS.ARROW_RIGHT}
|
||||
/>
|
||||
<Button disabled={!canScrollPrevious} onClick={this.handleScrollPrevious} icon={ICONS.ARROW_LEFT} />
|
||||
<Button disabled={!canScrollNext} onClick={this.handleScrollNext} icon={ICONS.ARROW_RIGHT} />
|
||||
</nav>
|
||||
)}
|
||||
</header>
|
||||
|
@ -321,13 +302,7 @@ class CategoryList extends PureComponent<Props, State> {
|
|||
<ul className="media-scrollhouse" ref={this.scrollWrapper}>
|
||||
{urisInList &&
|
||||
urisInList.map(uri => (
|
||||
<FileCard
|
||||
placeholder
|
||||
preventResolve={lazyLoad}
|
||||
showSubscribedLogo
|
||||
key={uri}
|
||||
uri={normalizeURI(uri)}
|
||||
/>
|
||||
<FileCard placeholder preventResolve={lazyLoad} showSubscribedLogo key={uri} uri={normalizeURI(uri)} />
|
||||
))}
|
||||
|
||||
{!urisInList && new Array(10).fill(1).map((x, i) => <FileCard placeholder key={i} />)}
|
||||
|
|
|
@ -27,18 +27,7 @@ class CreditAmount extends React.PureComponent<Props> {
|
|||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
amount,
|
||||
precision,
|
||||
showFullPrice,
|
||||
showFree,
|
||||
showPlus,
|
||||
large,
|
||||
isEstimate,
|
||||
fee,
|
||||
showLBC,
|
||||
badge,
|
||||
} = this.props;
|
||||
const { amount, precision, showFullPrice, showFree, showPlus, large, isEstimate, fee, showLBC, badge } = this.props;
|
||||
|
||||
const minimumRenderableAmount = 10 ** (-1 * precision);
|
||||
const fullPrice = formatFullPrice(amount, 2);
|
||||
|
@ -86,10 +75,7 @@ class CreditAmount extends React.PureComponent<Props> {
|
|||
{amountText}
|
||||
|
||||
{isEstimate ? (
|
||||
<span
|
||||
className="credit-amount__estimate"
|
||||
title={__('This is an estimate and does not include data fees')}
|
||||
>
|
||||
<span className="credit-amount__estimate" title={__('This is an estimate and does not include data fees')}>
|
||||
*
|
||||
</span>
|
||||
) : null}
|
||||
|
|
|
@ -80,12 +80,7 @@ class FileExporter extends React.PureComponent<Props> {
|
|||
render() {
|
||||
const { label } = this.props;
|
||||
return (
|
||||
<Button
|
||||
button="primary"
|
||||
icon={ICONS.DOWNLOAD}
|
||||
label={label || __('Export')}
|
||||
onClick={this.handleButtonClick}
|
||||
/>
|
||||
<Button button="primary" icon={ICONS.DOWNLOAD} label={label || __('Export')} onClick={this.handleButtonClick} />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,8 +44,7 @@ class FileSelector extends React.PureComponent<Props> {
|
|||
remote.dialog.showOpenDialog(
|
||||
remote.getCurrentWindow(),
|
||||
{
|
||||
properties:
|
||||
this.props.type === 'file' ? ['openFile'] : ['openDirectory', 'createDirectory'],
|
||||
properties: this.props.type === 'file' ? ['openFile'] : ['openDirectory', 'createDirectory'],
|
||||
filters: this.props.filters,
|
||||
},
|
||||
paths => {
|
||||
|
@ -86,8 +85,7 @@ class FileSelector extends React.PureComponent<Props> {
|
|||
render() {
|
||||
const { type, currentPath, fileLabel, directoryLabel } = this.props;
|
||||
|
||||
const label =
|
||||
type === 'file' ? fileLabel || __('Choose File') : directoryLabel || __('Choose Directory');
|
||||
const label = type === 'file' ? fileLabel || __('Choose File') : directoryLabel || __('Choose Directory');
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
@ -101,9 +99,7 @@ class FileSelector extends React.PureComponent<Props> {
|
|||
}}
|
||||
readOnly="readonly"
|
||||
value={currentPath || __('No File Chosen')}
|
||||
inputButton={
|
||||
<Button button="primary" label={label} onClick={() => this.handleButtonClick()} />
|
||||
}
|
||||
inputButton={<Button button="primary" label={label} onClick={() => this.handleButtonClick()} />}
|
||||
/>
|
||||
</React.Fragment>
|
||||
);
|
||||
|
|
|
@ -9,7 +9,7 @@ import { openEditorMenu, stopContextMenu } from 'util/context-menu';
|
|||
|
||||
const SimpleMDE = React.lazy(() =>
|
||||
import(/* webpackChunkName: "SimpleMDE" */
|
||||
'react-simplemde-editor')
|
||||
'react-simplemde-editor')
|
||||
);
|
||||
|
||||
type Props = {
|
||||
|
@ -175,9 +175,7 @@ export class FormField extends React.PureComponent<Props> {
|
|||
input = (
|
||||
<React.Fragment>
|
||||
<fieldset-section>
|
||||
<label htmlFor={name}>
|
||||
{errorMessage ? <span className="error-text">{errorMessage}</span> : label}
|
||||
</label>
|
||||
<label htmlFor={name}>{errorMessage ? <span className="error-text">{errorMessage}</span> : label}</label>
|
||||
{prefix && (
|
||||
<label className="form-field--inline-prefix" htmlFor={name}>
|
||||
{prefix}
|
||||
|
|
|
@ -14,9 +14,7 @@ export class Submit extends React.PureComponent<Props> {
|
|||
|
||||
render() {
|
||||
const { label, disabled, ...otherProps } = this.props;
|
||||
return (
|
||||
<Button button="primary" type="submit" label={label} disabled={disabled} {...otherProps} />
|
||||
);
|
||||
return <Button button="primary" type="submit" label={label} disabled={disabled} {...otherProps} />;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -117,14 +117,7 @@ export const customIcons = {
|
|||
),
|
||||
// The LBRY icon is different from the base icon set so don't use buildIcon()
|
||||
[ICONS.LBRY]: props => (
|
||||
<svg
|
||||
stroke="currentColor"
|
||||
fill="currentColor"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 322 254"
|
||||
className="icon lbry-icon"
|
||||
>
|
||||
<svg stroke="currentColor" fill="currentColor" x="0px" y="0px" viewBox="0 0 322 254" className="icon lbry-icon">
|
||||
<path d="M296,85.9V100l-138.8,85.3L52.6,134l0.2-7.9l104,51.2L289,96.1v-5.8L164.2,30.1L25,116.2v38.5l131.8,65.2 l137.6-84.4l3.9,6l-141.1,86.4L18.1,159.1v-46.8l145.8-90.2C163.9,22.1,296,85.9,296,85.9z" />
|
||||
<path d="M294.3,150.9l2-12.6l-12.2-2.1l0.8-4.9l17.1,2.9l-2.8,17.5L294.3,150.9L294.3,150.9z" />
|
||||
</svg>
|
||||
|
|
|
@ -65,9 +65,7 @@ class IconComponent extends React.PureComponent<Props> {
|
|||
tooltipText = this.getTooltip(icon);
|
||||
}
|
||||
|
||||
const inner = (
|
||||
<Icon size={iconSize} className={classnames(`icon icon--${icon}`, className)} color={color} />
|
||||
);
|
||||
const inner = <Icon size={iconSize} className={classnames(`icon icon--${icon}`, className)} color={color} />;
|
||||
|
||||
return tooltipText ? (
|
||||
<Tooltip icon body={tooltipText} direction={tooltip}>
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import React, { Suspense } from 'react';
|
||||
|
||||
const MarkdownPreviewInternal = React.lazy(() => import(
|
||||
/* webpackChunkName: "markdownPreview" */
|
||||
const MarkdownPreviewInternal = React.lazy(() =>
|
||||
import(/* webpackChunkName: "markdownPreview" */
|
||||
/* webpackPrefetch: true */
|
||||
'./markdown-preview-internal'
|
||||
));
|
||||
'./markdown-preview-internal')
|
||||
);
|
||||
|
||||
const MarkdownPreview = (props) => {
|
||||
const MarkdownPreview = props => {
|
||||
return (
|
||||
<Suspense fallback={<div className="markdown-preview"></div>}>
|
||||
<Suspense fallback={<div className="markdown-preview" />}>
|
||||
<MarkdownPreviewInternal {...props} />
|
||||
</Suspense>
|
||||
);
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
import React, { Suspense } from 'react';
|
||||
import classnames from 'classnames';
|
||||
|
||||
const LazyQRCodeElement = React.lazy(() => import(
|
||||
/* webpackChunkName: "qrCode" */
|
||||
'qrcode.react'
|
||||
));
|
||||
const LazyQRCodeElement = React.lazy(() =>
|
||||
import(/* webpackChunkName: "qrCode" */
|
||||
'qrcode.react')
|
||||
);
|
||||
|
||||
type Props = {
|
||||
value: string,
|
||||
|
@ -28,7 +28,7 @@ class QRCode extends React.Component<Props> {
|
|||
'qr-code--top-padding': paddingTop,
|
||||
})}
|
||||
>
|
||||
<Suspense fallback={<div></div>}>
|
||||
<Suspense fallback={<div />}>
|
||||
<LazyQRCodeElement value={value} />
|
||||
</Suspense>
|
||||
</div>
|
||||
|
|
|
@ -5,8 +5,8 @@ export default function UnsupportedOnWeb() {
|
|||
return (
|
||||
<div className="card__content help help--warning">
|
||||
This page is not currently supported on the web.{' '}
|
||||
<Button button="link" label={__('Download the desktop app')} href="https://lbry.com/get" />{' '}
|
||||
for full feature support.
|
||||
<Button button="link" label={__('Download the desktop app')} href="https://lbry.com/get" /> for full feature
|
||||
support.
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -50,9 +50,7 @@ class DateTime extends React.PureComponent<Props> {
|
|||
(show === DateTime.SHOW_BOTH || show === DateTime.SHOW_DATE) &&
|
||||
date.toLocaleDateString(locales, formatOptions)}
|
||||
{show === DateTime.SHOW_BOTH && ' '}
|
||||
{date &&
|
||||
(show === DateTime.SHOW_BOTH || show === DateTime.SHOW_TIME) &&
|
||||
date.toLocaleTimeString()}
|
||||
{date && (show === DateTime.SHOW_BOTH || show === DateTime.SHOW_TIME) && date.toLocaleTimeString()}
|
||||
{!date && '...'}
|
||||
</span>
|
||||
);
|
||||
|
|
|
@ -6,9 +6,7 @@ import { selectEmailToVerify, selectUser } from 'lbryinc';
|
|||
import FirstRunEmailCollection from './view';
|
||||
|
||||
const select = state => ({
|
||||
emailCollectionAcknowledged: makeSelectClientSetting(SETTINGS.EMAIL_COLLECTION_ACKNOWLEDGED)(
|
||||
state
|
||||
),
|
||||
emailCollectionAcknowledged: makeSelectClientSetting(SETTINGS.EMAIL_COLLECTION_ACKNOWLEDGED)(state),
|
||||
email: selectEmailToVerify(state),
|
||||
user: selectUser(state),
|
||||
});
|
||||
|
|
|
@ -14,13 +14,7 @@ type Props = {
|
|||
|
||||
class FirstRunEmailCollection extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const {
|
||||
completeFirstRun,
|
||||
email,
|
||||
user,
|
||||
emailCollectionAcknowledged,
|
||||
acknowledgeEmail,
|
||||
} = this.props;
|
||||
const { completeFirstRun, email, user, emailCollectionAcknowledged, acknowledgeEmail } = this.props;
|
||||
|
||||
// this shouldn't happen
|
||||
if (!user) {
|
||||
|
|
|
@ -38,15 +38,7 @@ class FileDetails extends PureComponent<Props> {
|
|||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
claim,
|
||||
contentType,
|
||||
fileInfo,
|
||||
metadata,
|
||||
openFolder,
|
||||
hasClickedComment,
|
||||
user,
|
||||
} = this.props;
|
||||
const { claim, contentType, fileInfo, metadata, openFolder, hasClickedComment, user } = this.props;
|
||||
|
||||
if (!claim || !metadata) {
|
||||
return (
|
||||
|
@ -59,8 +51,7 @@ class FileDetails extends PureComponent<Props> {
|
|||
const { description, languages, license } = metadata;
|
||||
|
||||
const mediaType = contentType || 'unknown';
|
||||
let downloadPath =
|
||||
fileInfo && fileInfo.download_path ? path.normalize(fileInfo.download_path) : null;
|
||||
let downloadPath = fileInfo && fileInfo.download_path ? path.normalize(fileInfo.download_path) : null;
|
||||
let downloadNote;
|
||||
// If the path is blank, file is not avialable. Create path from name so the folder opens on click.
|
||||
if (fileInfo && fileInfo.download_path === null) {
|
||||
|
|
|
@ -43,17 +43,7 @@ class FileDownloadLink extends React.PureComponent<Props> {
|
|||
uri: ?string;
|
||||
|
||||
render() {
|
||||
const {
|
||||
fileInfo,
|
||||
downloading,
|
||||
uri,
|
||||
openInShell,
|
||||
purchaseUri,
|
||||
costInfo,
|
||||
loading,
|
||||
pause,
|
||||
claim,
|
||||
} = this.props;
|
||||
const { fileInfo, downloading, uri, openInShell, purchaseUri, costInfo, loading, pause, claim } = this.props;
|
||||
|
||||
const openFile = () => {
|
||||
if (fileInfo) {
|
||||
|
@ -63,13 +53,8 @@ class FileDownloadLink extends React.PureComponent<Props> {
|
|||
};
|
||||
|
||||
if (loading || downloading) {
|
||||
const progress =
|
||||
fileInfo && fileInfo.written_bytes
|
||||
? (fileInfo.written_bytes / fileInfo.total_bytes) * 100
|
||||
: 0;
|
||||
const label = fileInfo
|
||||
? __('Downloading: ') + progress.toFixed(0) + __('% complete')
|
||||
: __('Connecting...');
|
||||
const progress = fileInfo && fileInfo.written_bytes ? (fileInfo.written_bytes / fileInfo.total_bytes) * 100 : 0;
|
||||
const label = fileInfo ? __('Downloading: ') + progress.toFixed(0) + __('% complete') : __('Connecting...');
|
||||
|
||||
return <span className="file-download">{label}</span>;
|
||||
} else if ((fileInfo === null && !downloading) || (fileInfo && !fileInfo.download_path)) {
|
||||
|
|
|
@ -28,47 +28,47 @@ class FileList extends React.PureComponent<Props> {
|
|||
[SORT_OPTIONS.DATE_NEW]: fileInfos =>
|
||||
this.props.sortByHeight
|
||||
? fileInfos.sort((fileInfo1, fileInfo2) => {
|
||||
if (fileInfo1.confirmations < 1) {
|
||||
return -1;
|
||||
} else if (fileInfo2.confirmations < 1) {
|
||||
return 1;
|
||||
}
|
||||
if (fileInfo1.confirmations < 1) {
|
||||
return -1;
|
||||
} else if (fileInfo2.confirmations < 1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
||||
? this.props.claimsById[fileInfo1.claim_id].height
|
||||
: 0;
|
||||
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
||||
? this.props.claimsById[fileInfo2.claim_id].height
|
||||
: 0;
|
||||
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
||||
? this.props.claimsById[fileInfo1.claim_id].height
|
||||
: 0;
|
||||
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
||||
? this.props.claimsById[fileInfo2.claim_id].height
|
||||
: 0;
|
||||
|
||||
if (height1 !== height2) {
|
||||
// flipped because heigher block height is newer
|
||||
return height2 - height1;
|
||||
}
|
||||
if (height1 !== height2) {
|
||||
// flipped because heigher block height is newer
|
||||
return height2 - height1;
|
||||
}
|
||||
|
||||
if (fileInfo1.absolute_channel_position && fileInfo2.absolute_channel_position) {
|
||||
return fileInfo1.absolute_channel_position - fileInfo2.absolute_channel_position;
|
||||
}
|
||||
if (fileInfo1.absolute_channel_position && fileInfo2.absolute_channel_position) {
|
||||
return fileInfo1.absolute_channel_position - fileInfo2.absolute_channel_position;
|
||||
}
|
||||
|
||||
return 0;
|
||||
})
|
||||
return 0;
|
||||
})
|
||||
: [...fileInfos].reverse(),
|
||||
[SORT_OPTIONS.DATE_OLD]: fileInfos =>
|
||||
this.props.sortByHeight
|
||||
? fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
||||
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
||||
? this.props.claimsById[fileInfo1.claim_id].height
|
||||
: 999999;
|
||||
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
||||
? this.props.claimsById[fileInfo2.claim_id].height
|
||||
: 999999;
|
||||
if (height1 < height2) {
|
||||
return -1;
|
||||
} else if (height1 > height2) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
})
|
||||
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
||||
? this.props.claimsById[fileInfo1.claim_id].height
|
||||
: 999999;
|
||||
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
||||
? this.props.claimsById[fileInfo2.claim_id].height
|
||||
: 999999;
|
||||
if (height1 < height2) {
|
||||
return -1;
|
||||
} else if (height1 > height2) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
})
|
||||
: fileInfos,
|
||||
[SORT_OPTIONS.TITLE]: fileInfos =>
|
||||
fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
||||
|
@ -127,14 +127,7 @@ class FileList extends React.PureComponent<Props> {
|
|||
}
|
||||
|
||||
this.sortFunctions[sortBy](fileInfos).forEach(fileInfo => {
|
||||
const {
|
||||
name: claimName,
|
||||
claim_name: claimNameDownloaded,
|
||||
claim_id: claimId,
|
||||
txid,
|
||||
nout,
|
||||
isNew,
|
||||
} = fileInfo;
|
||||
const { name: claimName, claim_name: claimNameDownloaded, claim_id: claimId, txid, nout, isNew } = fileInfo;
|
||||
const uriParams = {};
|
||||
|
||||
// This is unfortunate
|
||||
|
@ -153,12 +146,7 @@ class FileList extends React.PureComponent<Props> {
|
|||
<section>
|
||||
{!hideFilter && (
|
||||
<Form>
|
||||
<FormField
|
||||
label={__('Sort by')}
|
||||
type="select"
|
||||
value={sortBy}
|
||||
onChange={this.handleSortChanged}
|
||||
>
|
||||
<FormField label={__('Sort by')} type="select" value={sortBy} onChange={this.handleSortChanged}>
|
||||
<option value={SORT_OPTIONS.DATE_NEW}>{__('Newest First')}</option>
|
||||
<option value={SORT_OPTIONS.DATE_OLD}>{__('Oldest First')}</option>
|
||||
<option value={SORT_OPTIONS.TITLE}>{__('Title')}</option>
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri } from 'lbry-redux';
|
||||
import {
|
||||
makeSelectCostInfoForUri,
|
||||
doFetchCostInfoForUri,
|
||||
makeSelectFetchingCostInfoForUri,
|
||||
} from 'lbryinc';
|
||||
import { makeSelectCostInfoForUri, doFetchCostInfoForUri, makeSelectFetchingCostInfoForUri } from 'lbryinc';
|
||||
import FilePrice from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
|
|
|
@ -6,33 +6,33 @@ import VideoViewer from 'component/viewers/videoViewer';
|
|||
|
||||
const AudioViewer = React.lazy<*>(() =>
|
||||
import(/* webpackChunkName: "audioViewer" */
|
||||
'component/viewers/audioViewer')
|
||||
'component/viewers/audioViewer')
|
||||
);
|
||||
|
||||
const DocumentViewer = React.lazy<*>(() =>
|
||||
import(/* webpackChunkName: "documentViewer" */
|
||||
'component/viewers/documentViewer')
|
||||
'component/viewers/documentViewer')
|
||||
);
|
||||
|
||||
const DocxViewer = React.lazy<*>(() =>
|
||||
import(/* webpackChunkName: "docxViewer" */
|
||||
'component/viewers/docxViewer')
|
||||
'component/viewers/docxViewer')
|
||||
);
|
||||
|
||||
const HtmlViewer = React.lazy<*>(() =>
|
||||
import(/* webpackChunkName: "htmlViewer" */
|
||||
'component/viewers/htmlViewer')
|
||||
'component/viewers/htmlViewer')
|
||||
);
|
||||
|
||||
const PdfViewer = React.lazy<*>(() =>
|
||||
import(/* webpackChunkName: "pdfViewer" */
|
||||
'component/viewers/pdfViewer')
|
||||
'component/viewers/pdfViewer')
|
||||
);
|
||||
|
||||
// @if TARGET='app'
|
||||
const ThreeViewer = React.lazy<*>(() =>
|
||||
import(/* webpackChunkName: "threeViewer" */
|
||||
'component/viewers/threeViewer')
|
||||
'component/viewers/threeViewer')
|
||||
);
|
||||
// @endif
|
||||
|
||||
|
@ -144,16 +144,9 @@ class FileRender extends React.PureComponent<Props> {
|
|||
/>
|
||||
),
|
||||
video: (
|
||||
<VideoViewer
|
||||
claim={claim}
|
||||
source={{ downloadPath, fileName }}
|
||||
contentType={contentType}
|
||||
poster={poster}
|
||||
/>
|
||||
),
|
||||
audio: (
|
||||
<AudioViewer claim={claim} source={{ downloadPath, fileName }} contentType={contentType} />
|
||||
<VideoViewer claim={claim} source={{ downloadPath, fileName }} contentType={contentType} poster={poster} />
|
||||
),
|
||||
audio: <AudioViewer claim={claim} source={{ downloadPath, fileName }} contentType={contentType} />,
|
||||
// Add routes to viewer...
|
||||
};
|
||||
|
||||
|
|
|
@ -53,15 +53,7 @@ class FileTile extends React.PureComponent<Props> {
|
|||
}
|
||||
|
||||
renderFileProperties() {
|
||||
const {
|
||||
isSubscribed,
|
||||
isDownloaded,
|
||||
claim,
|
||||
uri,
|
||||
rewardedContentClaimIds,
|
||||
isNew,
|
||||
claimIsMine,
|
||||
} = this.props;
|
||||
const { isSubscribed, isDownloaded, claim, uri, rewardedContentClaimIds, isNew, claimIsMine } = this.props;
|
||||
const isRewardContent = claim && rewardedContentClaimIds.includes(claim.claim_id);
|
||||
|
||||
if (!isNew && !isSubscribed && !isRewardContent && !isDownloaded) {
|
||||
|
@ -122,8 +114,7 @@ class FileTile extends React.PureComponent<Props> {
|
|||
return displayHiddenMessage ? (
|
||||
<span className="help">
|
||||
{__('This file is hidden because it is marked NSFW. Update your')}{' '}
|
||||
<Button button="link" navigate="/$/settings" label={__('content viewing preferences')} />{' '}
|
||||
{__('to see it')}.
|
||||
<Button button="link" navigate="/$/settings" label={__('content viewing preferences')} /> {__('to see it')}.
|
||||
</span>
|
||||
) : null;
|
||||
}
|
||||
|
@ -140,9 +131,9 @@ class FileTile extends React.PureComponent<Props> {
|
|||
|
||||
const wrapperProps = name
|
||||
? {
|
||||
onClick: () => history.push(formatLbryUriForWeb(uri)),
|
||||
role: 'button',
|
||||
}
|
||||
onClick: () => history.push(formatLbryUriForWeb(uri)),
|
||||
role: 'button',
|
||||
}
|
||||
: {};
|
||||
|
||||
return !name && hideNoResult ? null : (
|
||||
|
@ -159,17 +150,14 @@ class FileTile extends React.PureComponent<Props> {
|
|||
{name && (
|
||||
<Fragment>
|
||||
<div className="media__title">
|
||||
{(title || name) && (
|
||||
<TruncatedText text={title || name} lines={size !== 'small' ? 1 : 2} />
|
||||
)}
|
||||
{(title || name) && <TruncatedText text={title || name} lines={size !== 'small' ? 1 : 2} />}
|
||||
</div>
|
||||
|
||||
{size === 'small' && this.renderFileProperties()}
|
||||
|
||||
{size !== 'small' ? (
|
||||
<div className="media__subtext">
|
||||
{__('Published to')} <UriIndicator uri={uri} link />{' '}
|
||||
<DateTime timeAgo uri={uri} />
|
||||
{__('Published to')} <UriIndicator uri={uri} link /> <DateTime timeAgo uri={uri} />
|
||||
</div>
|
||||
) : (
|
||||
<Fragment>
|
||||
|
|
|
@ -46,8 +46,7 @@ const perform = dispatch => ({
|
|||
cancelPlay: () => dispatch(doSetPlayingUri(null)),
|
||||
changeVolume: volume => dispatch(doChangeVolume(volume)),
|
||||
claimRewards: () => dispatch(doClaimEligiblePurchaseRewards()),
|
||||
savePosition: (claimId, outpoint, position) =>
|
||||
dispatch(savePosition(claimId, outpoint, position)),
|
||||
savePosition: (claimId, outpoint, position) => dispatch(savePosition(claimId, outpoint, position)),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
|
|
|
@ -39,16 +39,7 @@ type State = {
|
|||
|
||||
class MediaPlayer extends React.PureComponent<Props, State> {
|
||||
static SANDBOX_TYPES = ['application/x-lbry', 'application/x-ext-lbry'];
|
||||
static FILE_MEDIA_TYPES = [
|
||||
'text',
|
||||
'script',
|
||||
'e-book',
|
||||
'comic-book',
|
||||
'document',
|
||||
'3D-file',
|
||||
'video',
|
||||
'audio',
|
||||
];
|
||||
static FILE_MEDIA_TYPES = ['text', 'script', 'e-book', 'comic-book', 'document', '3D-file', 'video', 'audio'];
|
||||
static SANDBOX_SET_BASE_URL = 'http://localhost:5278/set/';
|
||||
static SANDBOX_CONTENT_BASE_URL = 'http://localhost:5278';
|
||||
|
||||
|
@ -253,8 +244,7 @@ class MediaPlayer extends React.PureComponent<Props, State> {
|
|||
// Files supported by render-media
|
||||
const { contentType } = this.props;
|
||||
return (
|
||||
Object.values(player.mime).indexOf(contentType) !== -1 ||
|
||||
MediaPlayer.SANDBOX_TYPES.indexOf(contentType) > -1
|
||||
Object.values(player.mime).indexOf(contentType) !== -1 || MediaPlayer.SANDBOX_TYPES.indexOf(contentType) > -1
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -262,10 +252,7 @@ class MediaPlayer extends React.PureComponent<Props, State> {
|
|||
// This files are supported using a custom viewer
|
||||
const { mediaType, contentType } = this.props;
|
||||
|
||||
return (
|
||||
MediaPlayer.FILE_MEDIA_TYPES.indexOf(mediaType) > -1 ||
|
||||
MediaPlayer.SANDBOX_TYPES.indexOf(contentType) > -1
|
||||
);
|
||||
return MediaPlayer.FILE_MEDIA_TYPES.indexOf(mediaType) > -1 || MediaPlayer.SANDBOX_TYPES.indexOf(contentType) > -1;
|
||||
}
|
||||
|
||||
renderFile() {
|
||||
|
@ -302,9 +289,7 @@ class MediaPlayer extends React.PureComponent<Props, State> {
|
|||
if (IS_WEB && ['audio', 'video'].indexOf(mediaType) === -1) {
|
||||
return {
|
||||
isLoading: false,
|
||||
loadingStatus: __(
|
||||
'This file type is not currently supported on lbry.tv. Try viewing it in the desktop app.'
|
||||
),
|
||||
loadingStatus: __('This file type is not currently supported on lbry.tv. Try viewing it in the desktop app.'),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -360,11 +345,7 @@ class MediaPlayer extends React.PureComponent<Props, State> {
|
|||
<React.Fragment>
|
||||
{loadingStatus && <LoadingScreen status={loadingStatus} spinner={isLoading} />}
|
||||
{isFileReady && <FileRender claim={claim} source={fileSource} mediaType={mediaType} />}
|
||||
<div
|
||||
className="content__view--container"
|
||||
style={{ opacity: isLoading ? 0 : 1 }}
|
||||
ref={this.mediaContainer}
|
||||
/>
|
||||
<div className="content__view--container" style={{ opacity: isLoading ? 0 : 1 }} ref={this.mediaContainer} />
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import PlayButton from './internal/play-button';
|
|||
|
||||
const Player = React.lazy(() =>
|
||||
import(/* webpackChunkName: "player-legacy" */
|
||||
'./internal/player')
|
||||
'./internal/player')
|
||||
);
|
||||
|
||||
const SPACE_BAR_KEYCODE = 32;
|
||||
|
@ -144,11 +144,7 @@ class FileViewer extends React.PureComponent<Props> {
|
|||
};
|
||||
|
||||
isMediaSame(nextProps: Props) {
|
||||
return (
|
||||
this.props.fileInfo &&
|
||||
nextProps.fileInfo &&
|
||||
this.props.fileInfo.outpoint === nextProps.fileInfo.outpoint
|
||||
);
|
||||
return this.props.fileInfo && nextProps.fileInfo && this.props.fileInfo.outpoint === nextProps.fileInfo.outpoint;
|
||||
}
|
||||
|
||||
playContent() {
|
||||
|
@ -258,8 +254,7 @@ class FileViewer extends React.PureComponent<Props> {
|
|||
'card__media--disabled': !fileInfo && insufficientCredits,
|
||||
});
|
||||
|
||||
const layoverStyle =
|
||||
!shouldObscureNsfw && thumbnail ? { backgroundImage: `url("${thumbnail}")` } : {};
|
||||
const layoverStyle = !shouldObscureNsfw && thumbnail ? { backgroundImage: `url("${thumbnail}")` } : {};
|
||||
|
||||
return (
|
||||
<div className={classnames('video', {}, className)}>
|
||||
|
@ -280,9 +275,7 @@ class FileViewer extends React.PureComponent<Props> {
|
|||
downloadCompleted={fileInfo.completed}
|
||||
changeVolume={changeVolume}
|
||||
volume={volume}
|
||||
savePosition={newPosition =>
|
||||
savePosition(claim.claim_id, `${claim.txid}:${claim.nout}`, newPosition)
|
||||
}
|
||||
savePosition={newPosition => savePosition(claim.claim_id, `${claim.txid}:${claim.nout}`, newPosition)}
|
||||
claim={claim}
|
||||
uri={uri}
|
||||
position={position}
|
||||
|
@ -295,12 +288,7 @@ class FileViewer extends React.PureComponent<Props> {
|
|||
</div>
|
||||
)}
|
||||
{!isPlaying && (
|
||||
<div
|
||||
role="button"
|
||||
onClick={this.playContent}
|
||||
className={layoverClass}
|
||||
style={layoverStyle}
|
||||
>
|
||||
<div role="button" onClick={this.playContent} className={layoverClass} style={layoverStyle}>
|
||||
<PlayButton
|
||||
play={(e: SyntheticInputEvent<*>) => {
|
||||
e.stopPropagation();
|
||||
|
|
|
@ -6,9 +6,7 @@ import { doSetClientSetting } from 'redux/actions/settings';
|
|||
import FirstRun from './view';
|
||||
|
||||
const select = state => ({
|
||||
emailCollectionAcknowledged: makeSelectClientSetting(SETTINGS.EMAIL_COLLECTION_ACKNOWLEDGED)(
|
||||
state
|
||||
),
|
||||
emailCollectionAcknowledged: makeSelectClientSetting(SETTINGS.EMAIL_COLLECTION_ACKNOWLEDGED)(state),
|
||||
welcomeAcknowledged: makeSelectClientSetting(SETTINGS.NEW_USER_ACKNOWLEDGED)(state),
|
||||
firstRunComplete: makeSelectClientSetting(SETTINGS.FIRST_RUN_COMPLETED)(state),
|
||||
user: selectUser(state),
|
||||
|
|
|
@ -45,13 +45,11 @@ export default class FirstRun extends PureComponent<Props> {
|
|||
const message = (
|
||||
<React.Fragment>
|
||||
<p>
|
||||
{__('Using LBRY is like dating a centaur. Totally normal up top, and')}{' '}
|
||||
<em>{__('way different')}</em> {__('underneath.')}
|
||||
{__('Using LBRY is like dating a centaur. Totally normal up top, and')} <em>{__('way different')}</em>{' '}
|
||||
{__('underneath.')}
|
||||
</p>
|
||||
<p>{__('Up top, LBRY is similar to popular media sites.')}</p>
|
||||
<p>
|
||||
{__('Below, LBRY is controlled by users -- you -- via blockchain and decentralization.')}
|
||||
</p>
|
||||
<p>{__('Below, LBRY is controlled by users -- you -- via blockchain and decentralization.')}</p>
|
||||
</React.Fragment>
|
||||
);
|
||||
// @endif
|
||||
|
@ -121,11 +119,7 @@ export default class FirstRun extends PureComponent<Props> {
|
|||
<div className="card__content">
|
||||
<p>{__("Check out some of the neat content below me. I'll see you around!")}</p>
|
||||
<div className="card__actions">
|
||||
<Button
|
||||
button="primary"
|
||||
onClick={completeFirstRun}
|
||||
label={__('Lets Get Started')}
|
||||
/>
|
||||
<Button button="primary" onClick={completeFirstRun} label={__('Lets Get Started')} />
|
||||
</div>
|
||||
</div>
|
||||
</Help>
|
||||
|
|
|
@ -31,8 +31,7 @@ const Header = (props: Props) => {
|
|||
isForwardDisabled,
|
||||
} = props;
|
||||
|
||||
const showUpgradeButton =
|
||||
autoUpdateDownloaded || (process.platform === 'linux' && isUpgradeAvailable);
|
||||
const showUpgradeButton = autoUpdateDownloaded || (process.platform === 'linux' && isUpgradeAvailable);
|
||||
|
||||
return (
|
||||
<header className="header">
|
||||
|
|
|
@ -45,9 +45,7 @@ class InviteList extends React.PureComponent<Props> {
|
|||
rewardAmount = referralReward.reward_amount;
|
||||
rewardHelp = referralReward.reward_description;
|
||||
}
|
||||
const showClaimable = invitees.some(
|
||||
invite => invite.invite_reward_claimable && !invite.invite_reward_claimed
|
||||
);
|
||||
const showClaimable = invitees.some(invite => invite.invite_reward_claimable && !invite.invite_reward_claimed);
|
||||
|
||||
return (
|
||||
<section className="card card--section">
|
||||
|
@ -89,11 +87,7 @@ class InviteList extends React.PureComponent<Props> {
|
|||
)}
|
||||
|
||||
{!invitee.invite_reward_claimed &&
|
||||
(invitee.invite_reward_claimable ? (
|
||||
<span>{__('Claimable')}</span>
|
||||
) : (
|
||||
__('Unclaimable')
|
||||
))}
|
||||
(invitee.invite_reward_claimable ? <span>{__('Claimable')}</span> : __('Unclaimable'))}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
|
|
|
@ -75,9 +75,7 @@ class InviteNew extends React.PureComponent<Props> {
|
|||
<header className="card__header">
|
||||
<h2 className="card__title">{__('Invite a Friend')}</h2>
|
||||
|
||||
<p className="card__subtitle">
|
||||
{__('When your friends start using LBRY, the network gets stronger!')}
|
||||
</p>
|
||||
<p className="card__subtitle">{__('When your friends start using LBRY, the network gets stronger!')}</p>
|
||||
</header>
|
||||
|
||||
<div className="card__content">
|
||||
|
@ -89,10 +87,7 @@ class InviteNew extends React.PureComponent<Props> {
|
|||
/>
|
||||
</div>
|
||||
<div className="card__content">
|
||||
<CopyableText
|
||||
label={__('Or share this link with your friends')}
|
||||
copyable={referralLink}
|
||||
/>
|
||||
<CopyableText label={__('Or share this link with your friends')} copyable={referralLink} />
|
||||
|
||||
<p className="help">
|
||||
{__('Earn')} <Button button="link" navigate="/$/rewards" label={__('rewards')} />{' '}
|
||||
|
|
|
@ -30,11 +30,7 @@ class NameHelpText extends React.PureComponent<Props> {
|
|||
<React.Fragment>
|
||||
{__('You already have a claim at')}
|
||||
{` ${uri} `}
|
||||
<Button
|
||||
button="link"
|
||||
label="Edit it"
|
||||
onClick={() => onEditMyClaim(myClaimForUri, editUri)}
|
||||
/>
|
||||
<Button button="link" label="Edit it" onClick={() => onEditMyClaim(myClaimForUri, editUri)} />
|
||||
<br />
|
||||
{__('Publishing will update your existing claim.')}
|
||||
</React.Fragment>
|
||||
|
@ -44,9 +40,7 @@ class NameHelpText extends React.PureComponent<Props> {
|
|||
return (
|
||||
<React.Fragment>
|
||||
{nameHelpText || (
|
||||
<span>
|
||||
{__('Create a URL for this content. Simpler names are easier to find and remember.')}
|
||||
</span>
|
||||
<span>{__('Create a URL for this content. Simpler names are easier to find and remember.')}</span>
|
||||
)}
|
||||
</React.Fragment>
|
||||
);
|
||||
|
|
|
@ -190,14 +190,7 @@ class PublishForm extends React.PureComponent<Props> {
|
|||
}
|
||||
|
||||
handlePublish() {
|
||||
const {
|
||||
filePath,
|
||||
licenseType,
|
||||
licenseUrl,
|
||||
otherLicenseDescription,
|
||||
myClaimForUri,
|
||||
publish,
|
||||
} = this.props;
|
||||
const { filePath, licenseType, licenseUrl, otherLicenseDescription, myClaimForUri, publish } = this.props;
|
||||
|
||||
let publishingLicense;
|
||||
switch (licenseType) {
|
||||
|
@ -248,12 +241,7 @@ class PublishForm extends React.PureComponent<Props> {
|
|||
|
||||
// If they are editing, they don't need a new file chosen
|
||||
const formValidLessFile =
|
||||
name &&
|
||||
!nameError &&
|
||||
title &&
|
||||
bid &&
|
||||
!bidError &&
|
||||
!(uploadThumbnailStatus === THUMBNAIL_STATUSES.IN_PROGRESS);
|
||||
name && !nameError && title && bid && !bidError && !(uploadThumbnailStatus === THUMBNAIL_STATUSES.IN_PROGRESS);
|
||||
return editingURI && !filePath ? isStillEditing && formValidLessFile : formValidLessFile;
|
||||
}
|
||||
|
||||
|
@ -352,24 +340,12 @@ class PublishForm extends React.PureComponent<Props> {
|
|||
<h2 className="card__title card__title--flex-between">
|
||||
{__('Content')}
|
||||
{(filePath || !!editingURI) && (
|
||||
<Button
|
||||
button="inverse"
|
||||
icon={ICONS.CLOSE}
|
||||
label={__('Clear')}
|
||||
onClick={clearPublish}
|
||||
/>
|
||||
<Button button="inverse" icon={ICONS.CLOSE} label={__('Clear')} onClick={clearPublish} />
|
||||
)}
|
||||
</h2>
|
||||
<p className="card__subtitle">
|
||||
{isStillEditing
|
||||
? __('You are currently editing a claim.')
|
||||
: __('What are you publishing?')}{' '}
|
||||
{__('Read our')}{' '}
|
||||
<Button
|
||||
button="link"
|
||||
label={__('FAQ')}
|
||||
href="https://lbry.com/faq/how-to-publish"
|
||||
/>{' '}
|
||||
{isStillEditing ? __('You are currently editing a claim.') : __('What are you publishing?')}{' '}
|
||||
{__('Read our')} <Button button="link" label={__('FAQ')} href="https://lbry.com/faq/how-to-publish" />{' '}
|
||||
{__('to learn more.')}
|
||||
</p>
|
||||
</header>
|
||||
|
@ -496,14 +472,8 @@ class PublishForm extends React.PureComponent<Props> {
|
|||
<header className="card__header">
|
||||
<h2 className="card__title">{__('Where can people find this content?')}</h2>
|
||||
<p className="card__subtitle">
|
||||
{__(
|
||||
'The LBRY URL is the exact address where people find your content (ex. lbry://myvideo).'
|
||||
)}{' '}
|
||||
<Button
|
||||
button="link"
|
||||
label={__('Learn more')}
|
||||
href="https://lbry.com/faq/naming"
|
||||
/>
|
||||
{__('The LBRY URL is the exact address where people find your content (ex. lbry://myvideo).')}{' '}
|
||||
<Button button="link" label={__('Learn more')} href="https://lbry.com/faq/naming" />
|
||||
</p>
|
||||
</header>
|
||||
|
||||
|
@ -512,9 +482,7 @@ class PublishForm extends React.PureComponent<Props> {
|
|||
<fieldset-section>
|
||||
<label>{__('Name')}</label>
|
||||
<span className="form-field__prefix">{`lbry://${
|
||||
!channel || channel === CHANNEL_ANONYMOUS || channel === CHANNEL_NEW
|
||||
? ''
|
||||
: `${channel}/`
|
||||
!channel || channel === CHANNEL_ANONYMOUS || channel === CHANNEL_NEW ? '' : `${channel}/`
|
||||
}`}</span>
|
||||
</fieldset-section>
|
||||
<FormField
|
||||
|
@ -607,9 +575,7 @@ class PublishForm extends React.PureComponent<Props> {
|
|||
otherLicenseDescription: event.target.value,
|
||||
})
|
||||
}
|
||||
handleLicenseUrlChange={event =>
|
||||
updatePublishForm({ licenseUrl: event.target.value })
|
||||
}
|
||||
handleLicenseUrlChange={event => updatePublishForm({ licenseUrl: event.target.value })}
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -617,12 +583,7 @@ class PublishForm extends React.PureComponent<Props> {
|
|||
<section className="card card--section">
|
||||
<div className="card__content">
|
||||
{__('By continuing, you accept the')}{' '}
|
||||
<Button
|
||||
button="link"
|
||||
href="https://www.lbry.com/termsofservice"
|
||||
label={__('LBRY Terms of Service')}
|
||||
/>
|
||||
.
|
||||
<Button button="link" href="https://www.lbry.com/termsofservice" label={__('LBRY Terms of Service')} />.
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
@ -631,11 +592,7 @@ class PublishForm extends React.PureComponent<Props> {
|
|||
<div className="card__actions">
|
||||
<Submit
|
||||
label={submitLabel}
|
||||
disabled={
|
||||
formDisabled ||
|
||||
!formValid ||
|
||||
uploadThumbnailStatus === THUMBNAIL_STATUSES.IN_PROGRESS
|
||||
}
|
||||
disabled={formDisabled || !formValid || uploadThumbnailStatus === THUMBNAIL_STATUSES.IN_PROGRESS}
|
||||
/>
|
||||
<Button button="link" onClick={this.handleCancelPublish} label={__('Cancel')} />
|
||||
</div>
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
import { connect } from 'react-redux';
|
||||
import {
|
||||
makeSelectClaimForUri,
|
||||
doSearch,
|
||||
makeSelectRecommendedContentForUri,
|
||||
selectIsSearching,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectClaimForUri, doSearch, makeSelectRecommendedContentForUri, selectIsSearching } from 'lbry-redux';
|
||||
import RecommendedVideos from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
import { connect } from 'react-redux';
|
||||
import {
|
||||
selectUnclaimedRewardValue,
|
||||
selectFetchingRewards,
|
||||
doRewardList,
|
||||
doFetchRewardedContent,
|
||||
} from 'lbryinc';
|
||||
import { selectUnclaimedRewardValue, selectFetchingRewards, doRewardList, doFetchRewardedContent } from 'lbryinc';
|
||||
import RewardSummary from './view';
|
||||
|
||||
const select = state => ({
|
||||
|
|
|
@ -57,8 +57,7 @@ class RewardSummary extends React.Component<Props> {
|
|||
</div>
|
||||
|
||||
<p className="help">
|
||||
{__('Read our')}{' '}
|
||||
<Button button="link" label={__('FAQ')} href="https://lbry.com/faq/rewards" />{' '}
|
||||
{__('Read our')} <Button button="link" label={__('FAQ')} href="https://lbry.com/faq/rewards" />{' '}
|
||||
{__('to learn more about LBRY Rewards')}.
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
import { connect } from 'react-redux';
|
||||
import {
|
||||
selectSearchOptions,
|
||||
doUpdateSearchOptions,
|
||||
makeSelectQueryWithOptions,
|
||||
doToast,
|
||||
} from 'lbry-redux';
|
||||
import { selectSearchOptions, doUpdateSearchOptions, makeSelectQueryWithOptions, doToast } from 'lbry-redux';
|
||||
import { doToggleSearchExpanded } from 'redux/actions/app';
|
||||
import { selectSearchOptionsExpanded } from 'redux/selectors/app';
|
||||
import analytics from 'analytics';
|
||||
|
|
|
@ -45,18 +45,8 @@ const SearchOptions = (props: Props) => {
|
|||
|
||||
<div className="media__action-group">
|
||||
<span>{__('Find what you were looking for?')}</span>
|
||||
<Button
|
||||
button="alt"
|
||||
description={__('Yes')}
|
||||
onClick={() => onFeedbackPositive(query)}
|
||||
icon={ICONS.YES}
|
||||
/>
|
||||
<Button
|
||||
button="alt"
|
||||
description={__('No')}
|
||||
onClick={() => onFeedbackNegative(query)}
|
||||
icon={ICONS.NO}
|
||||
/>
|
||||
<Button button="alt" description={__('Yes')} onClick={() => onFeedbackPositive(query)} icon={ICONS.YES} />
|
||||
<Button button="alt" description={__('No')} onClick={() => onFeedbackNegative(query)} icon={ICONS.NO} />
|
||||
</div>
|
||||
</div>
|
||||
<ExpandableOptions pose={expanded ? 'show' : 'hide'}>
|
||||
|
|
|
@ -157,12 +157,7 @@ class ChannelSection extends React.PureComponent<Props, State> {
|
|||
<BusyIndicator message="Updating channels" />
|
||||
) : (
|
||||
<fieldset-section>
|
||||
<FormField
|
||||
name="channel"
|
||||
type="select"
|
||||
onChange={this.handleChannelChange}
|
||||
value={channel}
|
||||
>
|
||||
<FormField name="channel" type="select" onChange={this.handleChannelChange} value={channel}>
|
||||
<option value={CHANNEL_ANONYMOUS}>{__('Anonymous')}</option>
|
||||
{channels.map(({ name }) => (
|
||||
<option key={name} value={name}>
|
||||
|
@ -192,9 +187,7 @@ class ChannelSection extends React.PureComponent<Props, State> {
|
|||
step="any"
|
||||
min="0"
|
||||
type="number"
|
||||
helper={__(
|
||||
'This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.'
|
||||
)}
|
||||
helper={__('This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.')}
|
||||
error={newChannelBidError}
|
||||
value={newChannelBid}
|
||||
onChange={event => this.handleNewChannelBidChange(parseFloat(event.target.value))}
|
||||
|
@ -206,11 +199,7 @@ class ChannelSection extends React.PureComponent<Props, State> {
|
|||
label={!creatingChannel ? __('Create channel') : __('Creating channel...')}
|
||||
onClick={this.handleCreateChannelClick}
|
||||
disabled={
|
||||
!newChannelName ||
|
||||
!newChannelBid ||
|
||||
creatingChannel ||
|
||||
newChannelNameError ||
|
||||
newChannelBidError
|
||||
!newChannelName || !newChannelBid || creatingChannel || newChannelNameError || newChannelBidError
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -81,10 +81,7 @@ class SelectThumbnail extends React.PureComponent<Props, State> {
|
|||
<div className="card__content">
|
||||
{status === THUMBNAIL_STATUSES.API_DOWN || status === THUMBNAIL_STATUSES.MANUAL ? (
|
||||
<div className="column">
|
||||
<div
|
||||
className="column__item thumbnail-preview"
|
||||
style={{ backgroundImage: `url(${thumbnailSrc})` }}
|
||||
>
|
||||
<div className="column__item thumbnail-preview" style={{ backgroundImage: `url(${thumbnailSrc})` }}>
|
||||
<img
|
||||
style={{ display: 'none' }}
|
||||
src={thumbnailSrc}
|
||||
|
@ -110,9 +107,7 @@ class SelectThumbnail extends React.PureComponent<Props, State> {
|
|||
<Button
|
||||
button="link"
|
||||
label={__('Use thumbnail upload tool')}
|
||||
onClick={() =>
|
||||
updatePublishForm({ uploadThumbnailStatus: THUMBNAIL_STATUSES.READY })
|
||||
}
|
||||
onClick={() => updatePublishForm({ uploadThumbnailStatus: THUMBNAIL_STATUSES.READY })}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -129,21 +124,13 @@ class SelectThumbnail extends React.PureComponent<Props, State> {
|
|||
)}
|
||||
{status === THUMBNAIL_STATUSES.COMPLETE && thumbnail && (
|
||||
<div className="column column--space-between">
|
||||
<div
|
||||
className="column__item thumbnail-preview"
|
||||
style={{ backgroundImage: `url(${thumbnail})` }}
|
||||
/>
|
||||
<div className="column__item thumbnail-preview" style={{ backgroundImage: `url(${thumbnail})` }} />
|
||||
<div className="column__item">
|
||||
<p>
|
||||
Upload complete.{' '}
|
||||
<Button button="link" href={thumbnail} label={__('View it on spee.ch')} />.
|
||||
Upload complete. <Button button="link" href={thumbnail} label={__('View it on spee.ch')} />.
|
||||
</p>
|
||||
<div className="card__actions">
|
||||
<Button
|
||||
button="link"
|
||||
label={__('New thumbnail')}
|
||||
onClick={resetThumbnailStatus}
|
||||
/>
|
||||
<Button button="link" label={__('New thumbnail')} onClick={resetThumbnailStatus} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -155,9 +142,7 @@ class SelectThumbnail extends React.PureComponent<Props, State> {
|
|||
<Button
|
||||
button="link"
|
||||
label={__('Or enter a URL manually')}
|
||||
onClick={() =>
|
||||
updatePublishForm({ uploadThumbnailStatus: THUMBNAIL_STATUSES.MANUAL })
|
||||
}
|
||||
onClick={() => updatePublishForm({ uploadThumbnailStatus: THUMBNAIL_STATUSES.MANUAL })}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
|
|
@ -57,9 +57,7 @@ class SideBar extends React.PureComponent<Props> {
|
|||
{
|
||||
...buildLink(
|
||||
PAGES.SUBSCRIPTIONS,
|
||||
`${__('Subscriptions')} ${
|
||||
unreadSubscriptionTotal > 0 ? '(' + unreadSubscriptionTotal + ')' : ''
|
||||
}`,
|
||||
`${__('Subscriptions')} ${unreadSubscriptionTotal > 0 ? '(' + unreadSubscriptionTotal + ')' : ''}`,
|
||||
ICONS.SUBSCRIPTION
|
||||
),
|
||||
},
|
||||
|
@ -79,12 +77,7 @@ class SideBar extends React.PureComponent<Props> {
|
|||
...buildLink(PAGES.ACCOUNT, 'Overview', ICONS.ACCOUNT),
|
||||
},
|
||||
{
|
||||
...buildLink(
|
||||
PAGES.INVITE,
|
||||
'Invite',
|
||||
ICONS.INVITE,
|
||||
shouldShowInviteGuide && __('Check this out!')
|
||||
),
|
||||
...buildLink(PAGES.INVITE, 'Invite', ICONS.INVITE, shouldShowInviteGuide && __('Check this out!')),
|
||||
},
|
||||
{
|
||||
...buildLink(PAGES.REWARDS, 'Rewards', ICONS.FEATURED),
|
||||
|
|
|
@ -51,9 +51,7 @@ class SnackBar extends React.PureComponent<Props> {
|
|||
<div>ⓘ</div>
|
||||
<div>{message}</div>
|
||||
</div>
|
||||
{linkText && linkTarget && (
|
||||
<Button navigate={linkTarget} className="snack-bar__action" label={linkText} />
|
||||
)}
|
||||
{linkText && linkTarget && <Button navigate={linkTarget} className="snack-bar__action" label={linkText} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -92,13 +92,7 @@ class SocialShare extends React.PureComponent<Props> {
|
|||
/>
|
||||
</ToolTip>
|
||||
<ToolTip onComponent body={__('View on Spee.ch')}>
|
||||
<Button
|
||||
icon={ICONS.WEB}
|
||||
iconColor="blue"
|
||||
button="alt"
|
||||
label={__('')}
|
||||
href={`${speechURL}`}
|
||||
/>
|
||||
<Button icon={ICONS.WEB} iconColor="blue" button="alt" label={__('')} href={`${speechURL}`} />
|
||||
</ToolTip>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -41,11 +41,7 @@ class LoadScreen extends React.PureComponent<Props> {
|
|||
/>
|
||||
</div>
|
||||
<div className="load-screen__help">
|
||||
<p>
|
||||
{__(
|
||||
'If you still have issues, your anti-virus software or firewall may be preventing startup.'
|
||||
)}
|
||||
</p>
|
||||
<p>{__('If you still have issues, your anti-virus software or firewall may be preventing startup.')}</p>
|
||||
<p>
|
||||
{__('Reach out to hello@lbry.com for help, or check out')}{' '}
|
||||
<Button
|
||||
|
|
|
@ -139,9 +139,7 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
|
|||
if (blockChainHeaders.download_progress < 100) {
|
||||
this.setState({
|
||||
message: __('Blockchain Sync'),
|
||||
details: `${__('Catching up with the blockchain')} (${
|
||||
blockchainHeaders.download_progress
|
||||
}%)`,
|
||||
details: `${__('Catching up with the blockchain')} (${blockchainHeaders.download_progress}%)`,
|
||||
});
|
||||
}
|
||||
} else if (wallet && wallet.blocks_behind > 0) {
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import {
|
||||
selectSubscriptions,
|
||||
makeSelectIsSubscribed,
|
||||
selectFirstRunCompleted,
|
||||
} from 'redux/selectors/subscriptions';
|
||||
import { selectSubscriptions, makeSelectIsSubscribed, selectFirstRunCompleted } from 'redux/selectors/subscriptions';
|
||||
import { doToast } from 'lbry-redux';
|
||||
import SubscribeButton from './view';
|
||||
|
||||
|
|
|
@ -29,8 +29,6 @@ export default class MarkAsRead extends PureComponent<Props> {
|
|||
render() {
|
||||
const { channel } = this.props;
|
||||
const label = channel ? __('Mark as read') : __('Mark all as read');
|
||||
return (
|
||||
<Button button="inverse" icon={ICONS.COMPLETE} label={label} onClick={this.handleClick} />
|
||||
);
|
||||
return <Button button="inverse" icon={ICONS.COMPLETE} label={label} onClick={this.handleClick} />;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { selectClaimedRewardsByTransactionId } from 'lbryinc';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import {
|
||||
selectAllMyClaimsByOutpoint,
|
||||
selectTransactionListFilter,
|
||||
doSetTransactionListFilter,
|
||||
} from 'lbry-redux';
|
||||
import { selectAllMyClaimsByOutpoint, selectTransactionListFilter, doSetTransactionListFilter } from 'lbry-redux';
|
||||
import TransactionList from './view';
|
||||
|
||||
const select = state => ({
|
||||
|
|
|
@ -39,9 +39,7 @@ class TransactionList extends React.PureComponent<Props> {
|
|||
}
|
||||
|
||||
filterTransaction(transaction: Transaction) {
|
||||
return (
|
||||
this.props.filterSetting === TRANSACTIONS.ALL || this.props.filterSetting === transaction.type
|
||||
);
|
||||
return this.props.filterSetting === TRANSACTIONS.ALL || this.props.filterSetting === transaction.type;
|
||||
}
|
||||
|
||||
isRevokeable(txid: string, nout: number) {
|
||||
|
|
|
@ -54,12 +54,7 @@ class TransactionListRecent extends React.PureComponent<Props> {
|
|||
/>
|
||||
</div>
|
||||
<div className="card__actions">
|
||||
<Button
|
||||
button="primary"
|
||||
navigate="/$/transactions"
|
||||
label={__('Full History')}
|
||||
icon={icons.HISTORY}
|
||||
/>
|
||||
<Button button="primary" navigate="/$/transactions" label={__('Full History')} icon={icons.HISTORY} />
|
||||
</div>
|
||||
</Fragment>
|
||||
)}
|
||||
|
|
|
@ -38,12 +38,7 @@ class TransactionRefreshButton extends PureComponent<Props, State> {
|
|||
const { fetchingTransactions } = this.props;
|
||||
const { label, disabled } = this.state;
|
||||
return (
|
||||
<Button
|
||||
button="inverse"
|
||||
label={label}
|
||||
onClick={this.handleClick}
|
||||
disabled={disabled || fetchingTransactions}
|
||||
/>
|
||||
<Button button="inverse" label={label} onClick={this.handleClick} disabled={disabled || fetchingTransactions} />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
import { connect } from 'react-redux';
|
||||
import {
|
||||
normalizeURI,
|
||||
doResolveUri,
|
||||
makeSelectIsUriResolving,
|
||||
makeSelectClaimForUri,
|
||||
} from 'lbry-redux';
|
||||
import { normalizeURI, doResolveUri, makeSelectIsUriResolving, makeSelectClaimForUri } from 'lbry-redux';
|
||||
import UriIndicator from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
|
|
|
@ -54,9 +54,7 @@ class UserEmailNew extends React.PureComponent<Props, State> {
|
|||
{__("We'll let you know about LBRY updates, security issues, and great new content.")}
|
||||
{/* @endif */}
|
||||
{/* @if TARGET='web' */}
|
||||
{__(
|
||||
'Stay up to date with lbry.tv and be the first to know about the progress we make.'
|
||||
)}
|
||||
{__('Stay up to date with lbry.tv and be the first to know about the progress we make.')}
|
||||
{/* @endif */}
|
||||
</p>
|
||||
</header>
|
||||
|
@ -74,9 +72,7 @@ class UserEmailNew extends React.PureComponent<Props, State> {
|
|||
/>
|
||||
</Form>
|
||||
<div className="card__actions">{cancelButton}</div>
|
||||
<p className="help">
|
||||
{__('Your email address will never be sold and you can unsubscribe at any time.')}
|
||||
</p>
|
||||
<p className="help">{__('Your email address will never be sold and you can unsubscribe at any time.')}</p>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
import { connect } from 'react-redux';
|
||||
import {
|
||||
selectEmailToVerify,
|
||||
doUserResendVerificationEmail,
|
||||
doUserCheckEmailVerified,
|
||||
selectUser,
|
||||
} from 'lbryinc';
|
||||
import { selectEmailToVerify, doUserResendVerificationEmail, doUserCheckEmailVerified, selectUser } from 'lbryinc';
|
||||
import UserEmailVerify from './view';
|
||||
|
||||
const select = state => ({
|
||||
|
|
|
@ -71,8 +71,8 @@ class UserEmailVerify extends React.PureComponent<Props> {
|
|||
</div>
|
||||
|
||||
<p className="help">
|
||||
{__('Email')} <Button button="link" href="mailto:help@lbry.com" label="help@lbry.com" />{' '}
|
||||
or join our <Button button="link" href="https://chat.lbry.com" label="chat" />{' '}
|
||||
{__('Email')} <Button button="link" href="mailto:help@lbry.com" label="help@lbry.com" /> or join our{' '}
|
||||
<Button button="link" href="https://chat.lbry.com" label="chat" />{' '}
|
||||
{__('if you encounter any trouble verifying.')}
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -5,10 +5,7 @@ import { Form, FormField, Submit } from 'component/common/form';
|
|||
const os = require('os').type();
|
||||
const countryCodes = require('country-data')
|
||||
.callingCountries.all.filter(_ => _.emoji)
|
||||
.reduce(
|
||||
(acc, cur) => acc.concat(cur.countryCallingCodes.map(_ => ({ ...cur, countryCallingCode: _ }))),
|
||||
[]
|
||||
)
|
||||
.reduce((acc, cur) => acc.concat(cur.countryCallingCodes.map(_ => ({ ...cur, countryCallingCode: _ }))), [])
|
||||
.sort((a, b) => {
|
||||
if (a.countryCallingCode < b.countryCallingCode) {
|
||||
return -1;
|
||||
|
@ -97,16 +94,10 @@ class UserPhoneNew extends React.PureComponent<Props, State> {
|
|||
<Form onSubmit={this.handleSubmit}>
|
||||
<div className="card__content">
|
||||
<fieldset-group class="fieldset-group--smushed">
|
||||
<FormField
|
||||
label={__('Country')}
|
||||
type="select"
|
||||
name="country-codes"
|
||||
onChange={this.handleSelect}
|
||||
>
|
||||
<FormField label={__('Country')} type="select" name="country-codes" onChange={this.handleSelect}>
|
||||
{countryCodes.map((country, index) => (
|
||||
<option key={index} value={country.countryCallingCode}>
|
||||
{os === 'Darwin' ? country.emoji : `(${country.alpha2})`}{' '}
|
||||
{country.countryCallingCode}
|
||||
{os === 'Darwin' ? country.emoji : `(${country.alpha2})`} {country.countryCallingCode}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
|
|
|
@ -48,9 +48,7 @@ class UserPhoneVerify extends React.PureComponent<Props, State> {
|
|||
<section className="card__content">
|
||||
<p>
|
||||
{' '}
|
||||
{__(
|
||||
`Please enter the verification code sent to +${countryCode}${phone}. Didn't receive it? `
|
||||
)}
|
||||
{__(`Please enter the verification code sent to +${countryCode}${phone}. Didn't receive it? `)}
|
||||
<Button button="link" onClick={this.reset.bind(this)} label="Go back." />
|
||||
</p>
|
||||
</section>
|
||||
|
@ -72,8 +70,8 @@ class UserPhoneVerify extends React.PureComponent<Props, State> {
|
|||
</Form>
|
||||
|
||||
<p className="help">
|
||||
{__('Email')} <Button button="link" href="mailto:help@lbry.com" label="help@lbry.com" />{' '}
|
||||
or join our <Button button="link" href="https://chat.lbry.com" label="chat" />{' '}
|
||||
{__('Email')} <Button button="link" href="mailto:help@lbry.com" label="help@lbry.com" /> or join our{' '}
|
||||
<Button button="link" href="https://chat.lbry.com" label="chat" />{' '}
|
||||
{__('if you encounter any trouble with your code.')}
|
||||
</p>
|
||||
</React.Fragment>
|
||||
|
|
|
@ -74,9 +74,7 @@ class UserVerify extends React.PureComponent<Props> {
|
|||
<header className="card__header">
|
||||
<h2 className="card__title">{__('2) Proof via Phone')}</h2>
|
||||
<p className="card__subtitle">
|
||||
{`${__(
|
||||
'You will receive an SMS text message confirming that your phone number is correct.'
|
||||
)}`}
|
||||
{`${__('You will receive an SMS text message confirming that your phone number is correct.')}`}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
|
@ -114,12 +112,7 @@ class UserVerify extends React.PureComponent<Props> {
|
|||
|
||||
<div className="card__content">
|
||||
<div className="card__actions">
|
||||
<Button
|
||||
href="https://chat.lbry.com"
|
||||
button="primary"
|
||||
icon={icons.CHAT}
|
||||
label={__('Join LBRY Chat')}
|
||||
/>
|
||||
<Button href="https://chat.lbry.com" button="primary" icon={icons.CHAT} label={__('Join LBRY Chat')} />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -128,9 +121,7 @@ class UserVerify extends React.PureComponent<Props> {
|
|||
<header className="card__header">
|
||||
<h2 className="card__title">{__('Or, Skip It Entirely')}</h2>
|
||||
<p className="card__subtitle">
|
||||
{__(
|
||||
'You can continue without this step, but you will not be eligible to earn rewards.'
|
||||
)}
|
||||
{__('You can continue without this step, but you will not be eligible to earn rewards.')}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
|
|
|
@ -94,16 +94,12 @@ class AudioVideoViewer extends React.PureComponent {
|
|||
audioSource.connect(audioContext.destination);
|
||||
|
||||
if (isButterchurnSupported) {
|
||||
const visualizer = (me.visualizer = butterchurn.createVisualizer(
|
||||
audioContext,
|
||||
me.canvasNode,
|
||||
{
|
||||
height: canvasHeight,
|
||||
width: canvasWidth,
|
||||
pixelRatio: window.devicePixelRatio || 1,
|
||||
textureRatio: 1,
|
||||
}
|
||||
));
|
||||
const visualizer = (me.visualizer = butterchurn.createVisualizer(audioContext, me.canvasNode, {
|
||||
height: canvasHeight,
|
||||
width: canvasWidth,
|
||||
pixelRatio: window.devicePixelRatio || 1,
|
||||
textureRatio: 1,
|
||||
}));
|
||||
|
||||
visualizer.connectAudio(audioSource);
|
||||
visualizer.loadPreset(presets[Math.floor(Math.random() * presets.length)], 2.0);
|
||||
|
@ -220,10 +216,7 @@ class AudioVideoViewer extends React.PureComponent {
|
|||
}
|
||||
|
||||
// Get new preset
|
||||
this.visualizer.loadPreset(
|
||||
presets[Math.floor(Math.random() * presets.length)],
|
||||
2.0
|
||||
);
|
||||
this.visualizer.loadPreset(presets[Math.floor(Math.random() * presets.length)], 2.0);
|
||||
|
||||
this.setState({ enableMilkdrop: !enableMilkdrop });
|
||||
}}
|
||||
|
@ -242,10 +235,7 @@ class AudioVideoViewer extends React.PureComponent {
|
|||
/>
|
||||
</Tooltip>
|
||||
<Tooltip onComponent body={__('Equalizer')}>
|
||||
<Button
|
||||
icon={ICONS.MUSIC_EQUALIZER}
|
||||
onClick={() => this.setState({ showEqualizer: !showEqualizer })}
|
||||
/>
|
||||
<Button icon={ICONS.MUSIC_EQUALIZER} onClick={() => this.setState({ showEqualizer: !showEqualizer })} />
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div ref={node => (this.waveNode = node)} className={styles.wave} />
|
||||
|
|
|
@ -35,10 +35,8 @@ class CodeViewer extends React.PureComponent<Props> {
|
|||
const me = this;
|
||||
const { theme, contentType } = me.props;
|
||||
// Init CodeMirror
|
||||
import(
|
||||
/* webpackChunkName: "codemirror" */
|
||||
'codemirror/lib/codemirror'
|
||||
).then((CodeMirror) => {
|
||||
import(/* webpackChunkName: "codemirror" */
|
||||
'codemirror/lib/codemirror').then(CodeMirror => {
|
||||
me.codeMirror = CodeMirror.fromTextArea(me.textarea, {
|
||||
// Auto detect syntax with file contentType
|
||||
mode: contentType,
|
||||
|
|
|
@ -6,7 +6,7 @@ import MarkdownPreview from 'component/common/markdown-preview';
|
|||
|
||||
const LazyCodeViewer = React.lazy<*>(() =>
|
||||
import(/* webpackChunkName: "codeViewer" */
|
||||
'component/viewers/codeViewer')
|
||||
'component/viewers/codeViewer')
|
||||
);
|
||||
|
||||
type Props = {
|
||||
|
|
|
@ -62,9 +62,7 @@ class DocxViewer extends React.PureComponent<Props, State> {
|
|||
<div className="document-viewer file-render__viewer">
|
||||
{loading && <LoadingScreen status={loadingMessage} spinner />}
|
||||
{error && <LoadingScreen status={errorMessage} spinner={false} />}
|
||||
{content && (
|
||||
<div className="document-viewer__content" dangerouslySetInnerHTML={{ __html: content }} />
|
||||
)}
|
||||
{content && <div className="document-viewer__content" dangerouslySetInnerHTML={{ __html: content }} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -39,8 +39,7 @@ class PdfViewer extends React.PureComponent<Props> {
|
|||
return (
|
||||
<div className="file-render__viewer file-render--pdf" onContextMenu={stopContextMenu}>
|
||||
<p>
|
||||
{__('PDF opened externally.')}{' '}
|
||||
<Button button="link" label={__('Click here')} onClick={this.openFile} />{' '}
|
||||
{__('PDF opened externally.')} <Button button="link" label={__('Click here')} onClick={this.openFile} />{' '}
|
||||
{__('to open it again.')}
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -4,7 +4,7 @@ import { stopContextMenu } from 'util/context-menu';
|
|||
import analytics from 'analytics';
|
||||
import(/* webpackChunkName: "videojs" */
|
||||
/* webpackPreload: true */
|
||||
'video.js/dist/video-js.css');
|
||||
'video.js/dist/video-js.css');
|
||||
|
||||
type Props = {
|
||||
source: {
|
||||
|
@ -24,9 +24,7 @@ class AudioVideoViewer extends React.PureComponent<Props> {
|
|||
const { contentType, poster, claim } = this.props;
|
||||
const { name, claim_id: claimId, txid, nout } = claim;
|
||||
|
||||
const path = `https://api.piratebay.com/content/claims/${claim.name}/${
|
||||
claim.claim_id
|
||||
}/stream.mp4`;
|
||||
const path = `https://api.piratebay.com/content/claims/${claim.name}/${claim.claim_id}/stream.mp4`;
|
||||
const sources = [
|
||||
{
|
||||
src: path,
|
||||
|
@ -45,7 +43,7 @@ class AudioVideoViewer extends React.PureComponent<Props> {
|
|||
import(/* webpackChunkName: "videojs" */
|
||||
/* webpackMode: "lazy" */
|
||||
/* webpackPreload: true */
|
||||
'video.js').then(videojs => {
|
||||
'video.js').then(videojs => {
|
||||
if (videojs.__esModule) {
|
||||
videojs = videojs.default;
|
||||
this.player = videojs(this.videoNode, videoJsOptions, () => {});
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doCheckAddressIsMine,
|
||||
doGetNewAddress,
|
||||
selectReceiveAddress,
|
||||
selectGettingNewAddress,
|
||||
} from 'lbry-redux';
|
||||
import { doCheckAddressIsMine, doGetNewAddress, selectReceiveAddress, selectGettingNewAddress } from 'lbry-redux';
|
||||
import WalletAddress from './view';
|
||||
|
||||
const select = state => ({
|
||||
|
|
|
@ -69,11 +69,7 @@ class WalletAddress extends React.PureComponent<Props, State> {
|
|||
disabled={gettingNewAddress}
|
||||
/>
|
||||
|
||||
<Button
|
||||
button="link"
|
||||
label={showQR ? __('Hide QR code') : __('Show QR code')}
|
||||
onClick={this.toggleQR}
|
||||
/>
|
||||
<Button button="link" label={showQR ? __('Hide QR code') : __('Show QR code')} onClick={this.toggleQR} />
|
||||
</div>
|
||||
|
||||
<p className="help">
|
||||
|
|
|
@ -19,9 +19,7 @@ const WalletBalance = (props: Props) => {
|
|||
<p className="card__subtitle">{__('You currently have')}</p>
|
||||
</header>
|
||||
<div className="card__content">
|
||||
{(balance || balance === 0) && (
|
||||
<CreditAmount large badge={false} amount={balance} precision={8} />
|
||||
)}
|
||||
{(balance || balance === 0) && <CreditAmount large badge={false} amount={balance} precision={8} />}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
|
|
|
@ -96,8 +96,7 @@ class WalletSend extends React.PureComponent<Props> {
|
|||
<span className="error-text">
|
||||
{(!!values.address && touched.address && errors.address) ||
|
||||
(!!values.amount && touched.amount && errors.amount) ||
|
||||
(values.amount === balance &&
|
||||
__('Decrease amount to account for transaction fee')) ||
|
||||
(values.amount === balance && __('Decrease amount to account for transaction fee')) ||
|
||||
(values.amount > balance && __('Not enough credits'))}
|
||||
</span>
|
||||
)}
|
||||
|
|
|
@ -79,10 +79,7 @@ class WalletSendTip extends React.PureComponent<Props, State> {
|
|||
autoFocus
|
||||
name="tip-input"
|
||||
label={
|
||||
(tipAmount &&
|
||||
tipAmount !== 0 &&
|
||||
`Tip ${tipAmount.toFixed(8).replace(/\.?0+$/, '')} LBC`) ||
|
||||
__('Amount')
|
||||
(tipAmount && tipAmount !== 0 && `Tip ${tipAmount.toFixed(8).replace(/\.?0+$/, '')} LBC`) || __('Amount')
|
||||
}
|
||||
className="form-field--price-amount"
|
||||
error={tipError}
|
||||
|
@ -102,11 +99,7 @@ class WalletSendTip extends React.PureComponent<Props, State> {
|
|||
helper={
|
||||
<p>
|
||||
{__(`This will appear as a tip for "${title}".`)}{' '}
|
||||
<Button
|
||||
label={__('Learn more')}
|
||||
button="link"
|
||||
href="https://lbry.com/faq/tipping"
|
||||
/>
|
||||
<Button label={__('Learn more')} button="link" href="https://lbry.com/faq/tipping" />
|
||||
</p>
|
||||
}
|
||||
/>
|
||||
|
|
|
@ -226,10 +226,7 @@ export default class Autocomplete extends React.Component {
|
|||
if (this.state.highlightedIndex !== null) {
|
||||
this.setState(this.ensureHighlightedIndex);
|
||||
}
|
||||
if (
|
||||
nextProps.autoHighlight &&
|
||||
(this.props.value !== nextProps.value || this.state.highlightedIndex === null)
|
||||
) {
|
||||
if (nextProps.autoHighlight && (this.props.value !== nextProps.value || this.state.highlightedIndex === null)) {
|
||||
this.setState(this.maybeAutoCompleteText);
|
||||
}
|
||||
}
|
||||
|
@ -241,10 +238,7 @@ export default class Autocomplete extends React.Component {
|
|||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
if (
|
||||
(this.state.isOpen && !prevState.isOpen) ||
|
||||
('open' in this.props && this.props.open && !prevProps.open)
|
||||
) {
|
||||
if ((this.state.isOpen && !prevState.isOpen) || ('open' in this.props && this.props.open && !prevProps.open)) {
|
||||
this.setMenuPositions();
|
||||
}
|
||||
|
||||
|
@ -289,10 +283,7 @@ export default class Autocomplete extends React.Component {
|
|||
const itemsLength = this.getFilteredItems(this.props).length;
|
||||
if (!itemsLength) return;
|
||||
const { highlightedIndex } = this.state;
|
||||
const index =
|
||||
highlightedIndex === null || highlightedIndex === itemsLength - 1
|
||||
? 0
|
||||
: highlightedIndex + 1;
|
||||
const index = highlightedIndex === null || highlightedIndex === itemsLength - 1 ? 0 : highlightedIndex + 1;
|
||||
this.setState({
|
||||
highlightedIndex: index,
|
||||
isOpen: true,
|
||||
|
@ -304,10 +295,7 @@ export default class Autocomplete extends React.Component {
|
|||
const itemsLength = this.getFilteredItems(this.props).length;
|
||||
if (!itemsLength) return;
|
||||
const { highlightedIndex } = this.state;
|
||||
const index =
|
||||
highlightedIndex === 0 || highlightedIndex === null
|
||||
? itemsLength - 1
|
||||
: highlightedIndex - 1;
|
||||
const index = highlightedIndex === 0 || highlightedIndex === null ? itemsLength - 1 : highlightedIndex - 1;
|
||||
this.setState({
|
||||
highlightedIndex: index,
|
||||
isOpen: true,
|
||||
|
@ -587,10 +575,7 @@ export default class Autocomplete extends React.Component {
|
|||
{this.props.debug && (
|
||||
<pre style={{ marginLeft: 300 }}>
|
||||
{JSON.stringify(
|
||||
this._debugStates.slice(
|
||||
Math.max(0, this._debugStates.length - 5),
|
||||
this._debugStates.length
|
||||
),
|
||||
this._debugStates.slice(Math.max(0, this._debugStates.length - 5), this._debugStates.length),
|
||||
null,
|
||||
2
|
||||
)}
|
||||
|
|
|
@ -73,9 +73,7 @@ class WunderBar extends React.PureComponent<Props, State> {
|
|||
|
||||
// @if TARGET='app'
|
||||
const shouldFocus =
|
||||
process.platform === 'darwin'
|
||||
? keyCode === L_KEY_CODE && metaKey
|
||||
: keyCode === L_KEY_CODE && ctrlKey;
|
||||
process.platform === 'darwin' ? keyCode === L_KEY_CODE && metaKey : keyCode === L_KEY_CODE && ctrlKey;
|
||||
|
||||
if (shouldFocus) {
|
||||
this.input.focus();
|
||||
|
|
|
@ -5,8 +5,7 @@ export default function doLogWarningConsoleMessage() {
|
|||
redTitle:
|
||||
'color: red; font-size: 36px; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;, font-weight: bold;',
|
||||
normalText: 'font-size: 18px;',
|
||||
redText:
|
||||
'color: red; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; font-size: 24px;',
|
||||
redText: 'color: red; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; font-size: 24px;',
|
||||
};
|
||||
console.clear();
|
||||
console.log('%cScam alert!', style.redTitle);
|
||||
|
|
|
@ -75,12 +75,7 @@ export class Modal extends React.PureComponent<ModalProps> {
|
|||
onClick={onConfirmed}
|
||||
/>
|
||||
{type === 'confirm' ? (
|
||||
<Button
|
||||
button="link"
|
||||
label={abortButtonLabel}
|
||||
disabled={abortButtonDisabled}
|
||||
onClick={onAborted}
|
||||
/>
|
||||
<Button button="link" label={abortButtonLabel} disabled={abortButtonDisabled} onClick={onAborted} />
|
||||
) : null}
|
||||
</div>
|
||||
)}
|
||||
|
@ -118,15 +113,9 @@ export class ExpandableModal extends React.PureComponent<ModalProps, State> {
|
|||
return (
|
||||
<Modal type="custom" {...this.props}>
|
||||
{this.props.children}
|
||||
{this.state.expanded ? (
|
||||
<div className="card__content">{this.props.extraContent}</div>
|
||||
) : null}
|
||||
{this.state.expanded ? <div className="card__content">{this.props.extraContent}</div> : null}
|
||||
<div className="card__actions">
|
||||
<Button
|
||||
button="primary"
|
||||
label={this.props.confirmButtonLabel}
|
||||
onClick={this.props.onConfirmed}
|
||||
/>
|
||||
<Button button="primary" label={this.props.confirmButtonLabel} onClick={this.props.onConfirmed} />
|
||||
<Button
|
||||
button="link"
|
||||
label={!this.state.expanded ? this.props.expandButtonLabel : this.props.hideButtonLabel}
|
||||
|
|
|
@ -24,11 +24,7 @@ class ModalAuthFailure extends React.PureComponent<Props> {
|
|||
onAborted={close}
|
||||
>
|
||||
<section className="card__content">
|
||||
<p>
|
||||
{__(
|
||||
'If reloading does not fix this, or you see this at every start up, please email help@lbry.com.'
|
||||
)}
|
||||
</p>
|
||||
<p>{__('If reloading does not fix this, or you see this at every start up, please email help@lbry.com.')}</p>
|
||||
</section>
|
||||
</Modal>
|
||||
);
|
||||
|
|
|
@ -33,12 +33,7 @@ class ModalAutoUpdateConfirm extends React.PureComponent<Props> {
|
|||
<p>{__('Your LBRY update is ready. Restart LBRY now to use it!')}</p>
|
||||
<p className="help">
|
||||
{__('Want to know what has changed?')} See the{' '}
|
||||
<Button
|
||||
button="link"
|
||||
label={__('release notes')}
|
||||
href="https://github.com/lbryio/lbry-desktop/releases"
|
||||
/>
|
||||
.
|
||||
<Button button="link" label={__('release notes')} href="https://github.com/lbryio/lbry-desktop/releases" />.
|
||||
</p>
|
||||
</section>
|
||||
</Modal>
|
||||
|
|
|
@ -50,12 +50,7 @@ class ModalAutoUpdateDownloaded extends React.PureComponent<Props, State> {
|
|||
<p>{__('A new version of LBRY is ready for you.')}</p>
|
||||
<p className="help">
|
||||
{__('Want to know what has changed?')} See the{' '}
|
||||
<Button
|
||||
button="link"
|
||||
label={__('release notes')}
|
||||
href="https://github.com/lbryio/lbry-desktop/releases"
|
||||
/>
|
||||
.
|
||||
<Button button="link" label={__('release notes')} href="https://github.com/lbryio/lbry-desktop/releases" />.
|
||||
</p>
|
||||
</section>
|
||||
</Modal>
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { doStartUpgrade, doCancelUpgrade, doHideModal } from 'redux/actions/app';
|
||||
import {
|
||||
selectDownloadProgress,
|
||||
selectDownloadComplete,
|
||||
selectUpgradeDownloadPath,
|
||||
} from 'redux/selectors/app';
|
||||
import { selectDownloadProgress, selectDownloadComplete, selectUpgradeDownloadPath } from 'redux/selectors/app';
|
||||
import ModalDownloading from './view';
|
||||
|
||||
const select = state => ({
|
||||
|
|
|
@ -14,37 +14,18 @@ type Props = {
|
|||
|
||||
class ModalDownloading extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const {
|
||||
downloadProgress,
|
||||
downloadComplete,
|
||||
downloadItem,
|
||||
startUpgrade,
|
||||
cancelUpgrade,
|
||||
} = this.props;
|
||||
const { downloadProgress, downloadComplete, downloadItem, startUpgrade, cancelUpgrade } = this.props;
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title={__('Downloading Update')}
|
||||
isOpen
|
||||
contentLabel={__('Downloading Update')}
|
||||
type="custom"
|
||||
>
|
||||
<Modal title={__('Downloading Update')} isOpen contentLabel={__('Downloading Update')} type="custom">
|
||||
<section className="card__content">
|
||||
{downloadProgress ? `${downloadProgress}% ${__('complete')}` : null}
|
||||
<Line percent={downloadProgress || 0} strokeWidth="4" />
|
||||
{downloadComplete ? (
|
||||
<React.Fragment>
|
||||
<p>{__('Click "Begin Upgrade" to start the upgrade process.')}</p>
|
||||
<p>
|
||||
{__(
|
||||
'The app will close, and you will be prompted to install the latest version of LBRY.'
|
||||
)}
|
||||
</p>
|
||||
<p>
|
||||
{__(
|
||||
'To launch installation manually, close LBRY and run the command below in the terminal.'
|
||||
)}
|
||||
</p>
|
||||
<p>{__('The app will close, and you will be prompted to install the latest version of LBRY.')}</p>
|
||||
<p>{__('To launch installation manually, close LBRY and run the command below in the terminal.')}</p>
|
||||
<blockquote>sudo dpkg -i {downloadItem}</blockquote>
|
||||
<p>{__('After the install is complete, please reopen the app.')}</p>
|
||||
</React.Fragment>
|
||||
|
@ -52,9 +33,7 @@ class ModalDownloading extends React.PureComponent<Props> {
|
|||
</section>
|
||||
|
||||
<div className="card__actions">
|
||||
{downloadComplete ? (
|
||||
<Button button="primary" label={__('Begin Upgrade')} onClick={startUpgrade} />
|
||||
) : null}
|
||||
{downloadComplete ? <Button button="primary" label={__('Begin Upgrade')} onClick={startUpgrade} /> : null}
|
||||
<Button button="link" label={__('Cancel')} onClick={cancelUpgrade} />
|
||||
</div>
|
||||
</Modal>
|
||||
|
|
|
@ -40,13 +40,7 @@ class ModalError extends React.PureComponent<Props> {
|
|||
}
|
||||
|
||||
return (
|
||||
<Modal
|
||||
isOpen
|
||||
contentLabel={__('Error')}
|
||||
title={__('Error')}
|
||||
className="error-modal"
|
||||
onConfirmed={closeModal}
|
||||
>
|
||||
<Modal isOpen contentLabel={__('Error')} title={__('Error')} className="error-modal" onConfirmed={closeModal}>
|
||||
<section className="card__content">
|
||||
<p>
|
||||
{__(
|
||||
|
|
|
@ -17,12 +17,7 @@ class ModalFileTimeout extends React.PureComponent<Props> {
|
|||
} = this.props;
|
||||
|
||||
return (
|
||||
<Modal
|
||||
isOpen
|
||||
title={__('Unable to Download')}
|
||||
contentLabel={__('Download failed')}
|
||||
onConfirmed={closeModal}
|
||||
>
|
||||
<Modal isOpen title={__('Unable to Download')} contentLabel={__('Download failed')} onConfirmed={closeModal}>
|
||||
<section className="card__content">
|
||||
<p className="error-modal__error-list">
|
||||
{__('LBRY was unable to download the stream')}:
|
||||
|
|
|
@ -20,21 +20,13 @@ class ModalFirstReward extends React.PureComponent<Props> {
|
|||
>
|
||||
<section className="card__content">
|
||||
<p>{__('You just earned your first reward!')}</p>
|
||||
<p>
|
||||
{__(
|
||||
"This reward will show in your Wallet in the top left momentarily (if it hasn't already)."
|
||||
)}
|
||||
</p>
|
||||
<p>{__("This reward will show in your Wallet in the top left momentarily (if it hasn't already).")}</p>
|
||||
<p>
|
||||
{__(
|
||||
'These credits are used to compensate creators, to publish your own content, and to have say in how the network works.'
|
||||
)}
|
||||
</p>
|
||||
<p>
|
||||
{__(
|
||||
'No need to understand it all just yet! Try watching or publishing something next.'
|
||||
)}
|
||||
</p>
|
||||
<p>{__('No need to understand it all just yet! Try watching or publishing something next.')}</p>
|
||||
</section>
|
||||
</Modal>
|
||||
);
|
||||
|
|
|
@ -28,12 +28,7 @@ class ModalIncompatibleDaemon extends React.PureComponent<Props> {
|
|||
{__(
|
||||
'This app is running with an incompatible version of the LBRY protocol. You can still use it, but there may be issues. Re-run the installation package for best results.'
|
||||
)}{' '}
|
||||
<Button
|
||||
button="link"
|
||||
label={__('Learn more')}
|
||||
href="https://lbry.com/faq/incompatible-protocol-version"
|
||||
/>
|
||||
.
|
||||
<Button button="link" label={__('Learn more')} href="https://lbry.com/faq/incompatible-protocol-version" />.
|
||||
</p>
|
||||
</div>
|
||||
</Modal>
|
||||
|
|
|
@ -42,11 +42,7 @@ class ModalOpenExternalLink extends React.PureComponent<Props> {
|
|||
<section className="card__content">
|
||||
<p>{__('This link leads to an external website.')}</p>
|
||||
<blockquote>{uri}</blockquote>
|
||||
<p>
|
||||
{__(
|
||||
'LBRY Inc is not responsible for its content, click continue to proceed at your own risk.'
|
||||
)}
|
||||
</p>
|
||||
<p>{__('LBRY Inc is not responsible for its content, click continue to proceed at your own risk.')}</p>
|
||||
</section>
|
||||
</Modal>
|
||||
);
|
||||
|
|
|
@ -7,7 +7,7 @@ import { withRouter } from 'react-router-dom';
|
|||
|
||||
const LazyUserPhoneNew = React.lazy(() =>
|
||||
import(/* webpackChunkName: "userPhoneNew" */
|
||||
'component/userPhoneNew')
|
||||
'component/userPhoneNew')
|
||||
);
|
||||
|
||||
type Props = {
|
||||
|
|
|
@ -27,9 +27,7 @@ class ModalRemoveFile extends React.PureComponent<Props, State> {
|
|||
};
|
||||
|
||||
(this: any).handleDeleteCheckboxClicked = this.handleDeleteCheckboxClicked.bind(this);
|
||||
(this: any).handleAbandonClaimCheckboxClicked = this.handleAbandonClaimCheckboxClicked.bind(
|
||||
this
|
||||
);
|
||||
(this: any).handleAbandonClaimCheckboxClicked = this.handleAbandonClaimCheckboxClicked.bind(this);
|
||||
}
|
||||
|
||||
handleDeleteCheckboxClicked() {
|
||||
|
@ -63,8 +61,7 @@ class ModalRemoveFile extends React.PureComponent<Props, State> {
|
|||
>
|
||||
<section className="card__content">
|
||||
<p>
|
||||
{__("Are you sure you'd like to remove")} <cite>{`"${title}"`}</cite>{' '}
|
||||
{__('from the LBRY app?')}
|
||||
{__("Are you sure you'd like to remove")} <cite>{`"${title}"`}</cite> {__('from the LBRY app?')}
|
||||
</p>
|
||||
</section>
|
||||
<section className="card__content">
|
||||
|
|
|
@ -59,8 +59,7 @@ class ModalRevokeClaim extends React.PureComponent<Props> {
|
|||
|
||||
render() {
|
||||
const { transactionItems, txid, nout, closeModal } = this.props;
|
||||
const { type } =
|
||||
transactionItems.find(claim => claim.txid === txid && claim.nout === nout) || {};
|
||||
const { type } = transactionItems.find(claim => claim.txid === txid && claim.nout === nout) || {};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
|
|
|
@ -17,8 +17,7 @@ const select = state => ({
|
|||
|
||||
const perform = dispatch => ({
|
||||
closeModal: () => dispatch(doHideModal()),
|
||||
submitRewardCode: code =>
|
||||
dispatch(doClaimRewardType(REWARD_TYPES.TYPE_REWARD_CODE, { params: { code } })),
|
||||
submitRewardCode: code => dispatch(doClaimRewardType(REWARD_TYPES.TYPE_REWARD_CODE, { params: { code } })),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
|
|
|
@ -48,12 +48,7 @@ class ModalRewardCode extends React.PureComponent<Props, State> {
|
|||
<p>
|
||||
{__('Redeem a custom reward code for LBC')}
|
||||
{'. '}
|
||||
<Button
|
||||
button="link"
|
||||
href="https://lbry.com/faq/rewards#reward-code"
|
||||
label={__('Learn more')}
|
||||
/>
|
||||
.
|
||||
<Button button="link" href="https://lbry.com/faq/rewards#reward-code" label={__('Learn more')} />.
|
||||
</p>
|
||||
<FormField
|
||||
autoFocus
|
||||
|
|
|
@ -15,12 +15,7 @@ class ModalSocialShare extends React.PureComponent<Props> {
|
|||
const { closeModal, uri, speechShareable, isChannel } = this.props;
|
||||
return (
|
||||
<Modal isOpen onAborted={closeModal} type="custom" title={__('Share')}>
|
||||
<SocialShare
|
||||
uri={uri}
|
||||
onDone={closeModal}
|
||||
speechShareable={speechShareable}
|
||||
isChannel={isChannel}
|
||||
/>
|
||||
<SocialShare uri={uri} onDone={closeModal} speechShareable={speechShareable} isChannel={isChannel} />
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -11,12 +11,7 @@ class ModalTransactionFailed extends React.PureComponent<Props> {
|
|||
const { closeModal } = this.props;
|
||||
|
||||
return (
|
||||
<Modal
|
||||
isOpen
|
||||
contentLabel={__('Transaction failed')}
|
||||
title={__('Transaction Failed')}
|
||||
onConfirmed={closeModal}
|
||||
>
|
||||
<Modal isOpen contentLabel={__('Transaction failed')} title={__('Transaction Failed')} onConfirmed={closeModal}>
|
||||
<section className="card__content">
|
||||
<p>{__('Sorry about that. Contact help@lbry.com if you continue to have issues.')}</p>
|
||||
</section>
|
||||
|
|
|
@ -30,12 +30,7 @@ class ModalUpgrade extends React.PureComponent<Props> {
|
|||
</p>
|
||||
<p className="help">
|
||||
{__('Want to know what has changed?')} See the{' '}
|
||||
<Button
|
||||
button="link"
|
||||
label={__('release notes')}
|
||||
href="https://github.com/lbryio/lbry-desktop/releases"
|
||||
/>
|
||||
.
|
||||
<Button button="link" label={__('release notes')} href="https://github.com/lbryio/lbry-desktop/releases" />.
|
||||
</p>
|
||||
</div>
|
||||
</Modal>
|
||||
|
|
|
@ -52,12 +52,7 @@ class ModalWalletDecrypt extends React.PureComponent<Props, State> {
|
|||
{__(
|
||||
'Your wallet has been encrypted with a local password, performing this action will remove this password.'
|
||||
)}{' '}
|
||||
<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" />.
|
||||
</p>
|
||||
</section>
|
||||
</Modal>
|
||||
|
|
|
@ -105,12 +105,7 @@ class ModalWalletEncrypt extends React.PureComponent<Props, State> {
|
|||
{__(
|
||||
'Encrypting your wallet will require a password to access your local wallet data when LBRY starts. Please enter a new password for your wallet.'
|
||||
)}{' '}
|
||||
<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" />.
|
||||
</p>
|
||||
<fieldset-section>
|
||||
<FormField
|
||||
|
|
|
@ -55,12 +55,7 @@ class ModalWalletUnlock extends React.PureComponent<Props, State> {
|
|||
{__(
|
||||
'Your wallet has been encrypted with a local password. Please enter your wallet password to proceed.'
|
||||
)}{' '}
|
||||
<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" />.
|
||||
</p>
|
||||
<FormField
|
||||
autoFocus
|
||||
|
|
|
@ -14,13 +14,11 @@ const ModalWelcome = (props: Props) => {
|
|||
<Modal type="custom" isOpen contentLabel="Welcome to LBRY" title={__('Welcome to LBRY')}>
|
||||
<section className="card__content">
|
||||
<p>
|
||||
{__('Using LBRY is like dating a centaur. Totally normal up top, and')}{' '}
|
||||
<em>{__('way different')}</em> {__('underneath.')}
|
||||
{__('Using LBRY is like dating a centaur. Totally normal up top, and')} <em>{__('way different')}</em>{' '}
|
||||
{__('underneath.')}
|
||||
</p>
|
||||
<p>{__('Up top, LBRY is similar to popular media sites.')}</p>
|
||||
<p>
|
||||
{__('Below, LBRY is controlled by users -- you -- via blockchain and decentralization.')}
|
||||
</p>
|
||||
<p>{__('Below, LBRY is controlled by users -- you -- via blockchain and decentralization.')}</p>
|
||||
</section>
|
||||
<div className="card__actions">
|
||||
<Button button="primary" onClick={closeModal} label={__("I'm In")} />
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue