first run for web with lbrytv tag

This commit is contained in:
Sean Yesmunt 2019-03-13 15:17:17 -04:00
parent 4456442545
commit 50a1c97143
6 changed files with 56 additions and 16 deletions

View file

@ -26,7 +26,7 @@
"dev": "yarn dev:electron", "dev": "yarn dev:electron",
"dev:electron": "cross-env NODE_ENV=development node ./src/platforms/electron/devServer.js", "dev:electron": "cross-env NODE_ENV=development node ./src/platforms/electron/devServer.js",
"dev:web": "webpack-dev-server --open --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:9090' yarn dev:electron",
"run:electron": "electron ./dist/electron/main.js", "run:electron": "electron ./dist/electron/main.js",
"run:web": "cross-env NODE_ENV=production yarn compile:web && node ./dist/web/server.js", "run:web": "cross-env NODE_ENV=production yarn compile:web && node ./dist/web/server.js",
"pack": "electron-builder --dir", "pack": "electron-builder --dir",

View file

@ -10,10 +10,10 @@ import Yrbl from 'component/yrbl';
// The height for items must be static (in banner.scss) so that we can reliably animate into the banner and be vertically centered // The height for items must be static (in banner.scss) so that we can reliably animate into the banner and be vertically centered
// //
const spring = { const spring = {
type: 'spring', transition: {
stiffness: 100, duration: 250,
damping: 10, ease: 'easeOut',
mass: 1, },
}; };
const Welcome = posed.div({ const Welcome = posed.div({
@ -40,6 +40,36 @@ type Props = {
}; };
export default class FirstRun extends PureComponent<Props> { export default class FirstRun extends PureComponent<Props> {
getWelcomeMessage() {
/* eslint-disable no-unreachable */
// @if TARGET='app'
return (
<React.Fragment>
<p>
{__('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>
</React.Fragment>
);
// @endif
// @if TARGET='web'
return (
<React.Fragment>
<p>{__('Thanks for trying out lbry.tv')}</p>
<p>
{__(
"Some things still don't work they way they are supposed to, but we are working hard to make that better."
)}
</p>
</React.Fragment>
);
// @endif
/* eslint-enable */
}
render() { render() {
const { const {
welcomeAcknowledged, welcomeAcknowledged,
@ -69,17 +99,8 @@ export default class FirstRun extends PureComponent<Props> {
<h1 className="card__title">{__('Hi There')}</h1> <h1 className="card__title">{__('Hi There')}</h1>
</header> </header>
<div className="card__content"> <div className="card__content">
<p> {this.getWelcomeMessage()}
{__('Using LBRY is like dating a centaur. Totally normal up top, and')}{' '} <div className="card__actions card__actions--top-space">
<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>
<div className="card__actions">
<Button button="primary" onClick={acknowledgeWelcome} label={__("I'm In")} /> <Button button="primary" onClick={acknowledgeWelcome} label={__("I'm In")} />
</div> </div>
</div> </div>

View file

@ -1,6 +1,7 @@
// @flow // @flow
import * as React from 'react'; import * as React from 'react';
import { FormField, Form, Submit } from 'component/common/form'; import { FormField, Form, Submit } from 'component/common/form';
import { Lbryio } from 'lbryinc';
type Props = { type Props = {
cancelButton: React.Node, cancelButton: React.Node,
@ -35,6 +36,10 @@ class UserEmailNew extends React.PureComponent<Props, State> {
const { email } = this.state; const { email } = this.state;
const { addUserEmail } = this.props; const { addUserEmail } = this.props;
addUserEmail(email); addUserEmail(email);
// @if TARGET='web'
Lbryio.call('user_tag', 'edit', { add: 'lbrytv' });
// @endif
} }
render() { render() {
@ -45,7 +50,14 @@ class UserEmailNew extends React.PureComponent<Props, State> {
<header className="card__header"> <header className="card__header">
<h2 className="card__title">{__("Don't Miss Out")}</h2> <h2 className="card__title">{__("Don't Miss Out")}</h2>
<p className="card__subtitle"> <p className="card__subtitle">
{/* @if TARGET='app' */}
{__("We'll let you know about LBRY updates, security issues, and great new content.")} {__("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.'
)}
{/* @endif */}
</p> </p>
</header> </header>

View file

@ -59,7 +59,9 @@ reducers[ACTIONS.CLIENT_SETTING_CHANGED] = (state, action) => {
clientSettings[key] = value; clientSettings[key] = value;
// this technically probably shouldn't happen here, and should be fixed when we're no longer using localStorage at all for persistent app state // this technically probably shouldn't happen here, and should be fixed when we're no longer using localStorage at all for persistent app state
// @if TARGET='app'
localStorage.setItem(`setting_${key}`, JSON.stringify(value)); localStorage.setItem(`setting_${key}`, JSON.stringify(value));
// @endif
return Object.assign({}, state, { return Object.assign({}, state, {
clientSettings, clientSettings,

View file

@ -139,11 +139,13 @@ export const selectNavLinks = createSelector(
// Determine if any links should show a tooltip for a guided tour // Determine if any links should show a tooltip for a guided tour
// It will only show one at a time, in the order they are set. // It will only show one at a time, in the order they are set.
const guidedTourItem = [ const guidedTourItem = [
// @if TARGET='app'
{ {
page: PAGES.INVITE, page: PAGES.INVITE,
hasBeenCompleted: inviteAcknowledged, hasBeenCompleted: inviteAcknowledged,
guide: 'Check this out!', guide: 'Check this out!',
}, },
// @endif
// Add more items below for tooltip guides that will happen after a user has completed the invite guide // Add more items below for tooltip guides that will happen after a user has completed the invite guide
].filter(({ hasBeenCompleted }) => !hasBeenCompleted)[0]; ].filter(({ hasBeenCompleted }) => !hasBeenCompleted)[0];

View file

@ -117,10 +117,13 @@ const persistOptions = {
storage: localForage, storage: localForage,
}; };
// Dont' persist anything on web (for now)
// @if TARGET='app'
window.cacheStore = persistStore(store, persistOptions, err => { window.cacheStore = persistStore(store, persistOptions, err => {
if (err) { if (err) {
console.error('Unable to load saved settings'); // eslint-disable-line no-console console.error('Unable to load saved settings'); // eslint-disable-line no-console
} }
}); });
// @endif
export default store; export default store;