web cleanup

This commit is contained in:
Sean Yesmunt 2019-03-08 14:20:17 -05:00
parent 584f923491
commit 8ee1d2319d
15 changed files with 28 additions and 28 deletions

1
.gitignore vendored
View file

@ -2,6 +2,7 @@
/node_modules /node_modules
/dist /dist
/static/lbrynet /static/lbrynet
/static/daemon
/static/locales /static/locales
yarn-error.log yarn-error.log
package-lock.json package-lock.json

View file

@ -24,7 +24,7 @@
"compile:web": "webpack --config webpack.web.config.js", "compile:web": "webpack --config webpack.web.config.js",
"compile": "yarn compile:electron && yarn compile:web", "compile": "yarn compile:electron && yarn compile:web",
"dev:electron": "webpack-dev-server --hot --progress --config webpack.electron.config.js", "dev:electron": "webpack-dev-server --hot --progress --config webpack.electron.config.js",
"dev:web": "webpack-dev-server --hot --progress --config webpack.web.config.js", "dev:web": "webpack-dev-server --open --hot --progress --config webpack.web.config.js",
"dev:internal-apis": "LBRY_API_URL='http://localhost:8080' yarn dev:electron", "dev:internal-apis": "LBRY_API_URL='http://localhost:8080' yarn dev:electron",
"run:electron": "electron ./dist/electron/main.js", "run:electron": "electron ./dist/electron/main.js",
"run:web": "yarn compile:web && node ./dist/web/server.js", "run:web": "yarn compile:web && node ./dist/web/server.js",

View file

