apply lbrytv tag to users on web #2333

Merged
neb-b merged 1 commit from lbrytv-tag into master 2019-03-14 16:14:18 +01:00
6 changed files with 56 additions and 16 deletions

View file

@ -26,7 +26,7 @@
"dev": "yarn dev:electron",
"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: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:web": "cross-env NODE_ENV=production yarn compile:web && node ./dist/web/server.js",
"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
//
const spring = {
type: 'spring',
stiffness: 100,
damping: 10,
mass: 1,
transition: {
duration: 250,
ease: 'easeOut',
},
};
const Welcome = posed.div({
@ -40,6 +40,36 @@ type 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() {
const {
welcomeAcknowledged,
@ -69,17 +99,8 @@ export default class FirstRun extends PureComponent<Props> {
<h1 className="card__title">{__('Hi There')}</h1>
</header>
<div className="card__content">
<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>
<div className="card__actions">
{this.getWelcomeMessage()}
<div className="card__actions card__actions--top-space">
<Button button="primary" onClick={acknowledgeWelcome} label={__("I'm In")} />
</div>
</div>

View file

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

View file

@ -59,7 +59,9 @@ reducers[ACTIONS.CLIENT_SETTING_CHANGED] = (state, action) => {
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
// @if TARGET='app'
localStorage.setItem(`setting_${key}`, JSON.stringify(value));
// @endif
return Object.assign({}, state, {
clientSettings,

View file

@ -139,11 +139,13 @@ export const selectNavLinks = createSelector(
// 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.
const guidedTourItem = [
// @if TARGET='app'
{
page: PAGES.INVITE,
hasBeenCompleted: inviteAcknowledged,
guide: 'Check this out!',
},
// @endif
// Add more items below for tooltip guides that will happen after a user has completed the invite guide
].filter(({ hasBeenCompleted }) => !hasBeenCompleted)[0];

View file

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