diff --git a/package.json b/package.json index 306794d7d9887e3e48db094646c46fec51e47162..306587b05a01eea452f164b37fd0c654bdfde095 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "precommit": "lint-staged", "production": "NODE_ENV=production node lib/server/index.js", "start": "NODE_ENV=development babel-node ./webpack/dev-server.js", - "webpush": "node ./scripts/webpush_notify.js", "checktranslations": "node scripts/check_translations.js", "storybook": "start-storybook -p 9001 -c .storybook", "storybook-build": "build-storybook -c .storybook -o docs" diff --git a/scripts/webpush_notify.js b/scripts/webpush_notify.js deleted file mode 100644 index 8c0090bdc9e3fbed96017e370a3962ddd562cba6..0000000000000000000000000000000000000000 --- a/scripts/webpush_notify.js +++ /dev/null @@ -1,54 +0,0 @@ -const config = require('config'); -const webPush = require('web-push'); -const Tarantool = require('../src/db/tarantool'); - -webPush.setGCMAPIKey(config.get('notify.gcm_key')); - -function notify(account, nparams, title, body, url, pic) { - if (!nparams.keys || !nparams.keys.auth) return Promise.resolve(false); - var payload = JSON.stringify({ - title, - body, - url, - icon: pic || 'https://steemit.com/favicon.ico' //FIXME domain name from config - }); - return new Promise((resolve, reject) => { - webPush.sendNotification(nparams, payload).then(function() { - resolve(account); - }, function(err) { - reject(err); - }); - }); -} - -async function process_queue() { - try { - const queue = await Tarantool.instance().call('webpush_get_delivery_queue'); - console.log('processing web push notifications queue, length: ', queue.length); - for (const n of queue) { - if (n.length === 0) return; - const [account, nparams_array, title, body, url, pic] = n; - console.log('notification: ', account, body, url, pic); - for (const nparams of nparams_array) { - try { - await notify(account, nparams, title, body, url, pic); - } catch (err) { - console.error('-- error in notify -->', account, nparams, err); - if (err.statusCode && err.statusCode == 410) { - await Tarantool.instance().call('webpush_unsubscribe', account, nparams.keys.auth); - } - } - } - } - } catch (error) { - console.error('-- process_queue error -->', error); - } -} - -function run() { - process_queue().then(() => { - setTimeout(run, 30000); - }); -} - -run(); diff --git a/src/app/components/App.jsx b/src/app/components/App.jsx index 0282b384cc5141b5d1377ff99c5b66006b248c1d..e212ad619311af60f12bacc3ca542e6f3133e349 100644 --- a/src/app/components/App.jsx +++ b/src/app/components/App.jsx @@ -2,7 +2,6 @@ import React from 'react'; import { connect } from 'react-redux'; import AppPropTypes from 'app/utils/AppPropTypes'; import Header from 'app/components/modules/Header'; -import LpFooter from 'app/components/modules/lp/LpFooter'; import * as userActions from 'app/redux/UserReducer'; import TopRightMenu from 'app/components/modules/TopRightMenu'; import { browserHistory } from 'react-router'; @@ -157,7 +156,6 @@ class App extends React.Component { nightmodeEnabled, viewMode, } = this.props; - const lp = false; //location.pathname === '/'; const miniHeader = location.pathname === '/create_account' || location.pathname === '/pick_account'; @@ -281,7 +279,6 @@ class App extends React.Component { return ( <div className={classNames('App', themeClass, { - LP: lp, 'index-page': ip, 'mini-header': miniHeader, 'whistle-view': whistleView, @@ -441,7 +438,6 @@ class App extends React.Component { {welcome_screen} {callout} {children} - {lp ? <LpFooter /> : null} </div> <Dialogs /> <Modals /> diff --git a/src/app/components/all.scss b/src/app/components/all.scss index 7e99bc9fd2bdd61358ee26be9c2bfbbe5d38139d..25d722eb70e6a9692c0bf592ea2353da325f632d 100644 --- a/src/app/components/all.scss +++ b/src/app/components/all.scss @@ -35,9 +35,6 @@ // modules @import "./modules/Header"; -@import "./modules/Footer"; -@import "./modules/lp/LpHeader"; -@import "./modules/lp/LpFooter"; @import "./modules/SignUp"; @import "./modules/LoginForm"; @import "./modules/MiniHeader"; diff --git a/src/app/components/cards/PostHistoryRow.jsx b/src/app/components/cards/PostHistoryRow.jsx deleted file mode 100644 index f5943452e53c177e0284a0d701023a61c83ef33a..0000000000000000000000000000000000000000 --- a/src/app/components/cards/PostHistoryRow.jsx +++ /dev/null @@ -1,58 +0,0 @@ -import React from 'react'; -import { Link } from 'react-router'; -import TimeAgoWrapper from 'app/components/elements/TimeAgoWrapper'; -import Icon from 'app/components/elements/Icon'; -import tt from 'counterpart'; - -export default class PostHistoryRow extends React.Component { - render() { - const op = this.props.op; - console.log('op: ', op); - const context = this.props.context; /// account perspective - - const parent_author = op[1].op[1].parent_author; - const author = op[1].op[1].author; - const parent_link = '/@' + parent_author; - const author_link = '/@' + author; - const parent_perm = op[1].op[1].parent_permlink; - const permlink = op[1].op[1].permlink; - let in_reply_to = <span />; - if (parent_author && parent_author != context) - in_reply_to = ( - <span> - {tt('g.in_reply_to') + ' '} - <Link to={parent_link}>@{parent_author}</Link> - </span> - ); - else if (parent_author == context) - in_reply_to = ( - <span> - <Link to={author_link}>@{author}</Link>{' '} - {tt('g.replied_to', { account: parent_author })} - </span> - ); - - // const content_markdown = op[1].op[1].body; - // const body = (<MarkdownViewer formId={} text={content_markdown} jsonMetadata={} />) - const post_link = - '/' + op[1].op[1].parent_permlink + author_link + '/' + permlink; - - return ( - <div> - <div className="row"> - <div className="column small-12"> - <h4> - <Link to={post_link}>{op[1].op[1].title}</Link> - </h4> - </div> - </div> - <div className="row"> - <div className="column small-12"> - <Icon name="clock" className="space-right" /> - <TimeAgoWrapper date={op[1].timestamp} /> {in_reply_to} - </div> - </div> - </div> - ); - } -} diff --git a/src/app/components/cards/VoteHistoryRow.jsx b/src/app/components/cards/VoteHistoryRow.jsx deleted file mode 100644 index efbd746a42da274848a298f65b482e5187a7b1ea..0000000000000000000000000000000000000000 --- a/src/app/components/cards/VoteHistoryRow.jsx +++ /dev/null @@ -1,58 +0,0 @@ -import React from 'react'; -import { Link } from 'react-router'; -import TimeAgoWrapper from 'app/components/elements/TimeAgoWrapper'; -import Icon from 'app/components/elements/Icon'; -import tt from 'counterpart'; - -export default class VoteHistoryRow extends React.Component { - render() { - const op = this.props.op; - // console.log( "op: ", op ); - const context = this.props.context; /// account perspective - - const parent_author = op[1].op[1].parent_author; - const author = op[1].op[1].author; - const parent_link = '/@' + parent_author; - const author_link = '/@' + author; - const parent_perm = op[1].op[1].parent_permlink; - const permlink = op[1].op[1].permlink; - let in_reply_to = <span />; - if (parent_author && parent_author != context) - in_reply_to = ( - <span> - {tt('g.in_reply_to')}{' '} - <Link to={parent_link}>@{parent_author}</Link> - </span> - ); - else if (parent_author == context) - in_reply_to = ( - <span> - <Link to={author_link}>@{author}</Link>{' '} - {tt('g.replied_to', { account: parent_author })} - </span> - ); - - // const content_markdown = op[1].op[1].body; - // const body = (<MarkdownViewer formId={} text={content_markdown} jsonMetadata={} />) - const post_link = - '/' + op[1].op[1].parent_permlink + author_link + '/' + permlink; - - return ( - <div> - <div className="row"> - <div className="column small-12"> - <h2> - <Link to={post_link}>{op[1].op[1].title}</Link> - </h2> - </div> - </div> - <div className="row"> - <div className="column small-12"> - <Icon name="clock" className="space-right" /> - <TimeAgoWrapper date={op[1].timestamp} /> {in_reply_to} - </div> - </div> - </div> - ); - } -} diff --git a/src/app/components/modules/Footer.jsx b/src/app/components/modules/Footer.jsx deleted file mode 100644 index b65a0ac7af0f74a3189ed3e981de88ec090276d6..0000000000000000000000000000000000000000 --- a/src/app/components/modules/Footer.jsx +++ /dev/null @@ -1,38 +0,0 @@ -import React from 'react'; -import { Link } from 'react-router'; -import { connect } from 'react-redux'; -import tt from 'counterpart'; - -const Footer = props => ( - <footer className="Footer row expanded"> - <div className="large-6 columns"> - <ul className="menu"> - <li> - <Link to="/about.html">{tt('navigation.about')}</Link> - </li> - <li> - <Link to="/privacy.html" rel="nofollow"> - {tt('navigation.privacy_policy')} - </Link> - </li> - <li> - <Link to="/tos.html" rel="nofollow"> - {tt('navigation.terms_of_service')} - </Link> - </li> - <li> - <Link to="/~witnesses">{tt('navigation.witnesses')}</Link> - </li> - </ul> - </div> - <div className="large-6 columns"> - <div className="Footer__section float-right" /> - </div> - </footer> -); - -Footer.propTypes = {}; - -export default connect(state => { - return {}; -})(Footer); diff --git a/src/app/components/modules/Footer.scss b/src/app/components/modules/Footer.scss deleted file mode 100644 index 5d2155de9161899c8bc720e92aa1dd6294790c28..0000000000000000000000000000000000000000 --- a/src/app/components/modules/Footer.scss +++ /dev/null @@ -1,13 +0,0 @@ -.Footer { - border: none; - margin-top: 2rem; - margin-bottom: 0; - border-right: none; - border-radius: 0; - background-color: $medium-gray; -} - -.Footer__section { - line-height: 1.5rem; - padding: 0.7rem 1rem; -} diff --git a/src/app/components/modules/lp/LpFooter.jsx b/src/app/components/modules/lp/LpFooter.jsx deleted file mode 100644 index 4fdad3633ffdac4310e8b1789468cbb62885a637..0000000000000000000000000000000000000000 --- a/src/app/components/modules/lp/LpFooter.jsx +++ /dev/null @@ -1,9 +0,0 @@ -import React, { PropTypes } from 'react'; -import { Link } from 'react-router'; -import { connect } from 'react-redux'; - -export default class LpFooter extends React.Component { - render() { - return <footer className="LpFooter row expanded" />; - } -} diff --git a/src/app/components/modules/lp/LpFooter.scss b/src/app/components/modules/lp/LpFooter.scss deleted file mode 100644 index 8725c7616c5e4d65eb3107a7e23f4d364debae7c..0000000000000000000000000000000000000000 --- a/src/app/components/modules/lp/LpFooter.scss +++ /dev/null @@ -1,4 +0,0 @@ -.LpFooter { - height: 183px; - background-image: url(~assets/images/lp-bottom.jpg); -} diff --git a/src/app/components/modules/lp/LpHeader.jsx b/src/app/components/modules/lp/LpHeader.jsx deleted file mode 100644 index 6954123e6964cf28741d60e6d68f1e30f98bf740..0000000000000000000000000000000000000000 --- a/src/app/components/modules/lp/LpHeader.jsx +++ /dev/null @@ -1,24 +0,0 @@ -import React from 'react'; -import { Link } from 'react-router'; -import tt from 'counterpart'; - -export default class LpHeader extends React.Component { - render() { - return ( - <header className="LpHeader"> - <div className="top-bar"> - <div className="top-bar-left" /> - <div className="top-bar-right"> - <ul className="menu"> - <li> - <Link to="/trending" activeClassName="active"> - {tt('g.browse')} - </Link> - </li> - </ul> - </div> - </div> - </header> - ); - } -} diff --git a/src/app/components/modules/lp/LpHeader.scss b/src/app/components/modules/lp/LpHeader.scss deleted file mode 100644 index 8b2e136491c578d6138c9eea41907e6cd81d6ee0..0000000000000000000000000000000000000000 --- a/src/app/components/modules/lp/LpHeader.scss +++ /dev/null @@ -1,8 +0,0 @@ -.LpHeader { - .top-bar { - background-color: #fafbfc; - } - ul > li > a { - background-color: #fafbfc; - } -}