@ -38,7 +38,8 @@ export default class ErrorBoundary extends React.Component<Props, State> {
} }
render() { render() {
if (!this.state.hasError) { console.log('app.env', app.env);
if (this.state.hasError) {
return ( return (
<div className="load-screen"> <div className="load-screen">
<Yrbl <Yrbl

View file

@ -3,11 +3,13 @@ import { remote } from 'electron';
import React from 'react'; import React from 'react';
import LoadingScreen from 'component/common/loading-screen'; import LoadingScreen from 'component/common/loading-screen';
import PdfViewer from 'component/viewers/pdfViewer'; import PdfViewer from 'component/viewers/pdfViewer';
import ThreeViewer from 'component/viewers/threeViewer';
import DocumentViewer from 'component/viewers/documentViewer'; import DocumentViewer from 'component/viewers/documentViewer';
import DocxViewer from 'component/viewers/docxViewer'; import DocxViewer from 'component/viewers/docxViewer';
import HtmlViewer from 'component/viewers/htmlViewer'; import HtmlViewer from 'component/viewers/htmlViewer';
import AudioVideoViewer from 'component/viewers/audioVideoViewer'; import AudioVideoViewer from 'component/viewers/audioVideoViewer';
// @if TARGET='app'
import ThreeViewer from 'component/viewers/threeViewer';
// @endif
type Props = { type Props = {
mediaType: string, mediaType: string,
@ -101,7 +103,10 @@ class FileRender extends React.PureComponent<Props> {
// Supported mediaTypes // Supported mediaTypes
const mediaTypes = { const mediaTypes = {
// @if TARGET='app'
'3D-file': <ThreeViewer source={{ fileType, downloadPath }} theme={currentTheme} />, '3D-file': <ThreeViewer source={{ fileType, downloadPath }} theme={currentTheme} />,
// @endif
application: !source.url ? null : ( application: !source.url ? null : (
<webview <webview
ref={element => this.processSandboxRef(element)} ref={element => this.processSandboxRef(element)}

View file

@ -40,7 +40,7 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
details: __('Starting up'), details: __('Starting up'),
message: __('Connecting'), message: __('Connecting'),
launchedModal: false, launchedModal: false,
error: true, error: false,
launchWithIncompatibleDaemon: false, launchWithIncompatibleDaemon: false,
isRunning: false, isRunning: false,
}; };
@ -213,7 +213,7 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
return ( return (
<React.Fragment> <React.Fragment>
<LoadScreen message={message} details={details} error={error} />; <LoadScreen message={message} details={details} error={error} />
{/* Temp hack: don't show any modals on splash screen daemon is running; {/* Temp hack: don't show any modals on splash screen daemon is running;
daemon doesn't let you quit during startup, so the "Quit" buttons daemon doesn't let you quit during startup, so the "Quit" buttons
in the modals won't work. */} in the modals won't work. */}

View file

@ -1,4 +1,3 @@
/* eslint-disable no-console */
import ErrorBoundary from 'component/errorBoundary'; import ErrorBoundary from 'component/errorBoundary';
import App from 'component/app'; import App from 'component/app';
import SnackBar from 'component/snackBar'; import SnackBar from 'component/snackBar';
@ -215,8 +214,8 @@ const init = () => {
// @if TARGET='app' // @if TARGET='app'
moment.locale(remote.app.getLocale()); moment.locale(remote.app.getLocale());
/* eslint-disable no-console */
autoUpdater.on('error', error => { autoUpdater.on('error', error => {
// eslint-disable-next-line no-console
console.error(error.message); console.error(error.message);
}); });
@ -232,6 +231,7 @@ const init = () => {
app.store.dispatch(doAutoUpdate()); app.store.dispatch(doAutoUpdate());
}); });
} }
/* eslint-enable no-console */
app.store.dispatch(doUpdateIsNightAsync()); app.store.dispatch(doUpdateIsNightAsync());
// @endif // @endif
@ -257,16 +257,14 @@ const init = () => {
// @endif // @endif
} }
if (false && window.sessionStorage.getItem('loaded') === 'y') { if (window.sessionStorage.getItem('loaded') === 'y') {
onDaemonReady(); onDaemonReady();
} else { } else {
ReactDOM.render( ReactDOM.render(
<Provider store={store}> <Provider store={store}>
<SplashScreen <SplashScreen
authenticate={() => app.store.dispatch(doAuthenticate(pjson.version))} authenticate={() => app.store.dispatch(doAuthenticate(pjson.version))}
onReadyToLaunch={() => { onReadyToLaunch={onDaemonReady}
// onDaemonReady
}}
/> />
</Provider>, </Provider>,
document.getElementById('app') document.getElementById('app')
@ -275,6 +273,3 @@ const init = () => {
}; };
init(); init();
/* eslint-enable react/jsx-filename-extension */
/* eslint-enable no-console */

View file

@ -234,7 +234,7 @@ class HelpPage extends React.PureComponent<Props, State> {
</tr> </tr>
<tr> <tr>
<td>{__('Daemon (lbrynet)')}</td> <td>{__('Daemon (lbrynet)')}</td>
<td>{ver ? ver.lbrynet_version : __('Loading')}</td> <td>{ver ? ver.lbrynet_version : __('Loading...')}</td>
</tr> </tr>
<tr> <tr>
<td>{__('Connected Email')}</td> <td>{__('Connected Email')}</td>

View file

@ -18,22 +18,12 @@
} }
.load-screen__button { .load-screen__button {
transition: none;
color: $lbry-white; color: $lbry-white;
// border-bottom: 1px solid $lbry-white; border-bottom: 1px solid $lbry-white;
&:hover { &:hover {
// border-bottom: 1px solid $lbry-blue-1; border-bottom: 1px solid $lbry-blue-1;
color: $lbry-blue-1;
}
}
.load-screen__button:not(:disabled) {
&:not(:hover) {
color: $lbry-white;
// border-bottom: 1px solid $lbry-white;
}
&:hover {
// border-bottom: 1px solid $lbry-blue-1;
color: $lbry-blue-1; color: $lbry-blue-1;
} }
} }

View file

Before

Width:  |  Height:  |  Size: 361 KiB

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 992 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View file

@ -16,6 +16,7 @@ const baseConfig = {
rules: [ rules: [
{ {
test: /\.jsx?$/, test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader', loader: 'babel-loader',
}, },
{ {
@ -51,6 +52,9 @@ const baseConfig = {
test: /\.glsl/, test: /\.glsl/,
use: { use: {
loader: 'file-loader', loader: 'file-loader',
options: {
outputPath: 'ui/three',
},
}, },
}, },
], ],

View file

@ -46,6 +46,10 @@ const webConfig = {
from: `${STATIC_ROOT}/index.html`, from: `${STATIC_ROOT}/index.html`,
to: `${DIST_ROOT}/web/index.html`, to: `${DIST_ROOT}/web/index.html`,
}, },
{
from: `${STATIC_ROOT}/img/favicon.ico`,
to: `${DIST_ROOT}/web/favicon.ico`,
},
{ {
from: `${WEB_PLATFORM_ROOT}/server.js`, from: `${WEB_PLATFORM_ROOT}/server.js`,
to: `${DIST_ROOT}/web/server.js`, to: `${DIST_ROOT}/web/server.js`,